rmuller/infomas-asl

ArrayIndexOutOfBoundsException is thrown when trying to find annotated methods

Closed this issue · 2 comments

final AnnotationDetector.MethodReporter reporter = new AnnotationDetector.MethodReporter() {
@OverRide
public Class<? extends Annotation>[] annotations() {
return new Class[]{Test.class};
}

    @Override
    public void reportMethodAnnotation(Class<? extends Annotation> annotation,
                                       String className, String methodName) {
        System.out.println(className +" " + methodName); // do something
    }


};
final AnnotationDetector cf = new AnnotationDetector(reporter);
cf.detect();

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at eu.infomas.annotation.AnnotationDetector.resolveUtf8(AnnotationDetector.java:540)
at eu.infomas.annotation.AnnotationDetector.readThisClass(AnnotationDetector.java:399)
at eu.infomas.annotation.AnnotationDetector.detect(AnnotationDetector.java:328)
at eu.infomas.annotation.AnnotationDetector.detect(AnnotationDetector.java:310)
at eu.infomas.annotation.AnnotationDetector.detect(AnnotationDetector.java:240)
at org.sgtest.submitter.SubmitterImpl.main(SubmitterImpl.java:59)

Please can you specify:

  1. Which version of annotation-scanner do you use? From maven or build by yourself?
  2. What Java version is used?
  3. What jar files are scanned?
    I cannot reproduce the exception otherwise.

Ronald

Because we cannot reproduce this exception, this issue will be closed.
Please reopen it if you have more details information (best: a test case)