Buggy code:
private long detectStandardAnnotation ( Scope scope , ReferenceBinding annotationType , MemberValuePair valueAttribute ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public abstract MemberValuePair [ ] memberValuePairs ( ) { } public TypeBinding resolveType ( BlockScope scope ) { this . constant = NotAConstant ; TypeBinding typeBinding = this . type . resolveType ( scope ) ; if ( typeBinding == null ) return null ; this . resolvedType = typeBinding ; if ( ! ( typeBinding . isAnnotationType ( ) ) ) { scope . problemReporter ( ) . typeMismatchError ( typeBinding , scope . getJavaLangAnnotationAnnotation ( ) , this . type ) ; return null ; } ReferenceBinding annotationType = ( ( ReferenceBinding ) ( this . resolvedType ) ) ; MethodBinding [ ] methods = annotationType . methods ( ) ; MemberValuePair [ ] valuePairs = memberValuePairs ( ) ; MemberValuePair valueAttribute = null ; MemberValuePair [ ] usedValuePairs ; int pairsLength = valuePairs . length ; System . arraycopy ( valuePairs , 0 , ( usedValuePairs = new MemberValuePair [ pairsLength ] ) , 0 , pairsLength ) ; nextMember : for ( int i = 0 , requiredLength = methods . length ; i < requiredLength ; i ++ ) { MethodBinding method = methods [ i ] ; char [ ] selector = method . selector ; boolean foundValue = false ; nextPair : for ( int j = 0 ; j < pairsLength ; j ++ ) { MemberValuePair valuePair = usedValuePairs [ j ] ; if ( valuePair == null ) continue nextPair ; char [ ] memberName = valuePair . name ; if ( CharOperation . equals ( memberName , selector ) ) { if ( ( valueAttribute == null ) && ( CharOperation . equals ( memberName , TypeConstants . VALUE ) ) ) { valueAttribute = valuePair ; } valuePair . binding = method ; usedValuePairs [ j ] = null ; foundValue = true ; boolean foundDuplicate = false ; for ( int k = j + 1 ; k < pairsLength ; k ++ ) { if ( CharOperation . equals ( usedValuePairs [ k ] . name , selector ) ) { foundDuplicate = true ; scope . problemReporter ( ) . duplicateAnnotationValue ( annotationType , usedValuePairs [ k ] ) ; usedValuePairs [ k ] . binding = method ; usedValuePairs [ k ] = null ; } } if ( foundDuplicate ) { scope . problemReporter ( ) . duplicateAnnotationValue ( annotationType , valuePair ) ; continue nextMember ; } valuePair . resolveTypeExpecting ( scope , method . returnType ) ; } } if ( ( ! foundValue ) && ( ( ( method . modifiers ) & ( AccAnnotationDefault ) ) == 0 ) ) { scope . problemReporter ( ) . missingValueForAnnotationMember ( this , method . selector ) ; } } for ( int i = 0 ; i < pairsLength ; i ++ ) { if ( ( usedValuePairs [ i ] ) != null ) { scope . problemReporter ( ) . undefinedAnnotationValue ( annotationType , usedValuePairs [ i ] ) ; } } long tagBits = detectStandardAnnotation ( scope , annotationType , valueAttribute ) ; if ( ( this . recipient ) != null ) { if ( tagBits != 0 ) { switch ( this . recipient . kind ( ) ) { case Binding . PACKAGE : break ; case Binding . TYPE : case Binding . GENERIC_TYPE : case Binding . TYPE_PARAMETER : ( ( ReferenceBinding ) ( this . recipient ) ) . tagBits |= tagBits ; break ; case Binding . METHOD : ( ( MethodBinding ) ( this . recipient ) ) . tagBits |= tagBits ; break ; case Binding . FIELD : ( ( FieldBinding ) ( this . recipient ) ) . tagBits |= tagBits ; break ; case Binding . LOCAL : ( ( LocalVariableBinding ) ( this . recipient ) ) . tagBits |= tagBits ; break ; } } checkTargetCompatibility : { long metaTagBits = annotationType . tagBits ; if ( ( metaTagBits & ( TagBits . AnnotationTargetMASK ) ) == 0 ) break checkTargetCompatibility ; switch ( recipient . kind ( ) ) { case Binding . PACKAGE : if ( ( metaTagBits & ( TagBits . AnnotationForPackage ) ) != 0 ) break checkTargetCompatibility ; break ; case Binding . TYPE : case Binding . GENERIC_TYPE : if ( ( ( ReferenceBinding ) ( this . recipient ) ) . isAnnotationType ( ) ) { if ( ( metaTagBits & ( TagBits . AnnotationForAnnotationType ) ) != 0 ) break checkTargetCompatibility ; } else if ( ( metaTagBits & ( TagBits . AnnotationForType ) ) != 0 ) break checkTargetCompatibility ; break ; case Binding . TYPE_PARAMETER : if ( ( metaTagBits & ( TagBits . AnnotationForParameter ) ) != 0 ) break checkTargetCompatibility ; break ; case Binding . METHOD : if ( ( ( MethodBinding ) ( this . recipient ) ) . isConstructor ( ) ) { if ( ( metaTagBits & ( TagBits . AnnotationForConstructor ) ) != 0 ) break checkTargetCompatibility ; } else if ( ( metaTagBits & ( TagBits . AnnotationForMethod ) ) != 0 ) break checkTargetCompatibility ; break ; case Binding . FIELD : if ( ( metaTagBits & ( TagBits . AnnotationForField ) ) != 0 ) break checkTargetCompatibility ; break ; case Binding . LOCAL : if ( ( ( annotationType . tagBits ) & ( TagBits . AnnotationForLocalVariable ) ) != 0 ) break checkTargetCompatibility ; break ; } <START_BUG> scope . problemReporter ( ) . incompatibleTargetForAnnotation ( this ) ; <END_BUG> } } return this . resolvedType ; } public abstract void traverse ( ASTVisitor visitor , BlockScope scope ) { } public abstract void traverse ( ASTVisitor visitor , CompilationUnitScope scope ) { } }

Fix:
scope . problemReporter ( ) . disallowedTargetForAnnotation ( this ) ;