fix: upgrade jandex to 3.2.3 to handle modern class files - #2661
Merged
Merged
Conversation
Jars built with recent JDKs (e.g. Java 25 class files) crashed main class detection with ArrayIndexOutOfBoundsException because bundled jandex 2.2.3.Final (2021) cannot parse them. - switch org.jboss:jandex:2.2.3.Final to io.smallrye:jandex:3.2.3 (same org.jboss.jandex package, runs on Java 8) - skip module-info.class and catch per-entry exceptions during jar scanning so one unparseable class cannot break main detection Fixes running e.g. com.netflix:com.netflix.tools.jfmt:0.8.2
Contributor
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jandex 3 reflectively instantiates AnnotationInstance[] and ClassInfo[] arrays (Utils.unfold), which fails under --exact-reachability-metadata with MissingReflectionRegistrationError, breaking all native ITs that build or scan jars.
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.
What
Running a jar built with a recent JDK, e.g.
jbang com.netflix:com.netflix.tools.jfmt:0.8.2, crashed with:Why
The jar has no
Main-Classmanifest, so jbang scans its classes with jandex to findmain()methods. The bundledorg.jboss:jandex:2.2.3.Final(2021) cannot parse Java 25 class files (major 69) and throws. OnlyIOExceptionwas caught, so the crash surfaced as the cryptic error above.Fix
org.jboss:jandex:2.2.3.Final→io.smallrye:jandex:3.2.3(sameorg.jboss.jandexpackage, targets Java 8 bytecode so no compatibility impact; no code changes needed)JarCmdGenerator: skipmodule-info.classand catch per-entry exceptions so one unparseable class cannot break main class detection (details logged with--verbose)Verified
jbang com.netflix:com.netflix.tools.jfmt:0.8.2now runs.