Skip to content

Commit 6424631

Browse files
committed
fix
1 parent b90e9c1 commit 6424631

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

smoke-tests-otel-starter/spring-boot-3/src/test/java/io/opentelemetry/spring/smoketest/OtelSpringStarterSmokeTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class OtelSpringStarterSmokeTest extends AbstractOtelSpringStarterSmokeTest {
2626

2727
@Override
2828
protected void assertAdditionalMetrics() {
29-
if (!isJfrAvailable()) {
29+
if (!isFlightRecorderAvailable()) {
3030
return;
3131
}
3232

@@ -50,11 +50,11 @@ protected void assertAdditionalMetrics() {
5050
}
5151
}
5252

53-
private static boolean isJfrAvailable() {
53+
private static boolean isFlightRecorderAvailable() {
5454
try {
55-
Class.forName("jdk.jfr.FlightRecorder");
56-
return true;
57-
} catch (ClassNotFoundException exception) {
55+
return (boolean)
56+
Class.forName("jdk.jfr.FlightRecorder").getMethod("isAvailable").invoke(null);
57+
} catch (ReflectiveOperationException exception) {
5858
return false;
5959
}
6060
}

0 commit comments

Comments
 (0)