Buggy code:
public class Javadoc extends ASTNode { public JavadocSingleNameReference [ ] paramReferences ; public JavadocSingleTypeReference [ ] paramTypeParameters ; public TypeReference [ ] exceptionReferences ; public JavadocReturnStatement returnStatement ; public Expression [ ] seeReferences ; public long inheritedPositions = - 1 ; public JavadocSingleNameReference [ ] invalidParameters ; public long valuePositions = - 1 ; public Javadoc ( int sourceStart , int sourceEnd ) { } boolean canBeSeen ( int visibility , int modifiers ) { } public ASTNode getNodeStartingAt ( int start ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public void resolve ( ClassScope scope ) { } public void resolve ( CompilationUnitScope unitScope ) { } public void resolve ( MethodScope methScope ) { } private void resolveReference ( Expression reference , Scope scope ) { } private void resolveParamTags ( MethodScope methScope , boolean reportMissing ) { } private void resolveTypeParameterTags ( Scope scope , boolean reportMissing ) { } private void resolveThrowsTags ( MethodScope methScope , boolean reportMissing ) { AbstractMethodDeclaration md = methScope . referenceMethod ( ) ; int throwsTagsLength = ( ( this . exceptionReferences ) == null ) ? 0 : this . exceptionReferences . length ; if ( md == null ) { for ( int i = 0 ; i < throwsTagsLength ; i ++ ) { TypeReference typeRef = this . exceptionReferences [ i ] ; int start = typeRef . sourceStart ; int end = typeRef . sourceEnd ; if ( typeRef instanceof JavadocQualifiedTypeReference ) { start = ( ( JavadocQualifiedTypeReference ) ( typeRef ) ) . tagSourceStart ; end = ( ( JavadocQualifiedTypeReference ) ( typeRef ) ) . tagSourceEnd ; } else if ( typeRef instanceof JavadocSingleTypeReference ) { start = ( ( JavadocSingleTypeReference ) ( typeRef ) ) . tagSourceStart ; end = ( ( JavadocSingleTypeReference ) ( typeRef ) ) . tagSourceEnd ; } methScope . problemReporter ( ) . javadocUnexpectedTag ( start , end ) ; } return ; } <START_BUG> int boundExceptionLength = ( ( ( md . binding ) == null ) || ( ( md . binding . thrownExceptions ) == null ) ) ? 0 : md . binding . thrownExceptions . length ; <END_BUG> int thrownExceptionLength = ( ( md . thrownExceptions ) == null ) ? 0 : md . thrownExceptions . length ; if ( throwsTagsLength == 0 ) { if ( reportMissing ) { for ( int i = 0 ; i < boundExceptionLength ; i ++ ) { ReferenceBinding exceptionBinding = md . binding . thrownExceptions [ i ] ; if ( ( exceptionBinding != null ) && ( exceptionBinding . isValidBinding ( ) ) ) { int j = i ; while ( ( j < thrownExceptionLength ) && ( exceptionBinding != ( md . thrownExceptions [ j ] . resolvedType ) ) ) j ++ ; if ( j < thrownExceptionLength ) { methScope . problemReporter ( ) . javadocMissingThrowsTag ( md . thrownExceptions [ j ] , md . binding . modifiers ) ; } } } } } else { int maxRef = 0 ; TypeReference [ ] typeReferences = new TypeReference [ throwsTagsLength ] ; for ( int i = 0 ; i < throwsTagsLength ; i ++ ) { TypeReference typeRef = this . exceptionReferences [ i ] ; typeRef . resolve ( methScope ) ; TypeBinding typeBinding = typeRef . resolvedType ; if ( ( ( typeBinding != null ) && ( typeBinding . isValidBinding ( ) ) ) && ( typeBinding . isClass ( ) ) ) { typeReferences [ ( maxRef ++ ) ] = typeRef ; } } for ( int i = 0 ; i < boundExceptionLength ; i ++ ) { ReferenceBinding exceptionBinding = md . binding . thrownExceptions [ i ] ; if ( exceptionBinding != null ) exceptionBinding = ( ( ReferenceBinding ) ( exceptionBinding . erasure ( ) ) ) ; boolean found = false ; for ( int j = 0 ; ( j < maxRef ) && ( ! found ) ; j ++ ) { if ( ( typeReferences [ j ] ) != null ) { TypeBinding typeBinding = typeReferences [ j ] . resolvedType ; if ( exceptionBinding == typeBinding ) { found = true ; typeReferences [ j ] = null ; } } } if ( ( ! found ) && reportMissing ) { if ( ( exceptionBinding != null ) && ( exceptionBinding . isValidBinding ( ) ) ) { int k = i ; while ( ( k < thrownExceptionLength ) && ( exceptionBinding != ( md . thrownExceptions [ k ] . resolvedType ) ) ) k ++ ; if ( k < thrownExceptionLength ) { methScope . problemReporter ( ) . javadocMissingThrowsTag ( md . thrownExceptions [ k ] , md . binding . modifiers ) ; } } } } for ( int i = 0 ; i < maxRef ; i ++ ) { TypeReference typeRef = typeReferences [ i ] ; if ( typeRef != null ) { boolean compatible = false ; for ( int j = 0 ; ( j < thrownExceptionLength ) && ( ! compatible ) ; j ++ ) { TypeBinding exceptionBinding = md . thrownExceptions [ j ] . resolvedType ; if ( exceptionBinding != null ) { compatible = typeRef . resolvedType . isCompatibleWith ( exceptionBinding ) ; } } if ( ( ! compatible ) && ( ! ( typeRef . resolvedType . isUncheckedException ( false ) ) ) ) { methScope . problemReporter ( ) . javadocInvalidThrowsClassName ( typeRef , md . binding . modifiers ) ; } } } } } private void verifyTypeReference ( Expression reference , Expression typeReference , Scope scope , boolean source15 , ReferenceBinding resolvedType , int modifiers ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { }

Fix:
int boundExceptionLength = ( ( md . binding ) == null ) ? 0 : md . binding . thrownExceptions . length ;