Simple code below results in NullPointerException
static class typekindVisitor extends TypeKindVisitor6<Boolean, Void> {
public Boolean defaultAction(TypeMirror tm, Void v) {
List<? extends Element> le = tm.asElement().getEnclosedElements(); //<<--NPE
for(Element e : le ) e.asType().accept(new typekindVisitor(), null);
tm.accept( new typekindVisitor(), null);
return true;
}
}
static class typekindVisitor extends TypeKindVisitor6<Boolean, Void> {
public Boolean defaultAction(TypeMirror tm, Void v) {
List<? extends Element> le = tm.asElement().getEnclosedElements(); //<<--NPE
for(Element e : le ) e.asType().accept(new typekindVisitor(), null);
tm.accept( new typekindVisitor(), null);
return true;
}
}
- relates to
-
JDK-6375016 Elements.getTypeElement() sometimes returns null.
-
- Resolved
-
-
JDK-6389414 ExecutableType.asElement should return null
-
- Resolved
-
-
JDK-6374357 PackageElement.getEnclosedElements() throws ClassReader$BadClassFileException
-
- Closed
-