Jandex 3.3.0

Today, we announce the release of Jandex 3.3.0. This release contains two improvements.

The ClassInfo.enclosingClassAlways() method was added. Contrary to enclosingClass(), which only returns the enclosing class for member classes, this method returns the enclosing class in case of all classes: member, local and anonymous, regardless of their declaration site. Notably, in case of local and anonymous classes, they can also occur in static initializers, instance initializers and field initializers. In this case, it wasn’t possible to determine the enclosing class before.

The IndexView.getKnownDirectImplementations() and getAllKnownImplementations() methods were added. The getKnownDirectImplementations() differs from the existing getKnownDirectImplementors() method in that it doesn’t return direct subinterfaces, which is most likely what users expect. The getAllKnownImplementations() is not different to getAllKnownImplementors() at all, it exists just for symmetry. Also, the getKnownDirectImplementors() and getAllKnownImplementors() methods are now deprecated. Use the get*Implementations() methods instead; pay attention to the difference mentioned above, but it shouldn’t affect most of the code out there.

BREAKING CHANGE: This Jandex release increments the persistent format version. This means that indices generated by Jandex 3.3.0 are not readable by previous Jandex versions. Since the only change in the persistent index is the addition of enclosing class information for the initializer case, it is recommended to stay on the previous format version for most users for a while.

If you experience any troubles, or if you have any ideas for Jandex improvements, please file an issue.