Buggy code:
public class AnnotationParser { public static final char [ ] TAG_DEPRECATED = "deprecated" . toCharArray ( ) ; public static final char [ ] TAG_PARAM = "param" . toCharArray ( ) ; public static final char [ ] TAG_RETURN = "return" . toCharArray ( ) ; public static final char [ ] TAG_THROWS = "throws" . toCharArray ( ) ; public static final char [ ] TAG_EXCEPTION = "exception" . toCharArray ( ) ; public static final char [ ] TAG_SEE = "see" . toCharArray ( ) ; Scanner scanner ; Parser sourceParser ; Annotation annotation ; int index ; int tagSourceStart ; int tagSourceEnd ; int lineEnd ; char [ ] source ; public boolean checkAnnotation ; int currentTokenType = - 1 ; protected int identifierPtr ; protected char [ ] [ ] identifierStack ; protected int identifierLengthPtr ; protected int [ ] identifierLengthStack ; protected long [ ] identifierPositionStack ; static int AstStackIncrement = 10 ; protected int astPtr ; protected AstNode [ ] astStack ; protected int astLengthPtr ; protected int [ ] astLengthStack ; AnnotationParser ( Parser sourceParser ) { } public boolean checkDeprecation ( int annotationStart , int annotationEnd ) { boolean foundDeprecated = false ; try { this . source = this . sourceParser . scanner . source ; <START_BUG> if ( this . checkAnnotation ) { <END_BUG> this . annotation = new Annotation ( annotationStart , annotationEnd ) ; this . astLengthPtr = - 1 ; this . astPtr = - 1 ; this . currentTokenType = - 1 ; } else { this . annotation = null ; } int firstLineNumber = this . sourceParser . scanner . getLineNumber ( annotationStart ) ; int lastLineNumber = this . sourceParser . scanner . getLineNumber ( annotationEnd ) ; nextLine : for ( int line = firstLineNumber ; line <= lastLineNumber ; line ++ ) { int lineStart = ( line == firstLineNumber ) ? annotationStart + 3 : this . sourceParser . scanner . getLineStart ( line ) ; this . index = lineStart ; this . lineEnd = ( line == lastLineNumber ) ? annotationEnd - 2 : this . sourceParser . scanner . getLineEnd ( line ) ; while ( ( this . index ) < ( this . lineEnd ) ) { char nextCharacter = readChar ( ) ; switch ( nextCharacter ) { case '@' : if ( ( this . annotation ) == null ) { if ( ( ( ( ( ( ( ( ( ( ( readChar ( ) ) == 'd' ) && ( ( readChar ( ) ) == 'e' ) ) && ( ( readChar ( ) ) == 'p' ) ) && ( ( readChar ( ) ) == 'r' ) ) && ( ( readChar ( ) ) == 'e' ) ) && ( ( readChar ( ) ) == 'c' ) ) && ( ( readChar ( ) ) == 'a' ) ) && ( ( readChar ( ) ) == 't' ) ) && ( ( readChar ( ) ) == 'e' ) ) && ( ( readChar ( ) ) == 'd' ) ) { nextCharacter = readChar ( ) ; if ( ( Character . isWhitespace ( nextCharacter ) ) || ( nextCharacter == '*' ) ) { foundDeprecated = true ; break nextLine ; } } continue nextLine ; } this . scanner . resetTo ( this . index , this . lineEnd ) ; this . currentTokenType = - 1 ; try { int tk = readTokenAndConsume ( ) ; this . tagSourceStart = this . scanner . getCurrentTokenStartPosition ( ) ; this . tagSourceEnd = this . scanner . getCurrentTokenEndPosition ( ) ; switch ( tk ) { case TerminalTokens . TokenNameIdentifier : char [ ] tag = this . scanner . getCurrentIdentifierSource ( ) ; if ( CharOperation . equals ( tag , AnnotationParser . TAG_DEPRECATED ) ) { foundDeprecated = true ; } else if ( CharOperation . equals ( tag , AnnotationParser . TAG_PARAM ) ) { parseParam ( ) ; } else if ( CharOperation . equals ( tag , AnnotationParser . TAG_EXCEPTION ) ) { parseThrows ( ) ; } else if ( CharOperation . equals ( tag , AnnotationParser . TAG_SEE ) ) { parseSee ( ) ; } break ; case TerminalTokens . TokenNamereturn : parseReturn ( ) ; break ; case TerminalTokens . TokenNamethrows : parseThrows ( ) ; break ; } } catch ( InvalidInputException e ) { consumeToken ( ) ; } continue nextLine ; case '*' : break ; default : if ( ! ( CharOperation . isWhitespace ( nextCharacter ) ) ) { continue nextLine ; } } } } } finally { updateAnnotation ( ) ; this . source = null ; } return foundDeprecated ; } private void consumeToken ( ) { } private int getEndPosition ( ) { } private AnnotationMessageSend parseArguments ( TypeReference receiver ) throws InvalidInputException { } private boolean parseHref ( ) throws InvalidInputException { } private Expression parseMember ( TypeReference receiver ) throws InvalidInputException { } private void parseParam ( ) throws InvalidInputException { } private TypeReference parseQualifiedName ( boolean reset ) throws InvalidInputException { } private void parseReturn ( ) { } private void parseThrows ( ) throws InvalidInputException { } private Expression parseReference ( ) throws InvalidInputException { } private void parseSee ( ) throws InvalidInputException { } private void pushIdentifier ( boolean newLength ) { } private void pushOnAstStack ( AstNode node , boolean newLength ) { } private void pushParamName ( Argument arg ) { } private void pushSeeRef ( Statement statement ) { } private void pushThrowName ( TypeReference typeRef ) { } private char readChar ( ) { } private int readToken ( ) throws InvalidInputException { } private int readTokenAndConsume ( ) throws InvalidInputException { } private void updateAnnotation ( ) { } }

Fix:
if ( ( this . checkAnnotation ) && ( ( this . scanner . source ) != null ) ) {