Skip to content

Commit

Permalink
Differentiate warning by Java version
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Sep 6, 2023
1 parent 74f3316 commit c9ef469
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,19 @@ public final class StackLocator {
} else {
o = getCallerClassMethod.invoke(null, 1);
if (o == sunReflectionClass) {
System.out.println("WARNING: Unexpected result from sun.reflect.Reflection.getCallerClass(int), adjusting offset for future calls.");
LowLevelLogUtil.log(
"WARNING: Unexpected result from sun.reflect.Reflection.getCallerClass(int), adjusting offset for future calls.");
java7u25CompensationOffset = 1;
}
}
} catch (final Exception | LinkageError e) {
if (Constants.JAVA_MAJOR_VERSION > 8) {
LowLevelLogUtil.log(
"WARNING: Runtime environment does not support multi-release JARs. This will impact location-based features.");
} else {
LowLevelLogUtil.log(
"WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact location-based features.");
}
getCallerClassMethod = null;
java7u25CompensationOffset = -1;
}
Expand Down

0 comments on commit c9ef469

Please sign in to comment.