reflections
reflections copied to clipboard
Subtype not found if super is in a jar (Reflections 0.10)
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.
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
should be fixed with 0.10.2, @laszlo-torok also @carlyhill6895 more feedback from scala land is appreciated.
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.
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));