reflections icon indicating copy to clipboard operation
reflections copied to clipboard

Subtype not found if super is in a jar (Reflections 0.10)

Open laszlo-torok opened this issue 3 years ago • 4 comments

I have a class hierarchy like so: (=> means "is a subclass of") C => B => A

B is in a jar on the classpath and classloader is passed to the Relections constructor:

Reflections reflections = new Reflections(new ConfigurationBuilder()
                                                .forPackage(packageName, classLoader)
                                                .setScanners(Scanners.SubTypes));

When calling getSubTypesOf(A) C is not returned. In the store C is listed under B class only. It is worked in 0.9.12.

laszlo-torok avatar Oct 15 '21 08:10 laszlo-torok

I have the same issue, with 0.10.1 I only get direct subclasses returned. I've also tried using it like this (scala): reflections.get(SubTypes.of(classOf[ClassName]).asClass()) Worked in 0.9.12

carlyhill6895 avatar Oct 15 '21 14:10 carlyhill6895

should be fixed with 0.10.2, @laszlo-torok also @carlyhill6895 more feedback from scala land is appreciated.

ronmamo avatar Oct 25 '21 14:10 ronmamo

should be fixed with 0.10.2, @laszlo-torok also @carlyhill6895 more feedback from scala land is appreciated.

I didn't find the update notes in version 0.10.2 and wanted to make sure whether this issue has been fixed.

devfat avatar May 28 '24 06:05 devfat

Yes, this is working in 0.10.2 Here is the java code: Reflections reflections = new Reflections(new ConfigurationBuilder() .forPackage(packageName, classLoader) .filterInputsBy(new FilterBuilder().includePackage(packageName)) .setExpandSuperTypes(true) .setScanners(Scanners.SubTypes));

laszlo-torok avatar May 28 '24 07:05 laszlo-torok