Skip to content

Commit 9a5747a

Browse files
authored
Fix warning message (#2474)
1 parent 86cba45 commit 9a5747a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/ConfigurationBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,16 @@ private static void logWarningIfUsingInternalAttributes(String attributeKey) {
254254
}
255255

256256
private static void overlayProfilerEnvVars(Configuration config) {
257-
if (isOpenJ9Jvm()) {
258-
configurationLogger.warn(
259-
"Profiler is not supported for an OpenJ9 JVM. Instead, please use an OpenJDK JVM.");
260-
config.preview.profiler.enabled = false;
261-
}
262257
config.preview.profiler.enabled =
263258
Boolean.parseBoolean(
264259
overlayWithEnvVar(
265260
APPLICATIONINSIGHTS_PREVIEW_PROFILER_ENABLED,
266261
Boolean.toString(config.preview.profiler.enabled)));
262+
if (config.preview.profiler.enabled && isOpenJ9Jvm()) {
263+
configurationLogger.warn(
264+
"Profiler is not supported for an OpenJ9 JVM. Instead, please use an OpenJDK JVM.");
265+
config.preview.profiler.enabled = false;
266+
}
267267
}
268268

269269
private static boolean isOpenJ9Jvm() {

0 commit comments

Comments
 (0)