Community
Participate
Working Groups
reported by Ramnivas: java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelObjectType.hasAnnotation(BcelObjectType.java:558) at org.aspectj.weaver.ReferenceType.hasAnnotation(ReferenceType.java:161) at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.matches(ExactAnnotationTypePattern.java:101) at org.aspectj.weaver.patterns.ExactAnnotationTypePattern.matches(ExactAnnotationTypePattern.java:94) at org.aspectj.weaver.patterns.AnyWithAnnotationTypePattern.matchesExactly(TypePattern.java:513) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:129) at org.aspectj.weaver.patterns.DeclareAnnotation.matches(DeclareAnnotation.java:269) at org.aspectj.weaver.bcel.BcelWeaver.applyDeclareAtType(BcelWeaver.java:1590)
The problem here is that the weaver is being treated as re-entrant. On re-entering the weaver we attempt to access the list of annotations on a type which was in the process of being built before we re-entered. The NPE is due to an array which has yet to have all its elements initialized. In this case I will fix it by allowing for re-entrancy and performing the check in another way. This sub-optimal way will only be used whilst in a re-entrant state and once we 'unwind' it will go back to an optimal mechanism.
fix committed