Buggy code:
public class SingleNameReference extends NameReference implements OperatorIds { public char [ ] token ; public MethodBinding [ ] syntheticAccessors ; public static final int READ = 0 ; public static final int WRITE = 1 ; public TypeBinding genericCast ; public SingleNameReference ( char [ ] source , long pos ) { } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } public TypeBinding checkFieldAccess ( BlockScope scope ) { } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( ( constant ) != ( Constant . NotAConstant ) ) { if ( valueRequired ) { codeStream . generateConstant ( constant , implicitConversion ) ; } } else { switch ( ( bits ) & ( ASTNode . RestrictiveFlagMASK ) ) { case Binding . FIELD : FieldBinding fieldBinding = ( ( FieldBinding ) ( this . codegenBinding ) ) ; Constant fieldConstant = fieldBinding . constant ( ) ; if ( fieldConstant != ( Constant . NotAConstant ) ) { if ( valueRequired ) { codeStream . generateConstant ( fieldConstant , implicitConversion ) ; } } else { <START_BUG> if ( valueRequired || ( ( currentScope . compilerOptions ( ) . complianceLevel ) >= ( ClassFileConstants . JDK1_4 ) ) ) { <END_BUG> boolean isStatic = fieldBinding . isStatic ( ) ; if ( ! isStatic ) { if ( ( ( bits ) & ( ASTNode . DepthMASK ) ) != 0 ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( ( ( bits ) & ( ASTNode . DepthMASK ) ) > > ( ASTNode . DepthSHIFT ) ) ) ; Object [ ] emulationPath = currentScope . getEmulationPath ( targetType , true , false ) ; codeStream . generateOuterAccess ( emulationPath , this , targetType , currentScope ) ; } else { generateReceiver ( codeStream ) ; } } if ( ( ( syntheticAccessors ) == null ) || ( ( syntheticAccessors [ SingleNameReference . READ ] ) == null ) ) { if ( isStatic ) { codeStream . getstatic ( fieldBinding ) ; } else { codeStream . getfield ( fieldBinding ) ; } } else { codeStream . invokestatic ( syntheticAccessors [ SingleNameReference . READ ] ) ; } if ( valueRequired ) { if ( ( this . genericCast ) != null ) codeStream . checkcast ( this . genericCast ) ; codeStream . generateImplicitConversion ( implicitConversion ) ; } else { switch ( fieldBinding . type . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . pop2 ( ) ; break ; default : codeStream . pop ( ) ; } } } } break ; case Binding . LOCAL : LocalVariableBinding localBinding = ( ( LocalVariableBinding ) ( this . codegenBinding ) ) ; if ( valueRequired ) { if ( ( ( bits ) & ( ASTNode . DepthMASK ) ) != 0 ) { VariableBinding [ ] path = currentScope . getEmulationPath ( localBinding ) ; codeStream . generateOuterAccess ( path , this , localBinding , currentScope ) ; } else { codeStream . load ( localBinding ) ; } codeStream . generateImplicitConversion ( implicitConversion ) ; } } } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , MethodBinding writeAccessor , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public void generateReceiver ( CodeStream codeStream ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo , boolean isReadAccess ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding reportError ( BlockScope scope ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public String unboundReferenceErrorName ( ) { } public LocalVariableBinding localVariableBinding ( ) { } }

Fix:
if ( valueRequired ) {