so, I had some kind of event handler in java which...
# announcements
t
so, I had some kind of event handler in java which worked, but now since I converted to kotlin it doesn't anymore. I am checking if (java) event Class isInstance with the method I have, and it returns true, but then if I try to method.invoke(method), it throwns an exception about "object is not an instance of declaring class". what can I do ?
a
are you checking against some Class object at runtime? if the class is known statically, you do
event is TheClass
, otherwise something like
clazz.isAssignableFrom(event.javaClass)
. Hard to suggest things without more detail.