Buggy code:
break ; } } } return ; } char [ ] [ ] argumentTypes = null ; char [ ] [ ] argumentNames = null ; boolean isVarArgs = false ; Argument [ ] arguments = methodDeclaration . arguments ; if ( arguments != null ) { int argumentLength = arguments . length ; argumentTypes = new char [ argumentLength ] [ ] ; argumentNames = new char [ argumentLength ] [ ] ; for ( int i = 0 ; i < argumentLength ; i ++ ) { argumentTypes [ i ] = CharOperation . concatWith ( arguments [ i ] . type . getParameterizedTypeName ( ) , '.' ) ; argumentNames [ i ] = arguments [ i ] . name ; } isVarArgs = arguments [ ( argumentLength - 1 ) ] . isVarArgs ( ) ; } char [ ] [ ] thrownExceptionTypes = null ; TypeReference [ ] thrownExceptions = methodDeclaration . thrownExceptions ; if ( thrownExceptions != null ) { int thrownExceptionLength = thrownExceptions . length ; thrownExceptionTypes = new char [ thrownExceptionLength ] [ ] ; for ( int i = 0 ; i < thrownExceptionLength ; i ++ ) { thrownExceptionTypes [ i ] = CharOperation . concatWith ( thrownExceptions [ i ] . getParameterizedTypeName ( ) , '.' ) ; } } int selectorSourceEnd = - 1 ; if ( methodDeclaration . isConstructor ( ) ) { if ( methodDeclaration instanceof SourceConstructorDeclaration ) { selectorSourceEnd = ( ( SourceConstructorDeclaration ) ( methodDeclaration ) ) . selectorSourceEnd ; } if ( isInRange ) { int currentModifiers = methodDeclaration . modifiers ; if ( isVarArgs ) currentModifiers |= AccVarargs ; boolean deprecated = ( currentModifiers & ( AccDeprecated ) ) != 0 ; ISourceElementRequestor . MethodInfo methodInfo = new ISourceElementRequestor . MethodInfo ( ) ; methodInfo . isConstructor = true ; methodInfo . declarationStart = methodDeclaration . declarationSourceStart ; methodInfo . modifiers = ( deprecated ) ? ( currentModifiers & ( AccJustFlag ) ) | ( AccDeprecated ) : currentModifiers & ( AccJustFlag ) ; methodInfo . name = methodDeclaration . selector ; methodInfo . nameSourceStart = methodDeclaration . sourceStart ; methodInfo . nameSourceEnd = selectorSourceEnd ; methodInfo . parameterTypes = argumentTypes ; methodInfo . parameterNames = argumentNames ; methodInfo . exceptionTypes = thrownExceptionTypes ; methodInfo . typeParameters = getTypeParameterInfos ( methodDeclaration . typeParameters ( ) ) ; requestor . enterConstructor ( methodInfo ) ; } if ( reportReferenceInfo ) { ConstructorDeclaration constructorDeclaration = ( ( ConstructorDeclaration ) ( methodDeclaration ) ) ; ExplicitConstructorCall constructorCall = constructorDeclaration . constructorCall ; if ( constructorCall != null ) { switch ( constructorCall . accessMode ) { case ExplicitConstructorCall . This : requestor . acceptConstructorReference ( typeNames [ ( ( nestedTypeIndex ) - 1 ) ] , ( ( constructorCall . arguments ) == null ? 0 : constructorCall . arguments . length ) , constructorCall . sourceStart ) ; break ; case ExplicitConstructorCall . Super : case ExplicitConstructorCall . ImplicitSuper : requestor . acceptConstructorReference ( superTypeNames [ ( ( nestedTypeIndex ) - 1 ) ] , ( ( constructorCall . arguments ) == null ? 0 : constructorCall . arguments . length ) , constructorCall . sourceStart ) ; break ; } } } this . visitIfNeeded ( methodDeclaration ) ; if ( isInRange ) { requestor . exitConstructor ( methodDeclaration . declarationSourceEnd ) ; } return ; } if ( methodDeclaration instanceof SourceMethodDeclaration ) { selectorSourceEnd = ( ( SourceMethodDeclaration ) ( methodDeclaration ) ) . selectorSourceEnd ; } if ( isInRange ) { int currentModifiers = methodDeclaration . modifiers ; if ( isVarArgs ) currentModifiers |= AccVarargs ; boolean deprecated = ( currentModifiers & ( AccDeprecated ) ) != 0 ; <START_BUG> TypeReference returnType = ( methodDeclaration instanceof MethodDeclaration ) ? ( ( MethodDeclaration ) ( methodDeclaration ) ) . returnType : ( ( AnnotationMethodDeclaration ) ( methodDeclaration ) ) . returnType ; <END_BUG> ISourceElementRequestor . MethodInfo methodInfo = new ISourceElementRequestor . MethodInfo ( ) ; methodInfo . declarationStart = methodDeclaration . declarationSourceStart ; methodInfo . modifiers = ( deprecated ) ? ( currentModifiers & ( AccJustFlag ) ) | ( AccDeprecated ) : currentModifiers & ( AccJustFlag ) ; methodInfo . returnType = ( returnType == null ) ? null : CharOperation . concatWith ( returnType . getParameterizedTypeName ( ) , '.' ) ; methodInfo . name = methodDeclaration . selector ; methodInfo . nameSourceStart = methodDeclaration . sourceStart ; methodInfo . nameSourceEnd = selectorSourceEnd ; methodInfo . parameterTypes = argumentTypes ; methodInfo . parameterNames = argumentNames ; methodInfo . exceptionTypes = thrownExceptionTypes ; methodInfo . typeParameters = getTypeParameterInfos ( methodDeclaration . typeParameters ( ) ) ; requestor . enterMethod ( methodInfo ) ; } this . visitIfNeeded ( methodDeclaration ) ; if ( isInRange ) { requestor . exitMethod ( methodDeclaration . declarationSourceEnd ) ; } } private ISourceElementRequestor . TypeParameterInfo [ ] getTypeParameterInfos ( TypeParameter [ ] typeParameters ) { } public void notifySourceElementRequestor ( FieldDeclaration fieldDeclaration , TypeDeclaration declaringType ) { } public void notifySourceElementRequestor ( ImportReference importReference , boolean isPackage ) { } public void notifySourceElementRequestor ( TypeDeclaration typeDeclaration , boolean notifyTypePresence , TypeDeclaration declaringType ) { } private int sourceEnd ( TypeDeclaration typeDeclaration ) { } public void parseCompilationUnit ( ICompilationUnit unit , int start , int end , boolean fullParse ) { } public CompilationUnitDeclaration parseCompilationUnit ( ICompilationUnit unit , boolean fullParse ) { } public void parseTypeMemberDeclarations ( ISourceType type , ICompilationUnit sourceUnit , int start , int end , boolean needReferenceInfo ) { } public void parseTypeMemberDeclarations ( char [ ] contents , int start , int end ) { } private static void quickSort ( ASTNode [ ] sortedCollection , int left , int right ) { } public void addUnknownRef ( NameReference nameRef ) { } private void visitIfNeeded ( AbstractMethodDeclaration method ) { } private void visitIfNeeded ( FieldDeclaration field , TypeDeclaration declaringType ) { } private void visitIfNeeded ( Initializer initializer ) { } }

Fix:
TypeReference returnType = ( methodDeclaration instanceof MethodDeclaration ) ? ( ( MethodDeclaration ) ( methodDeclaration ) ) . returnType : null ;