If val errors out, now at least you see where it happened.

This commit is contained in:
Reinier Zwitserloot committed 2012-09-17 17:19:05 +02:00
1 parent 9bc421ecdc
commit 7ada401b6d
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -7,6 +7,6 @@
<ibiblio name="maven-repo2" m2compatible="true" root="http://repo2.maven.org/maven2" />
</chain>
</resolvers>
<settings defaultResolver="projectRepos" />
<settings defaultResolver="projectRepos" validate="false" />
<caches defaultCacheDir="${ivy.basedir}/ivyCache" />
</ivysettings>
@@ -95,7 +95,12 @@ public class HandleVal extends JavacASTAdapter {
if (rhsOfEnhancedForLoop == null) {
if (local.init.type == null) {
JavacResolution resolver = new JavacResolution(localNode.getContext());
type = ((JCExpression) resolver.resolveMethodMember(localNode).get(local.init)).type;
try {
type = ((JCExpression) resolver.resolveMethodMember(localNode).get(local.init)).type;
} catch (RuntimeException e) {
System.err.println("Exception while resolving: " + localNode);
throw e;
}
} else {
type = local.init.type;
}