mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix issue with <clinit> methods introduced by previous commit
This commit is contained in:
parent
ed627459c8
commit
7a03ad6c5e
|
@ -47,9 +47,13 @@ public class Linker {
|
|||
MethodReference methodRef = method.getReference();
|
||||
MethodDependencyInfo methodDep = dependency.getMethod(methodRef);
|
||||
if (methodDep == null || !methodDep.isUsed()) {
|
||||
if (method.hasModifier(ElementModifier.STATIC)) {
|
||||
cls.removeMethod(method);
|
||||
} else {
|
||||
method.getModifiers().add(ElementModifier.ABSTRACT);
|
||||
method.getModifiers().remove(ElementModifier.NATIVE);
|
||||
method.setProgram(null);
|
||||
}
|
||||
} else if (method.getProgram() != null) {
|
||||
link(method.getReference(), method.getProgram());
|
||||
}
|
||||
|
|
|
@ -963,9 +963,13 @@ public class TeaVM implements TeaVMHost, ServiceRepository {
|
|||
for (MethodHolder method : cls.getMethods().toArray(new MethodHolder[0])) {
|
||||
MethodDependencyInfo methodDep = dependencyAnalyzer.getMethod(method.getReference());
|
||||
if (methodDep == null || !methodDep.isUsed()) {
|
||||
if (method.hasModifier(ElementModifier.STATIC)) {
|
||||
cls.removeMethod(method);
|
||||
} else {
|
||||
method.getModifiers().add(ElementModifier.ABSTRACT);
|
||||
method.getModifiers().remove(ElementModifier.NATIVE);
|
||||
method.setProgram(null);
|
||||
}
|
||||
} else {
|
||||
MethodReader methodReader = classReader.getMethod(method.getDescriptor());
|
||||
if (methodReader != null && methodReader.getProgram() != null) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user