Skip to content

Commit

Permalink
[GR-48529] Use the API flag in the init hint.
Browse files Browse the repository at this point in the history
PullRequest: graal/15562
  • Loading branch information
vjovanov authored and marwan-hallaoui committed Sep 28, 2023
2 parents 9f039be + 25e338f commit 9a99ef6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void createAdditionalArtifacts(@SuppressWarnings("unused") BuildArtifacts
protected List<UserRecommendation> getRecommendations() {
return List.of(// in order of appearance:
new UserRecommendation("INIT",
"Adopt " + SubstrateOptionsParser.commandArgument(ClassInitializationOptions.StrictImageHeap, "+", "strict-initial-heap", true, false) +
"Adopt " + SubstrateOptionsParser.commandArgument(ClassInitializationOptions.StrictImageHeap, "+", "strict-image-heap", true, false) +
" to prepare for the next GraalVM release.",
() -> !ClassInitializationOptions.StrictImageHeap.getValue()),
new UserRecommendation("AWT", "Use the tracing agent to collect metadata for AWT.", ProgressReporterFeature::recommendTraceAgentForAWT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,17 @@ private Object checkImageHeapInstance(Object obj) {
});

if (ClassInitializationOptions.StrictImageHeap.getValue()) {
msg += System.lineSeparator();
msg += """
If you are seeing this message after enabling %s, this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include %s in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
"""
.replaceAll("\n", System.lineSeparator())
.formatted(
SubstrateOptionsParser.commandArgument(ClassInitializationOptions.StrictImageHeap, typeName, "strict-image-heap", true, false),
SubstrateOptionsParser.commandArgument(ClassInitializationOptions.ClassInitialization, typeName, "initialize-at-build-time", true, false));
SubstrateOptionsParser.commandArgument(ClassInitializationOptions.StrictImageHeap, "+", "strict-image-heap", true, false),
SubstrateOptionsParser.commandArgument(ClassInitializationOptions.ClassInitialization, proxyOrLambda ? proxyLambdaInterfaceCSV : typeName,
"initialize-at-build-time", true, false));
}

msg += System.lineSeparator() + "The following detailed trace displays from which field in the code the object was reached.";
Expand Down

0 comments on commit 9a99ef6

Please sign in to comment.