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);
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;
}

View File

@ -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();
}