Bugfix illegal reflective access operation #332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.