Skip to content

Commit 5547b9f

Browse files
committed
Fix ignore list for Preserve
1 parent 75b5b6e commit 5547b9f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,8 +1441,8 @@ public enum ReportingMode {
14411441
public static final HostedOptionKey<AccumulatingLocatableMultiOptionValue.Strings> Preserve = new HostedOptionKey<>(AccumulatingLocatableMultiOptionValue.Strings.build());
14421442

14431443
@Option(help = "Ignore classes or packages (comma separated) from the ones included with '-H:Preserve'. This can be used to workaround potential issues related to '-H:Preserve'.", type = OptionType.Debug) //
1444-
public static final HostedOptionKey<AccumulatingLocatableMultiOptionValue.Strings> IgnorePreserveForClasses = new HostedOptionKey<>(AccumulatingLocatableMultiOptionValue.Strings.build());
1445-
1444+
public static final HostedOptionKey<AccumulatingLocatableMultiOptionValue.Strings> IgnorePreserveForClasses = new HostedOptionKey<>(
1445+
AccumulatingLocatableMultiOptionValue.Strings.buildWithCommaDelimiter());
14461446
@Option(help = "Force include include all public types and methods that can be reached using normal Java access rules.")//
14471447
public static final HostedOptionKey<Boolean> UseBaseLayerInclusionPolicy = new HostedOptionKey<>(false);
14481448

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/PreserveOptionsSupport.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ public static void registerPreservedClasses(NativeImageClassLoaderSupport classL
227227
});
228228

229229
for (String className : classLoaderSupport.getClassNamesToPreserve()) {
230-
reflection.registerClassLookup(always, className);
230+
if (!classesOrPackagesToIgnore.contains(className)) {
231+
reflection.registerClassLookup(always, className);
232+
}
231233
}
232234
}
233235
}

0 commit comments

Comments
 (0)