Buggy code:
public class ReturnStatement extends Statement { public Expression expression ; public SubRoutineStatement [ ] subroutines ; public LocalVariableBinding saveValueVariable ; public int initStateIndex = - 1 ; public ReturnStatement ( Expression expression , int sourceStart , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void generateReturnBytecode ( CodeStream codeStream ) { } public void generateStoreSaveValueIfNecessary ( CodeStream codeStream ) { } private boolean needValueStore ( ) { } public boolean needValue ( ) { } public void prepareSaveValueLocation ( TryStatement targetTryStatement ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void resolve ( BlockScope scope ) { MethodScope methodScope = scope . methodScope ( ) ; MethodBinding methodBinding ; TypeBinding methodType = ( ( methodScope . referenceContext ) instanceof AbstractMethodDeclaration ) ? ( methodBinding = ( ( AbstractMethodDeclaration ) ( methodScope . referenceContext ) ) . binding ) == null ? null : methodBinding . returnType : TypeBinding . VOID ; TypeBinding expressionType ; if ( methodType == ( TypeBinding . VOID ) ) { if ( ( this . expression ) == null ) return ; if ( ( expressionType = this . expression . resolveType ( scope ) ) != null ) scope . problemReporter ( ) . attemptToReturnNonVoidExpression ( this , expressionType ) ; return ; } if ( ( this . expression ) == null ) { if ( methodType != null ) scope . problemReporter ( ) . shouldReturn ( methodType , this ) ; return ; } this . expression . setExpectedType ( methodType ) ; if ( ( expressionType = this . expression . resolveType ( scope ) ) == null ) return ; if ( expressionType == ( TypeBinding . VOID ) ) { scope . problemReporter ( ) . attemptToReturnVoidValue ( this ) ; return ; } if ( methodType == null ) return ; if ( methodType != expressionType ) scope . compilationUnitScope ( ) . recordTypeConversion ( methodType , expressionType ) ; if ( ( this . expression . isConstantValueOfTypeAssignableToType ( expressionType , methodType ) ) || ( expressionType . isCompatibleWith ( methodType ) ) ) { this . expression . computeConversion ( scope , methodType , expressionType ) ; if ( expressionType . needsUncheckedConversion ( methodType ) ) { scope . problemReporter ( ) . unsafeTypeConversion ( this . expression , expressionType , methodType ) ; } if ( ( ( this . expression ) instanceof CastExpression ) && ( ( ( this . expression . bits ) & ( ( ASTNode . UnnecessaryCast ) | ( ASTNode . DisableUnnecessaryCastCheck ) ) ) == 0 ) ) { CastExpression . checkNeedForAssignedCast ( scope , methodType , ( ( CastExpression ) ( this . expression ) ) ) ; } return ; } else if ( ( scope . isBoxingCompatibleWith ( expressionType , methodType ) ) || ( ( ( ( expressionType . isBaseType ( ) ) && ( ( scope . compilerOptions ( ) . sourceLevel ) >= ( ClassFileConstants . JDK1_5 ) ) ) && ( ! ( methodType . isBaseType ( ) ) ) ) && ( this . expression . isConstantValueOfTypeAssignableToType ( expressionType , scope . environment ( ) . computeBoxingType ( methodType ) ) ) ) ) { this . expression . computeConversion ( scope , methodType , expressionType ) ; if ( ( ( this . expression ) instanceof CastExpression ) && ( ( ( this . expression . bits ) & ( ( ASTNode . UnnecessaryCast ) | ( ASTNode . DisableUnnecessaryCastCheck ) ) ) == 0 ) ) { CastExpression . checkNeedForAssignedCast ( scope , methodType , ( ( CastExpression ) ( this . expression ) ) ) ; } return ; } <START_BUG> scope . problemReporter ( ) . typeMismatchError ( expressionType , methodType , this . expression ) ; <END_BUG> } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
scope . problemReporter ( ) . typeMismatchError ( expressionType , methodType , this . expression , null ) ;