~ArrayIndexOutOfBoundsException occurred. Annotation on method level was applied.
Pokus.java snipped:
ClassReader classReader = new ClassReader(forClass);
ClassNode classNode = new ClassNode();
classReader.accept(classNode, true); <--- line 23.
------------------------------------------------------
"forClass" java code snipped:
...
@TestA
@TestB
public String testNotNull(final @NotNull String arg) {
...
-------------------------------------------------------
Exception:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 29
at org.objectweb.asm.Type.getArgumentTypes(Type.java:289)
at org.objectweb.asm.tree.MethodNode.visitParameterAnnotation(MethodNode.java:218)
at org.objectweb.asm.ClassReader.readParameterAnnotations(ClassReader.java:960)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:550)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:229)
at Pokus.findAnnotations(Pokus.java:23)
at Pokus.main(Pokus.java:53)
-------------------------------------------------------
of course not optimal fix:
public AnnotationVisitor visitParameterAnnotation (
final int parameter,
final String desc,
final boolean visible)
{
AnnotationNode an = new AnnotationNode(desc);
if (visible) {
if (visibleParameterAnnotations == null) {
old>>>>>
int params = Type.getArgumentTypes(desc).length;
new>>>>>
int params = Type.getArgumentTypes("(" + desc + ")").length;
Same problem exists for invisibleParameterAnnotations ...
Latest build from CVS was used.