More easily detect overridden methods & calls to super
Fixes #982
Currently added a JavaMethod#isOverridden method for now.
I couldn't figure out a direct way to get the inherited methods of the super class I tried to use .getMethods() but that only returns the public methods.
If we have something like a class extending a class which also extends another class, and the lowest class has a method that the highest class has, but the middle class does not, then .isOverridden() returns false.
I don't know whether our API or the reflection API has an easy way to fix this or not
So far I think I know what we can do to fix the issue.
We need to get the supperclasses and interfaces of the method's class but they cannot be the raw ones as they don't have type arguments.
So looks like we can keep on calling a .supperclass() again and again unti we reach java.lang.Object as well as use .interfaces
However this solves the current problem at hand, it may not be bug-free.
Also ignore JavaMethodTest.java that is just me playing around with the objects while debugging.
@java-coding-prodigy are you still working on this? Do you need any support?
@java-coding-prodigy are you still working on this? Do you need any support?
I was working on it some time ago and I could continue now. However I had run into some issues earlier. I'll see what I can do.
Fixed the generic issue, however code is too ugly and slow, we should try to enhance it. I have only done this for classes, but I presume it would be similar for interfaces too.
I'm thinking of adding a JavaMethod#overridenFrom(JavaType and make isOverriden call that method. What do you think @hankem ?