From 3a4aef6f5c7eca9251f510d3f093772fb3523ce5 Mon Sep 17 00:00:00 2001 From: konsoletyper Date: Tue, 16 Sep 2014 07:56:16 +0400 Subject: [PATCH] Fix NPE in DependencyChecker --- .../org/teavm/dependency/DependencyChecker.java | 13 +++++++------ .../main/java/org/teavm/eclipse/TeaVMBuilder.java | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) 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 290ab1553..f4c32c4bb 100644 --- a/teavm-core/src/main/java/org/teavm/dependency/DependencyChecker.java +++ b/teavm-core/src/main/java/org/teavm/dependency/DependencyChecker.java @@ -210,12 +210,13 @@ public class DependencyChecker implements DependencyInfo, DependencyAgent { ClassDependency dependency = new ClassDependency(this, className, stack, cls); if (dependency.isMissing()) { missingClasses.add(dependency); - } - if (cls.getParent() != null) { - linkClass(cls.getParent(), stack); - } - for (String ifaceName : cls.getInterfaces()) { - linkClass(ifaceName, stack); + } else { + if (cls.getParent() != null) { + linkClass(cls.getParent(), stack); + } + for (String ifaceName : cls.getInterfaces()) { + linkClass(ifaceName, stack); + } } return dependency; } diff --git a/teavm-eclipse/teavm-eclipse-plugin/src/main/java/org/teavm/eclipse/TeaVMBuilder.java b/teavm-eclipse/teavm-eclipse-plugin/src/main/java/org/teavm/eclipse/TeaVMBuilder.java index 16d7f1f45..72ec42276 100644 --- a/teavm-eclipse/teavm-eclipse-plugin/src/main/java/org/teavm/eclipse/TeaVMBuilder.java +++ b/teavm-eclipse/teavm-eclipse-plugin/src/main/java/org/teavm/eclipse/TeaVMBuilder.java @@ -78,7 +78,7 @@ public class TeaVMBuilder extends IncrementalProjectBuilder { while (stack != DependencyStack.ROOT) { wasPut |= putMarker(sb.toString(), stack.getLocation(), stack.getMethod()); if (stack.getMethod() != null) { - sb.append(", called by ").append(getFullMethodName(stack.getMethod())); + sb.append(", used by ").append(getFullMethodName(stack.getMethod())); } stack = stack.getCause(); }