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

[core] WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass #4674

Closed
wener-tiobe opened this issue Sep 12, 2023 · 2 comments · Fixed by #4726
Closed
Labels
a:bug PMD crashes or fails to analyse a file. has:pr The issue is already tackled in a PR
Milestone

Comments

@wener-tiobe
Copy link
Contributor

Affects PMD Version:

Tested on https://github.com/pmd/pmd/releases/download/pmd_releases%2F7.0.0-rc3/pmd-dist-7.0.0-rc3-bin.zip

Description:
When running CPD, I get a warning as depicted below.

Sample demonstrating the issue:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/D:/tmp/test-pmd/pmd-bin-7.0.0-rc3/lib/groovy-2.4.21.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[main] INFO net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand - Log level is at TRACE
[main] DEBUG net.sourceforge.pmd.cpd.CPD - Searching directory . for files
[main] DEBUG net.sourceforge.pmd.cpd.CPD - Tokenizing D:\10_Projects\Python\exp\.\__init__.py
[main] DEBUG net.sourceforge.pmd.cpd.CPD - Tokenizing D:\10_Projects\Python\exp\.\missing_comma.py
[main] DEBUG net.sourceforge.pmd.cpd.CPD - Running match algorithm on 2 files...
[main] DEBUG net.sourceforge.pmd.cpd.CPD - Finished: 0 duplicates found

Steps to reproduce:

  1. Download PMD 7.0.0. RC
  2. Invoke: d:\tmp\test-pmd\pmd-bin-7.0.0-rc3\bin\pmd.bat cpd --minimum-tokens=100 --language python --debug --dir .

Running PMD through: [CLI]

I use the following Java version:

java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)
@wener-tiobe wener-tiobe added the a:bug PMD crashes or fails to analyse a file. label Sep 12, 2023
@Scrates1
Copy link

Scrates1 commented Sep 13, 2023

I also meet this issue when using CPD GUI, and the GUI can't be open:

Affects PMD Version:

7.0.0-rc3

Description:
When running CPD GUI, I get a warning as depicted below.

Sample demonstrating the issue:

...\pmd-bin-7.0.0-rc3\bin> ./pmd.bat cpd-gui
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/.../pmd-bin-7.0.0-rc3/lib/groovy-2.4.21.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I use the following Java version:
corretto-11.0.18

and I use WINDOWS11

@jorgesolebur
Copy link

jorgesolebur commented Oct 5, 2023

Hello ! Same warning in 7.0.0.-rc4
CleanShot 2023-10-06 at 00 12 53@2x

jsotuyod added a commit to Monits/pmd that referenced this issue Oct 21, 2023
 - We now support parsing all Groovy features from Groovy 3 and 4
 - Support for 5 is not included as it would not work with Java 8
 - Along the way, this also fixes pmd#4674
@jsotuyod jsotuyod added the has:pr The issue is already tackled in a PR label Oct 21, 2023
@adangel adangel added this to the 7.0.0 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file. has:pr The issue is already tackled in a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants