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

Use correct parent classloader to fix Java 9 style modules. #168

Merged
merged 7 commits into from
Dec 26, 2020

Conversation

robinverduijn
Copy link
Contributor

Use correct parent classloader to fix Java 9 style modules.

This fixes the issue at #87. It also includes fixes for #117.

This fixes the following error:

```
Caused by: java.lang.IllegalArgumentException: Missing scheme
    at java.nio.file.Path.of (Path.java:199)
    at java.nio.file.Paths.get (Paths.java:97)
    at org.sonar.api.batch.fs.internal.URIPredicate.get (URIPredicate.java:52)
    at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFiles (DefaultFileSystem.java:149)
    at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFile (DefaultFileSystem.java:115)
    at org.sonar.plugins.pmd.PmdViolationRecorder.findResourceFor (PmdViolationRecorder.java:76)
    at org.sonar.plugins.pmd.PmdViolationRecorder.saveViolation (PmdViolationRecorder.java:47)
    at org.sonar.plugins.pmd.PmdSensor.execute (PmdSensor.java:72)
```
By using the 1-arg constructor for URLClassLoader, the parent classloader will pick up the JRE modules automatically under Java 9 and higher.
@jensgerdes jensgerdes merged commit 3b1f576 into jborgers:master Dec 26, 2020
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.

2 participants