mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
When finding overriden methods, exclude constructors, final and static
methods
This commit is contained in:
parent
5221815904
commit
f69e3310a3
|
@ -176,13 +176,18 @@ public class AsyncMethodFinder {
|
||||||
if (!visited.add(methodRef)) {
|
if (!visited.add(methodRef)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (methodRef.getName().equals("<init>") || methodRef.getName().equals("<clinit>")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ClassReader cls = classSource.get(methodRef.getClassName());
|
ClassReader cls = classSource.get(methodRef.getClassName());
|
||||||
if (cls == null) {
|
if (cls == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MethodReader method = cls.getMethod(methodRef.getDescriptor());
|
MethodReader method = cls.getMethod(methodRef.getDescriptor());
|
||||||
if (method != null) {
|
if (method != null) {
|
||||||
|
if (!method.hasModifier(ElementModifier.STATIC) && !method.hasModifier(ElementModifier.FINAL)) {
|
||||||
result.add(methodRef);
|
result.add(methodRef);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cls.getParent() != null && !cls.getParent().equals(cls.getName())) {
|
if (cls.getParent() != null && !cls.getParent().equals(cls.getName())) {
|
||||||
findOverridenMethods(new MethodReference(cls.getParent(), methodRef.getDescriptor()), result, visited);
|
findOverridenMethods(new MethodReference(cls.getParent(), methodRef.getDescriptor()), result, visited);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user