-
-
Notifications
You must be signed in to change notification settings - Fork 280
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 QuarkusClassLoaderHandler on Quarkus 2.7. #642
Conversation
In Quarkus 2.7, the class loader stopped returning `JarClassPathElement` or `DirectoryClassPathElement` entries. Instead, some implementation of `ClassPathElement` is returned. This change tries to access it's `getRoot` method, returning a `java.nio.file.Path` pointing to the root of the element, as supported with class graph. The behaviour has been verified on Quarkus 2.6 and Quarkus 2.7.
Do you need anything more / help from me? |
} else { | ||
Object rootPath = ReflectionUtils.invokeMethod(false, element, "getRoot"); | ||
if (rootPath instanceof Path) { | ||
classpathOrder.addClasspathEntry(ReflectionUtils.invokeMethod(false, element, "getRoot"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this, but why did you invoke this method twice? Why not just use the value of rootPath
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops. That was an oversight. You fixed this, didn't you? Thank you for that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did, no problem!
No, sorry, I have just been traveling for the last 3 weeks, with very limited time... Merging this now -- thank you for the contribution! |
@michael-simons I had a bunch of other bugfixes I wanted to get in before the next release, but since I'm finding very little time while traveling, and since this seems like an urgent bug for your team, I will push a release out now. Should be fixed in 4.8.139. Thanks for the patch! |
In Quarkus 2.7, the class loader stopped returning
JarClassPathElement
or
DirectoryClassPathElement
entries. Instead, some implementation ofClassPathElement
is returned. This change tries to access it'sgetRoot
method, returning ajava.nio.file.Path
pointing to the rootof the element, as supported with class graph.
The behaviour has been verified on Quarkus 2.6 and Quarkus 2.7.
This is a fix for #641, thanks @lukehutch in advance for considering this input. It would help Neo4j a lot.