Let's say I have a sealed class A with B and C inheriting it.
sealed class A
open class B(): A()
open class C(): A()
Now, I have few classes in separate files in say classpath: com.dummy
with inherits class B or C
class D : B(){}
class E : C(){}
class F : B(){}
Now, I want to scan all classes given the classpath and superclass type of the B or C, which is A.
Snippet that I am trying to achieve it but not working
val ref = Reflections("com.dummy", SubTypesScanner(false))
val clazzes = ref.getSubTypesOf(A::class.java)
This is returning 0 classes. If I change getSubTypesOf(B::class.java), then I am able to get all classes which inherited B.