#org.reflections problem
1 messages · Page 1 of 1 (latest)
<@&1008423204219531294> please have a look, thanks.
why this didnt work ?
this really isnt a good description of your problem
what exactly doesnt work?
any error message?
best to put some effort into asking a question
then it is easier for others to help
it printed []
then apparently such a class didnt exist in ur build path
i have 4 kotlin classes in generated package
does it work if u put a different class and package in there?
for example for sth that is in the sdk
...
you didnt give me any hint or something to do
does it work if u put a different class and package in there?
for example for sth that is in the sdk
please do that
ok
also, where is that Reflections from? kotlin-reflect?
when u wrote Obect.class i guess u did a typo and meant Object.class?
(it shouldnt compile then though)
so it looks like u didnt share ur real code with us
i tried ity with Object.clas and it didnt work
the code i currently have is
val reflections = Reflections("com.nebuliks.backend.models.generated")
val classes = reflections.getSubTypesOf(Any::class.java)
println(classes)
Detected code, here are some useful tools:
val reflections = Reflections("com.nebuliks.backend.models.generated") val classes = reflections.getSubTypesOf(Any::class .java) println(classes)
okay
also : the sdk worked and loaded the class correctly
can u share the example with the sdk code please
and Reflection is from org.reflections package
@Test
fun loadGeneratedClass() {
val fqcn = "com.nebuliks.backend.models.generated.Actors"
val clazz = Class.forName(fqcn) // Java reflection
print(clazz) // convert to Kotlin KClass
}
ah, thats not what i meant actually
i meant to try it out looking for classes in a sdk package
for example look for java.util
instead of ur custom package
cause if that doesnt work either then the problem is not ur custom code but the way u use that org-reflections code
potentially ur just misundestanding the org.reflections api then
it seems like it works with any subtype,
but it doesnt work with Object or Any