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

Fix bug where Scalafix cli crashed on JDK 11 #1080

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

dos65
Copy link
Contributor

@dos65 dos65 commented Mar 19, 2020

Fix for #985

Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this contribution!

@@ -29,15 +29,16 @@ object ClasspathOps {
}

def thisClassLoader: URLClassLoader =
this.getClass.getClassLoader.asInstanceOf[URLClassLoader]
new URLClassLoader(Array.empty, this.getClass().getClassLoader)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can pass this.getClass.getClassLoader to getURLs from the method here https://github.com/scalameta/metals/blob/2eb7a239a2e4e379c794ae2d66c6977ac9014bda/mtags/src/main/scala/scala/meta/internal/mtags/ClasspathLoader.scala#L14-L52

That should preserve the behavior on JDK 8 and 9+

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed

@olafurpg olafurpg merged commit ac9d4fd into scalacenter:master Mar 19, 2020
@olafurpg olafurpg changed the title scalafix_cli - jdk11 Make Scalafix command-line use correct classloader on JDK 11 Mar 19, 2020
@olafurpg olafurpg changed the title Make Scalafix command-line use correct classloader on JDK 11 Fix bug where Scalafix cli crashed on JDK 11 Mar 19, 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