-
Notifications
You must be signed in to change notification settings - Fork 55
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
GG-36475 Fix the illegal reflective access warnings issue #3070
base: master
Are you sure you want to change the base?
Changes from 5 commits
2543845
b7386ce
3311898
6f3416b
51bb31e
0f58a07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,3 +103,9 @@ getJavaSpecificOpts() { | |
|
||
echo $value | ||
} | ||
# Reflective access options | ||
addReflectiveAccessOptions() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the exact list of options should be based on the JVM version. For example, using these opts with JVM8 leads to
Perhaps, I am missing something. It would be nice to check the script works as expected using Java 8, 11, and 17 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for highlighting the compatibility issues with Java 8. I realize now that my updates to the jvmdefaults.sh script included Java 9+ specific options without checks for Java version compatibility. I will revise the script to dynamically adjust the JVM options based on the version it detects. Yes as recommended I will also conduct testing across these Java versions to confirm that the script functions correctly in each environment. Once you've confirmed my approach regarding the initial comment of the PR, I will make all necessary changes and conduct all tests at once. |
||
CONTROL_JVM_OPTS+= "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --illegal-access=warn"; } | ||
|
||
# Export the function | ||
export -f addReflectiveAccessOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused about this change. IMHO, we need to add additional JVM options to the
CONTROL_JVM_OPTS
variable. Something like as follows:where
getJavaSpecificOptsForControlScript
should determine the required options based on the JVM version like thegetJavaSpecificOpts
does.By the way, this fix should be applied to the
control.bat
script as well. Perhaps, it makes sense to updatesnapshot-utility
scripts in the same way. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated
control.sh
to usegetJavaSpecificOpts
for handling Java version-specific options. Based on your suggestion, are there additional requirements or different needs forcontrol.sh
that require a separate function? IfgetJavaSpecificOpts
isn't suitable for this script, I agree that creating a new function,getJavaSpecificOptsForControlScript
, could ensure we handle all specific settings effectively. I'll proceed with this approach if it matches your observations. And yes the changes we make tocontrol.sh
should also be applied tocontrol.bat
and potentially thesnapshot-utility
scripts to ensure uniform behavior across our toolset.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I got your point right, you propose updating
getJavaSpecificOpts
instead of introducing a specific method forcontrol.sh
. Well, the idea looks good at first glance.