Buggy code:
public abstract class Expression extends Statement { public static final boolean isConstantValueRepresentable ( Constant constant , int constantTypeID , int targetTypeID ) { } public Constant constant ; public int implicitConversion ; public TypeBinding resolvedType ; public Expression ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } public final boolean checkCastTypesCompatibility ( Scope scope , TypeBinding castType , TypeBinding expressionType , Expression expression ) { if ( ( castType == null ) || ( expressionType == null ) ) return true ; LookupEnvironment env = scope . environment ( ) ; boolean use15specifics = ( env . options . sourceLevel ) >= ( JDK1_5 ) ; if ( castType . isBaseType ( ) ) { if ( expressionType . isBaseType ( ) ) { if ( expressionType == castType ) { if ( expression != null ) { this . constant = expression . constant ; } tagAsUnnecessaryCast ( scope , castType ) ; return true ; } boolean necessary = false ; if ( ( expressionType . isCompatibleWith ( castType ) ) || ( necessary = BaseTypeBinding . isNarrowing ( castType . id , expressionType . id ) ) ) { if ( expression != null ) { expression . implicitConversion = ( ( castType . id ) << 4 ) + ( expressionType . id ) ; if ( ( expression . constant ) != ( Constant . NotAConstant ) ) { constant = expression . constant . castTo ( expression . implicitConversion ) ; } } if ( ! necessary ) tagAsUnnecessaryCast ( scope , castType ) ; return true ; } } else if ( use15specifics && ( env . computeBoxingType ( expressionType ) . isCompatibleWith ( castType ) ) ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } return false ; } else <START_BUG> if ( ( use15specifics && ( expressionType . isBaseType ( ) ) ) && ( ( env . computeBoxingType ( castType ) ) == expressionType ) ) { <END_BUG> tagAsUnnecessaryCast ( scope , castType ) ; return true ; } if ( expressionType == ( NullBinding ) ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } if ( expressionType . isBaseType ( ) ) { return false ; } if ( expressionType . isArrayType ( ) ) { if ( castType == expressionType ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } if ( castType . isArrayType ( ) ) { TypeBinding exprElementType = ( ( ArrayBinding ) ( expressionType ) ) . elementsType ( ) ; if ( exprElementType . isBaseType ( ) ) { if ( ( ( ( ArrayBinding ) ( castType ) ) . elementsType ( ) ) == exprElementType ) { tagAsNeedCheckCast ( ) ; return true ; } else { return false ; } } return checkCastTypesCompatibility ( scope , ( ( ArrayBinding ) ( castType ) ) . elementsType ( ) , exprElementType , expression ) ; } else if ( castType . isTypeVariable ( ) ) { if ( expressionType instanceof ReferenceBinding ) { ReferenceBinding match = ( ( ReferenceBinding ) ( expressionType ) ) . findSuperTypeErasingTo ( ( ( ReferenceBinding ) ( castType ) ) ) ; if ( match == null ) { checkUnsafeCast ( scope , castType , expressionType , match , true ) ; } } else { checkUnsafeCast ( scope , castType , expressionType , null , true ) ; } return checkCastTypesCompatibility ( scope , castType . erasure ( ) , expressionType , expression ) ; } else if ( castType . isClass ( ) ) { if ( ( castType . id ) == ( TypeIds . T_JavaLangObject ) ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } } else { if ( ( ( castType . id ) == ( TypeIds . T_JavaLangCloneable ) ) || ( ( castType . id ) == ( TypeIds . T_JavaIoSerializable ) ) ) { tagAsNeedCheckCast ( ) ; return true ; } } return false ; } if ( ( expressionType . isTypeVariable ( ) ) || ( expressionType . isWildcard ( ) ) ) { if ( castType instanceof ReferenceBinding ) { TypeBinding match = ( ( ReferenceBinding ) ( expressionType ) ) . findSuperTypeErasingTo ( ( ( ReferenceBinding ) ( castType ) ) ) ; if ( match != null ) { tagAsUnnecessaryCast ( scope , castType ) ; return true ; } } return checkCastTypesCompatibility ( scope , castType , expressionType . erasure ( ) , expression ) ; } if ( expressionType . isClass ( ) ) { if ( castType . isArrayType ( ) ) { if ( ( expressionType . id ) == ( TypeIds . T_JavaLangObject ) ) { tagAsNeedCheckCast ( ) ; return true ; } } else if ( castType . isTypeVariable ( ) ) { TypeBinding match = ( ( ReferenceBinding ) ( expressionType ) ) . findSuperTypeErasingTo ( ( ( ReferenceBinding ) ( castType ) ) ) ; if ( match == null ) { checkUnsafeCast ( scope , castType , expressionType , match , true ) ; } return checkCastTypesCompatibility ( scope , castType . erasure ( ) , expressionType , expression ) ; } else if ( castType . isClass ( ) ) { TypeBinding match = ( ( ReferenceBinding ) ( expressionType ) ) . findSuperTypeErasingTo ( ( ( ReferenceBinding ) ( castType . erasure ( ) ) ) ) ; if ( match != null ) { if ( ( expression != null ) && ( ( castType . id ) == ( TypeIds . T_JavaLangString ) ) ) this . constant = expression . constant ; return checkUnsafeCast ( scope , castType , expressionType , match , false ) ; }

Fix:
if ( ( use15specifics && ( expressionType . isBaseType ( ) ) ) && ( env . computeBoxingType ( expressionType ) . isCompatibleWith ( castType ) ) ) {