Weird class cast behavior
So I have this code:
May look a bit messy but essentially the class hierarchy of
Searcher extends SearcherBase extends Pointer. However, even though Searcher extends Pointer, when the line
runs, it gives me this:
there are two
I tried to replicate this error with this:
But this code ,which should be pretty much equivalent, doesn't throw that exception.
May look a bit messy but essentially the class hierarchy of
Searcher is Searcher extends SearcherBase extends Pointer. However, even though Searcher extends Pointer, when the line
runs, it gives me this:
Exception in thread "main" java.lang.ClassCastException: class org.bytedeco.javacpp.Pointer cannot be cast to class com.niki.nativeplayer.Bridge.Searcher (org.bytedeco.javacpp.Pointer and com.niki.nativeplayer.Bridge.Searcher are in unnamed module of loader 'app')there are two
Searcher.alloc() functions, one is a setter and one is a getter. I think that part is self explanatory. I tried to replicate this error with this:
But this code ,which should be pretty much equivalent, doesn't throw that exception.