Skip to content

Commit

Permalink
Fix the command argument in the clinit error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
vjovanov committed Sep 15, 2023
1 parent 699ff73 commit a28e629
Showing 1 changed file with 4 additions and 2 deletions.
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 a28e629

Please sign in to comment.