Skip to content

Commit

Permalink
[GR-57996] Support host VM that don't have have FlightRecorder VM opt…
Browse files Browse the repository at this point in the history
…ion.

PullRequest: graal/18770
  • Loading branch information
gilles-duboscq committed Sep 12, 2024
2 parents 52d665e + b79b5e9 commit 6038ea0
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ public class JfrFeature implements InternalFeature {
* code sets the FlightRecorder option as a side effect. Therefore, we must ensure that we check
* the value of the option before it can be affected by image building.
*/
private static final boolean HOSTED_ENABLED = Boolean.parseBoolean(getDiagnosticBean().getVMOption("FlightRecorder").getValue());
private static final boolean HOSTED_ENABLED;
static {
boolean hostEnabled;
try {
hostEnabled = Boolean.parseBoolean(getDiagnosticBean().getVMOption("FlightRecorder").getValue());
} catch (IllegalArgumentException e) {
hostEnabled = false;
}
HOSTED_ENABLED = hostEnabled;
}

@Override
public boolean isInConfiguration(IsInConfigurationAccess access) {
Expand Down

0 comments on commit 6038ea0

Please sign in to comment.