getResource() should never be called with a starting slash when called on a classloader#6553
Closed
ahus1 wants to merge 1 commit intojruby:masterfrom
ahus1:classloader-starting-with-slash
Closed
getResource() should never be called with a starting slash when called on a classloader#6553ahus1 wants to merge 1 commit intojruby:masterfrom ahus1:classloader-starting-with-slash
ahus1 wants to merge 1 commit intojruby:masterfrom
ahus1:classloader-starting-with-slash
Conversation
…d on a classloader. Calling it with a slash might or might not work depending on the classloader. A starting slash is only used when calling getResource() on a class.
Member
|
This is a simple fix. I will cherry-pick it to the 9.2 branch and merge that to master so it is in 9.2.15.0 or 9.3, whichever comes next (hopefully within the next month). |
Member
|
Cherry-picked to jruby-9.2 in 0013ec5 and will be merged to master shortly. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Calling it with a slash might or might not work depending on the classloader.
A starting slash is only used when calling getResource() on a class.
JRuby using a "/" at the beginning cased an exception when running this inside the plugin class loader of IntelliJ (asciidoctor/asciidoctor-intellij-plugin#664).
I'd be happy if this could be included in an upcoming patch release, so I can remove a workaround in the IntelliJ AsciiDoc plugin.
See https://stackoverflow.com/questions/47900677/where-does-leading-slash-in-java-class-loader-getresource-leads-to for more information on slashes and classloaders.