Fix NPE in DependencyChecker

This commit is contained in:
konsoletyper 2014-09-16 07:56:16 +04:00
parent 107b7463c6
commit 3a4aef6f5c
2 changed files with 8 additions and 7 deletions

View File

@ -210,12 +210,13 @@ public class DependencyChecker implements DependencyInfo, DependencyAgent {
ClassDependency dependency = new ClassDependency(this, className, stack, cls); ClassDependency dependency = new ClassDependency(this, className, stack, cls);
if (dependency.isMissing()) { if (dependency.isMissing()) {
missingClasses.add(dependency); missingClasses.add(dependency);
} } else {
if (cls.getParent() != null) { if (cls.getParent() != null) {
linkClass(cls.getParent(), stack); linkClass(cls.getParent(), stack);
} }
for (String ifaceName : cls.getInterfaces()) { for (String ifaceName : cls.getInterfaces()) {
linkClass(ifaceName, stack); linkClass(ifaceName, stack);
}
} }
return dependency; return dependency;
} }

View File

@ -78,7 +78,7 @@ public class TeaVMBuilder extends IncrementalProjectBuilder {
while (stack != DependencyStack.ROOT) { while (stack != DependencyStack.ROOT) {
wasPut |= putMarker(sb.toString(), stack.getLocation(), stack.getMethod()); wasPut |= putMarker(sb.toString(), stack.getLocation(), stack.getMethod());
if (stack.getMethod() != null) { if (stack.getMethod() != null) {
sb.append(", called by ").append(getFullMethodName(stack.getMethod())); sb.append(", used by ").append(getFullMethodName(stack.getMethod()));
} }
stack = stack.getCause(); stack = stack.getCause();
} }