Buggy code:
public void analyseCode ( CompilationUnitScope unitScope ) { } public boolean checkConstructors ( Parser parser ) { } public CompilationResult compilationResult ( ) { } public ConstructorDeclaration createDefaultConstructor ( boolean needExplicitConstructorCall , boolean needToInsert ) { } public MethodBinding createDefaultConstructorWithBinding ( MethodBinding inheritedConstructorBinding , boolean eraseThrownExceptions ) { } public FieldDeclaration declarationOf ( FieldBinding fieldBinding ) { } public TypeDeclaration declarationOf ( MemberTypeBinding memberTypeBinding ) { } public AbstractMethodDeclaration declarationOf ( MethodBinding methodBinding ) { } public TypeDeclaration declarationOfType ( char [ ] [ ] typeName ) { } public void generateCode ( ClassFile enclosingClassFile ) { } public void generateCode ( BlockScope blockScope , CodeStream codeStream ) { } public void generateCode ( ClassScope classScope , ClassFile enclosingClassFile ) { } public void generateCode ( CompilationUnitScope unitScope ) { } public boolean hasErrors ( ) { } private void internalAnalyseCode ( FlowContext flowContext , FlowInfo flowInfo ) { } public static final int kind ( int flags ) { } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public void manageEnclosingInstanceAccessIfNecessary ( ClassScope currentScope , FlowInfo flowInfo ) { } public final boolean needClassInitMethod ( ) { } public void parseMethods ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public StringBuffer printHeader ( int indent , StringBuffer output ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void resolve ( ) { SourceTypeBinding sourceType = this . binding ; if ( sourceType == null ) { this . ignoreFurtherInvestigation = true ; return ; } try { boolean old = this . staticInitializerScope . insideTypeAnnotation ; try { this . staticInitializerScope . insideTypeAnnotation = true ; ASTNode . resolveAnnotations ( this . staticInitializerScope , this . annotations , sourceType ) ; } finally { this . staticInitializerScope . insideTypeAnnotation = old ; } if ( ( ( ( ( sourceType . getAnnotationTagBits ( ) ) & ( TagBits . AnnotationDeprecated ) ) == 0 ) && ( ( ( sourceType . modifiers ) & ( ClassFileConstants . AccDeprecated ) ) != 0 ) ) && ( ( this . scope . compilerOptions ( ) . sourceLevel ) >= ( ClassFileConstants . JDK1_5 ) ) ) { this . scope . problemReporter ( ) . missingDeprecatedAnnotationForType ( this ) ; } if ( ( ( this . bits ) & ( ASTNode . UndocumentedEmptyBlock ) ) != 0 ) { this . scope . problemReporter ( ) . undocumentedEmptyBlock ( ( ( this . bodyStart ) - 1 ) , this . bodyEnd ) ; } boolean needSerialVersion = ( ( ( ( this . scope . compilerOptions ( ) . getSeverity ( CompilerOptions . MissingSerialVersion ) ) != ( ProblemSeverities . Ignore ) ) && ( sourceType . isClass ( ) ) ) && ( ( sourceType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoExternalizable , false ) ) == null ) ) && ( ( sourceType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaIoSerializable , false ) ) != null ) ; if ( needSerialVersion ) { CompilationUnitScope compilationUnitScope = this . scope . compilationUnitScope ( ) ; <START_BUG> MethodBinding methodBinding = sourceType . getExactMethod ( TypeConstants . WRITEREPLACE , new TypeBinding [ 0 ] , compilationUnitScope ) ; <END_BUG> ReferenceBinding [ ] throwsExceptions ; needSerialVersion = ( ( ( ( methodBinding == null ) || ( ! ( methodBinding . isValidBinding ( ) ) ) ) || ( ( methodBinding . returnType . id ) != ( TypeIds . T_JavaLangObject ) ) ) || ( ( ( throwsExceptions = methodBinding . thrownExceptions ) . length ) != 1 ) ) || ( ( throwsExceptions [ 0 ] . id ) != ( TypeIds . T_JavaIoObjectStreamException ) ) ; if ( needSerialVersion ) { boolean hasWriteObjectMethod = false ; boolean hasReadObjectMethod = false ; TypeBinding argumentTypeBinding = this . scope . getType ( TypeConstants . JAVA_IO_OBJECTOUTPUTSTREAM , 3 ) ; if ( argumentTypeBinding . isValidBinding ( ) ) { methodBinding = sourceType . getExactMethod ( TypeConstants . WRITEOBJECT , new TypeBinding [ ] { argumentTypeBinding } , compilationUnitScope ) ; hasWriteObjectMethod = ( ( ( ( ( methodBinding != null ) && ( methodBinding . isValidBinding ( ) ) ) && ( ( methodBinding . modifiers ) == ( ClassFileConstants . AccPrivate ) ) ) && ( ( methodBinding . returnType ) == ( TypeBinding . VOID ) ) ) && ( ( ( throwsExceptions = methodBinding . thrownExceptions ) . length ) == 1 ) ) && ( ( throwsExceptions [ 0 ] . id ) == ( TypeIds . T_JavaIoException ) ) ; } argumentTypeBinding = this . scope . getType ( TypeConstants . JAVA_IO_OBJECTINPUTSTREAM , 3 ) ; if ( argumentTypeBinding . isValidBinding ( ) ) { methodBinding = sourceType . getExactMethod ( TypeConstants . READOBJECT , new TypeBinding [ ] { argumentTypeBinding } , compilationUnitScope ) ; hasReadObjectMethod = ( ( ( ( ( methodBinding != null ) && ( methodBinding . isValidBinding ( ) ) ) && ( ( methodBinding . modifiers ) == ( ClassFileConstants . AccPrivate ) ) ) && ( ( methodBinding . returnType ) == ( TypeBinding . VOID ) ) ) && ( ( ( throwsExceptions = methodBinding . thrownExceptions ) . length ) == 1 ) ) && ( ( throwsExceptions [ 0 ] . id ) == ( TypeIds . T_JavaIoException ) ) ; } needSerialVersion = ( ! hasWriteObjectMethod ) || ( ! hasReadObjectMethod ) ; } } if ( ( sourceType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) ) != null ) { ReferenceBinding current = sourceType ; checkEnclosedInGeneric : do { if ( current . isGenericType ( ) ) { this . scope . problemReporter ( ) . genericTypeCannotExtendThrowable ( this ) ; break checkEnclosedInGeneric ;

Fix:
MethodBinding methodBinding = sourceType . getExactMethod ( TypeConstants . WRITEREPLACE , Binding . NO_TYPES , compilationUnitScope ) ;