Buggy code:
public class CaseStatement extends Statement { public Expression constantExpression ; public CaseLabel targetLabel ; public CaseStatement ( Expression constantExpression , int sourceEnd , int sourceStart ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding switchExpressionType , SwitchStatement switchStatement ) { scope . enclosingCase = this ; if ( ( this . constantExpression ) == null ) { if ( ( switchStatement . defaultCase ) != null ) scope . problemReporter ( ) . duplicateDefaultCase ( this ) ; switchStatement . defaultCase = this ; return Constant . NotAConstant ; } switchStatement . cases [ ( ( switchStatement . caseCount ) ++ ) ] = this ; if ( ( ( switchExpressionType != null ) && ( switchExpressionType . isEnum ( ) ) ) && ( ( this . constantExpression ) instanceof SingleNameReference ) ) { ( ( SingleNameReference ) ( this . constantExpression ) ) . setActualReceiverType ( ( ( ReferenceBinding ) ( switchExpressionType ) ) ) ; } TypeBinding caseType = this . constantExpression . resolveType ( scope ) ; if ( ( caseType == null ) || ( switchExpressionType == null ) ) return Constant . NotAConstant ; if ( ( this . constantExpression . isConstantValueOfTypeAssignableToType ( caseType , switchExpressionType ) ) || ( caseType . isCompatibleWith ( switchExpressionType ) ) ) { if ( caseType . isEnum ( ) ) { if ( ( ( ( this . constantExpression . bits ) & ( ASTNode . ParenthesizedMASK ) ) > > ( ASTNode . ParenthesizedSHIFT ) ) != 0 ) { scope . problemReporter ( ) . enumConstantsCannotBeSurroundedByParenthesis ( this . constantExpression ) ; } if ( ( ( this . constantExpression ) instanceof NameReference ) && ( ( ( this . constantExpression . bits ) & ( ASTNode . RestrictiveFlagMASK ) ) == ( Binding . FIELD ) ) ) { NameReference reference = ( ( NameReference ) ( this . constantExpression ) ) ; FieldBinding field = reference . fieldBinding ( ) ; if ( ( ( field . modifiers ) & ( ClassFileConstants . AccEnum ) ) == 0 ) { scope . problemReporter ( ) . enumSwitchCannotTargetField ( reference , field ) ; } else if ( reference instanceof QualifiedNameReference ) { scope . problemReporter ( ) . cannotUseQualifiedEnumConstantInCaseLabel ( reference , field ) ; } return IntConstant . fromValue ( ( ( field . original ( ) . id ) + 1 ) ) ; } } else { return this . constantExpression . constant ; } } else if ( ( scope . isBoxingCompatibleWith ( caseType , switchExpressionType ) ) || ( ( ( ( caseType . isBaseType ( ) ) && ( ( scope . compilerOptions ( ) . sourceLevel ) >= ( ClassFileConstants . JDK1_5 ) ) ) && ( ! ( switchExpressionType . isBaseType ( ) ) ) ) && ( this . constantExpression . isConstantValueOfTypeAssignableToType ( caseType , scope . environment ( ) . computeBoxingType ( switchExpressionType ) ) ) ) ) { return this . constantExpression . constant ; } <START_BUG> scope . problemReporter ( ) . typeMismatchError ( caseType , switchExpressionType , this . constantExpression ) ; <END_BUG> return Constant . NotAConstant ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
scope . problemReporter ( ) . typeMismatchError ( caseType , switchExpressionType , this . constantExpression , switchStatement . expression ) ;