Buggy code:
public class UnaryExpression extends OperatorExpression { public Expression expression ; public Constant optimizedBooleanConstant ; public UnaryExpression ( Expression expression , int operator ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public Constant optimizedBooleanConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { boolean expressionIsCast ; if ( ( expressionIsCast = ( this . expression ) instanceof CastExpression ) == true ) this . expression . bits |= ASTNode . DisableUnnecessaryCastCheck ; TypeBinding expressionType = this . expression . resolveType ( scope ) ; if ( expressionType == null ) { this . constant = Constant . NotAConstant ; return null ; } int expressionTypeID = expressionType . id ; boolean use15specifics = ( scope . compilerOptions ( ) . sourceLevel ) >= ( ClassFileConstants . JDK1_5 ) ; if ( use15specifics ) { if ( ! ( expressionType . isBaseType ( ) ) ) { expressionTypeID = scope . environment ( ) . computeBoxingType ( expressionType ) . id ; } } if ( expressionTypeID > 15 ) { this . constant = Constant . NotAConstant ; scope . problemReporter ( ) . invalidOperator ( this , expressionType ) ; return null ; } int tableId ; switch ( ( ( bits ) & ( ASTNode . OperatorMASK ) ) > > ( ASTNode . OperatorSHIFT ) ) { case OperatorIds . NOT : tableId = OperatorIds . AND_AND ; break ; case OperatorIds . TWIDDLE : tableId = OperatorIds . LEFT_SHIFT ; break ; default : tableId = OperatorIds . MINUS ; } int operatorSignature = OperatorExpression . OperatorSignatures [ tableId ] [ ( ( expressionTypeID << 4 ) + expressionTypeID ) ] ; this . expression . computeConversion ( scope , TypeBinding . wellKnownType ( scope , ( ( operatorSignature > > > 16 ) & 15 ) ) , expressionType ) ; this . bits |= operatorSignature & 15 ; switch ( operatorSignature & 15 ) { case TypeIds . T_boolean : this . resolvedType = TypeBinding . BOOLEAN ; break ; case TypeIds . T_byte : this . resolvedType = TypeBinding . BYTE ; break ; case TypeIds . T_char : this . resolvedType = TypeBinding . CHAR ; break ; case TypeIds . T_double : this . resolvedType = TypeBinding . DOUBLE ; break ; case TypeIds . T_float : this . resolvedType = TypeBinding . FLOAT ; break ; case TypeIds . T_int : this . resolvedType = TypeBinding . INT ; break ; case TypeIds . T_long : this . resolvedType = TypeBinding . LONG ; break ; default : this . constant = Constant . NotAConstant ; if ( expressionTypeID != ( TypeIds . T_undefined ) ) scope . problemReporter ( ) . invalidOperator ( this , expressionType ) ; return null ; } if ( ( this . expression . constant ) != ( Constant . NotAConstant ) ) { this . constant = Constant . computeConstantOperation ( this . expression . constant , expressionTypeID , ( ( ( bits ) & ( ASTNode . OperatorMASK ) ) > > ( ASTNode . OperatorSHIFT ) ) ) ; } else { this . constant = Constant . NotAConstant ; if ( ( ( ( bits ) & ( ASTNode . OperatorMASK ) ) > > ( ASTNode . OperatorSHIFT ) ) == ( OperatorIds . NOT ) ) { Constant cst = expression . optimizedBooleanConstant ( ) ; if ( cst != ( Constant . NotAConstant ) ) <START_BUG> this . optimizedBooleanConstant = Constant . fromValue ( ( ! ( cst . booleanValue ( ) ) ) ) ; <END_BUG> } } if ( expressionIsCast ) { CastExpression . checkNeedForArgumentCast ( scope , tableId , operatorSignature , this . expression , expressionTypeID ) ; } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
this . optimizedBooleanConstant = BooleanConstant . fromValue ( ( ! ( cst . booleanValue ( ) ) ) ) ;