diff --git a/teavm-core/src/main/java/org/teavm/dependency/DependencyChecker.java b/teavm-core/src/main/java/org/teavm/dependency/DependencyChecker.java index 9b2fe7ddd..955b3e4e6 100644 --- a/teavm-core/src/main/java/org/teavm/dependency/DependencyChecker.java +++ b/teavm-core/src/main/java/org/teavm/dependency/DependencyChecker.java @@ -225,7 +225,7 @@ public class DependencyChecker implements DependencyInfo, DependencyAgent { if (dependency.isMissing()) { missingClasses.add(dependency); } else { - if (cls.getParent() != null) { + if (cls.getParent() != null && !cls.getParent().equals(className)) { linkClass(cls.getParent(), stack); } for (String ifaceName : cls.getInterfaces()) { @@ -267,7 +267,7 @@ public class DependencyChecker implements DependencyInfo, DependencyAgent { if (reader != null) { return reader; } - if (cls.getParent() != null) { + if (cls.getParent() != null && cls.getParent().equals(cls.getParent())) { reader = methodReaderCache.map(new MethodReference(cls.getParent(), desc)); if (reader != null) { return reader; @@ -294,6 +294,9 @@ public class DependencyChecker implements DependencyInfo, DependencyAgent { if (field != null) { return field; } + if (clsName.equals(cls.getParent())) { + break; + } clsName = cls.getParent(); } return null; diff --git a/teavm-core/src/main/java/org/teavm/parsing/Parser.java b/teavm-core/src/main/java/org/teavm/parsing/Parser.java index f5b9c109a..5baa8abaf 100644 --- a/teavm-core/src/main/java/org/teavm/parsing/Parser.java +++ b/teavm-core/src/main/java/org/teavm/parsing/Parser.java @@ -55,6 +55,9 @@ public final class Parser { if (node.superName != null) { cls.setParent(node.superName.replace('/', '.')); } + if (cls.getName().equals("java.lang.Object")) { + cls.setParent(null); + } if (node.interfaces != null) { for (Object obj : node.interfaces) { cls.getInterfaces().add(((String)obj).replace('/', '.'));