javac ast indices: handle invalid code case

This commit is contained in:
Dmitry Batkovich
2017-07-18 18:35:22 +03:00
parent c0c06f899f
commit e092f76f76
@@ -197,7 +197,7 @@ public interface JavacRef {
private static boolean checkEnclosingElement(Element element) {
Element enclosingElement = element.getEnclosingElement();
if (enclosingElement == null) return false;
TypeMirror type = element.asType();
TypeMirror type = enclosingElement.asType();
if (type == null || type.getKind() == TypeKind.NONE || type.getKind() == TypeKind.OTHER) {
return false;
}