AnnotationNode in ASM 5.0.3 does not handle null returned from AnnotationVisitor correctly.
AnnotationNode in ASM 5.0.3 does not handle null returned from
AnnotationVisitor correctly. While the documentation says that
AnnotationVisitor.visitArray(String) can return null , the
AnnotationNode.accept(AnnotationVisitor, String, Object) method calls
AnnotationVisitor.visitEnd() on a potentially null visitor in the part that
handles List values.
Suggested fix to AnnotationNode.accept(AnnotationVisitor, String, Object):
...
} else if (value instanceof List) {
AnnotationVisitor v = av.visitArray(name);
if (v != null) {
List array = (List) value;
for (int j = 0; j < array.size(); ++j) {
accept(v, null, array.get(j));
}
v.visitEnd();
}
} else {
...