Buggy code:
public class CastExpression extends Expression { public Expression expression ; public Expression type ; public CastExpression ( Expression expression , Expression type ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public final boolean checkCastTypesCompatibility ( BlockScope scope , TypeBinding castType , TypeBinding expressionType ) { } public static void checkNeedForArgumentCasts ( BlockScope scope , Expression receiver , ReferenceBinding receiverType , MethodBinding binding , Expression [ ] arguments , TypeBinding [ ] argumentTypes , final InvocationSite invocationSite ) { } public static void checkNeedForArgumentCasts ( BlockScope scope , int operator , int operatorSignature , Expression left , int leftTypeId , Expression right , int rightTypeId ) { if ( ( scope . environment ( ) . options . getSeverity ( CompilerOptions . UnnecessaryTypeCheck ) ) == ( ProblemSeverities . Ignore ) ) return ; boolean unnecessaryLeftCast = ( ( left . bits ) & ( UnnecessaryCastMask ) ) != 0 ; int alternateLeftTypeId = ( unnecessaryLeftCast ) ? ( ( CastExpression ) ( left ) ) . expression . resolvedType . id : leftTypeId ; if ( unnecessaryLeftCast && ( alternateLeftTypeId == leftTypeId ) ) { scope . problemReporter ( ) . unnecessaryCast ( ( ( CastExpression ) ( left ) ) ) ; unnecessaryLeftCast = false ; } boolean unnecessaryRightCast = ( ( right . bits ) & ( UnnecessaryCastMask ) ) != 0 ; int alternateRightTypeId = ( unnecessaryRightCast ) ? ( ( CastExpression ) ( right ) ) . expression . resolvedType . id : rightTypeId ; if ( unnecessaryRightCast && ( alternateRightTypeId == rightTypeId ) ) { scope . problemReporter ( ) . unnecessaryCast ( ( ( CastExpression ) ( right ) ) ) ; unnecessaryRightCast = false ; } if ( unnecessaryLeftCast || unnecessaryRightCast ) { <START_BUG> int alternateOperatorSignature = ResolveTypeTables [ operator ] [ ( ( alternateLeftTypeId << 4 ) + alternateRightTypeId ) ] ; <END_BUG> final int CompareMASK = ( ( 15 << 16 ) + ( 15 << 8 ) ) + 15 ; if ( ( operatorSignature & CompareMASK ) == ( alternateOperatorSignature & CompareMASK ) ) { if ( unnecessaryLeftCast ) scope . problemReporter ( ) . unnecessaryCastForArgument ( ( ( CastExpression ) ( left ) ) , TypeBinding . wellKnownType ( scope , ( ( left . implicitConversion ) > > 4 ) ) ) ; if ( unnecessaryRightCast ) scope . problemReporter ( ) . unnecessaryCastForArgument ( ( ( CastExpression ) ( right ) ) , TypeBinding . wellKnownType ( scope , ( ( right . implicitConversion ) > > 4 ) ) ) ; } } } private static void checkAlternateBinding ( BlockScope scope , Expression receiver , ReferenceBinding receiverType , MethodBinding binding , Expression [ ] arguments , TypeBinding [ ] originalArgumentTypes , TypeBinding [ ] alternateArgumentTypes , final InvocationSite invocationSite ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public Expression innermostCastedExpression ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
int alternateOperatorSignature = OperatorExpression . OperatorSignatures [ operator ] [ ( ( alternateLeftTypeId << 4 ) + alternateRightTypeId ) ] ;