-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[ant] Reflective access warnings on java > 9 and java < 17 #1860
Milestone
Comments
I believe this is no longer an issue, right? |
This warning is actually still printed out for Java11. With Java17 (and later), we already use the public API to determine the console encoding, but for older java version, we use reflection. Java 8 doesn't report this, but Java 11 reports this illegal reflective access operation by default. |
adangel
changed the title
[core] Reflective access warnings on java > 9
[core] Reflective access warnings on java > 9 and java < 17
Oct 25, 2024
adangel
added a commit
to adangel/pmd
that referenced
this issue
Oct 25, 2024
- for java 17+, there is public API to get the console encoding -> no problem - for older java versions, try to use system property sun.jnu.encoding if it exists - only then use the fall-backs with illegal reflective access to private fields/methods on java.io.Console - Also avoid using reflection utils from apache commons, instead use reflection directly. The illegal access warnings are then properly reported against our class net.sourceforge.pmd.ant.Formatter. Fixes pmd#1860
4 tasks
adangel
changed the title
[core] Reflective access warnings on java > 9 and java < 17
[ant Reflective access warnings on java > 9 and java < 17
Oct 27, 2024
adangel
changed the title
[ant Reflective access warnings on java > 9 and java < 17
[ant] Reflective access warnings on java > 9 and java < 17
Oct 27, 2024
adangel
added a commit
that referenced
this issue
Oct 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From #584 :
Here's the relevant code:
pmd/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java
Lines 197 to 229 in 89bb73f
Maybe there's a better way to fetch that?
The text was updated successfully, but these errors were encountered: