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

Bugfix illegal reflective access operation #332

Conversation

V-F
Copy link
Contributor

@V-F V-F commented Jan 30, 2020

Since java 9 and module system the "--illegal-access" parameter was added. The default value for this parameter is "permit", but in a future release it will be "deny". Read more about it here or here.

This fix for the issue 331 added opens package "sun.font" in module "java.desktop" if this package is opend for the caller module (actually unnamed module). I assumed that when java opens some module for an unnamed module, this information is automatically added to this module, but it does not happen. This code adds this information manually, which avoids the "An illegal reflective access operation" warning.
In the future it is important not to forget to add the parameter "--add-opens" if iText will be a named module or "-illegal-access=deny" by default will be used (for named module - for unnamed modules it doesn't work).
Tested for Oracle JDK 8 & Oracle JDK 13.0.2.

P.S. Please check if there are some other ways to fix issue 331.

V-F and others added 4 commits January 30, 2020 08:21
Merge pull request #8 from LibrePDF/master
…corresponding module (java.desktop) that helps to avoid "illegal reflective access operation" warning.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@andreasrosdal andreasrosdal merged commit 4d18b3a into LibrePDF:master Jan 30, 2020
@V-F V-F deleted the bugfix_Illegal_reflective_access_to_method_sun.font.FontUtilities.getFont2D branch January 31, 2020 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Illegal reflective access warning at Java 13
2 participants