Skip to content

Commit c638251

Browse files
committed
[GR-64735] Fix the ignore list for Preserve.
PullRequest: graal/20879
2 parents 54d1a2f + 5547b9f commit c638251

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
@@ -245,7 +245,9 @@ public static void registerPreservedClasses(NativeImageClassLoaderSupport classL
245245
});
246246

247247
for (String className : classLoaderSupport.getClassNamesToPreserve()) {
248-
reflection.registerClassLookup(always, className);
248+
if (!classesOrPackagesToIgnore.contains(className)) {
249+
reflection.registerClassLookup(always, className);
250+
}
249251
}
250252
}
251253

0 commit comments

Comments
 (0)