Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not warn if sun.reflect.Reflection.getCallerClass() is unavailable #1760

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,19 @@ public final class StackLocator {
} else {
o = getCallerClassMethod.invoke(null, 1);
if (o == sunReflectionClass) {
System.err.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) {
System.err.println("WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.");
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