Buggy code:
public class CodeSnippetMessageSend extends MessageSend { EvaluationContext evaluationContext ; FieldBinding delegateThis ; public CodeSnippetMessageSend ( EvaluationContext evaluationContext ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; MethodBinding codegenBinding = this . binding . original ( ) ; if ( codegenBinding . canBeSeenBy ( this . actualReceiverType , this , currentScope ) ) { boolean isStatic = codegenBinding . isStatic ( ) ; if ( ( ! isStatic ) && ( ( ( this . bits ) & ( ASTNode . DepthMASK ) ) != 0 ) ) { ReferenceBinding targetType = currentScope . enclosingSourceType ( ) . enclosingTypeAt ( ( ( ( this . bits ) & ( ASTNode . DepthMASK ) ) > > ( ASTNode . DepthSHIFT ) ) ) ; Object [ ] path = currentScope . getEmulationPath ( targetType , true , false ) ; if ( path == null ) { currentScope . problemReporter ( ) . needImplementation ( this ) ; } else { codeStream . generateOuterAccess ( path , this , targetType , currentScope ) ; } } else { this . receiver . generateCode ( currentScope , codeStream , ( ! isStatic ) ) ; if ( ( this . receiverGenericCast ) != null ) codeStream . checkcast ( this . receiverGenericCast ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } generateArguments ( this . binding , this . arguments , currentScope , codeStream ) ; <START_BUG> TypeBinding constantPoolDeclaringClass = getConstantPoolDeclaringClass ( currentScope ) ; <END_BUG> if ( isStatic ) { codeStream . invoke ( Opcodes . OPC_invokestatic , codegenBinding , constantPoolDeclaringClass ) ; } else if ( ( this . receiver . isSuper ( ) ) || ( codegenBinding . isPrivate ( ) ) ) { codeStream . invoke ( Opcodes . OPC_invokespecial , codegenBinding , constantPoolDeclaringClass ) ; } else { if ( constantPoolDeclaringClass . isInterface ( ) ) { codeStream . invoke ( Opcodes . OPC_invokeinterface , codegenBinding , constantPoolDeclaringClass ) ; } else { codeStream . invoke ( Opcodes . OPC_invokevirtual , codegenBinding , constantPoolDeclaringClass ) ; } } } else { codeStream . generateEmulationForMethod ( currentScope , codegenBinding ) ; boolean isStatic = codegenBinding . isStatic ( ) ; if ( ( ! isStatic ) && ( ( ( this . bits ) & ( ASTNode . DepthMASK ) ) != 0 ) ) { currentScope . problemReporter ( ) . needImplementation ( this ) ; } else { this . receiver . generateCode ( currentScope , codeStream , ( ! isStatic ) ) ; if ( ( this . receiverGenericCast ) != null ) codeStream . checkcast ( this . receiverGenericCast ) ; codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } if ( isStatic ) { codeStream . aconst_null ( ) ; } if ( ( this . arguments ) != null ) { int argsLength = this . arguments . length ; codeStream . generateInlinedValue ( argsLength ) ; codeStream . newArray ( currentScope . createArrayType ( currentScope . getType ( TypeConstants . JAVA_LANG_OBJECT , 3 ) , 1 ) ) ; codeStream . dup ( ) ; for ( int i = 0 ; i < argsLength ; i ++ ) { codeStream . generateInlinedValue ( i ) ; this . arguments [ i ] . generateCode ( currentScope , codeStream , true ) ; TypeBinding parameterBinding = codegenBinding . parameters [ i ] ; if ( ( parameterBinding . isBaseType ( ) ) && ( parameterBinding != ( TypeBinding . NULL ) ) ) { codeStream . generateBoxingConversion ( codegenBinding . parameters [ i ] . id ) ; } codeStream . aastore ( ) ; if ( i < ( argsLength - 1 ) ) { codeStream . dup ( ) ; } } } else { codeStream . generateInlinedValue ( 0 ) ; codeStream . newArray ( currentScope . createArrayType ( currentScope . getType ( TypeConstants . JAVA_LANG_OBJECT , 3 ) , 1 ) ) ; } codeStream . invokeJavaLangReflectMethodInvoke ( ) ; if ( codegenBinding . returnType . isBaseType ( ) ) { int typeID = codegenBinding . returnType . id ; if ( typeID == ( TypeIds . T_void ) ) { codeStream . pop ( ) ; } codeStream . checkcast ( typeID ) ; codeStream . getBaseTypeValue ( typeID ) ; } else { codeStream . checkcast ( codegenBinding . returnType ) ; } } if ( ( this . valueCast ) != null ) codeStream . checkcast ( this . valueCast ) ; if ( valueRequired ) { codeStream . generateImplicitConversion ( this . implicitConversion ) ; } else { boolean isUnboxing = ( ( this . implicitConversion ) & ( TypeIds . UNBOXING ) ) != 0 ; if ( isUnboxing ) codeStream . generateImplicitConversion ( this . implicitConversion ) ; switch ( isUnboxing ? postConversionType ( currentScope ) . id : codegenBinding . returnType . id ) { case TypeIds . T_long : case TypeIds . T_double : codeStream . pop2 ( ) ; break ; case TypeIds . T_void : break ; default : codeStream . pop ( ) ; } } codeStream . recordPositionsFrom ( pc , ( ( int ) ( ( this . nameSourcePosition ) > > > 32 ) ) ) ; } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public TypeBinding resolveType ( BlockScope scope ) { } }

Fix:
TypeBinding constantPoolDeclaringClass = CodeStream . getConstantPoolDeclaringClass ( currentScope , codegenBinding , this . actualReceiverType , this . receiver . isImplicitThis ( ) , ( ( this . receiverGenericCast ) != null ) ) ;