Buggy code:
public static BcelShadow makeStaticInitialization ( BcelWorld world , LazyMethodGen enclosingMethod ) { } public static BcelShadow makeExceptionHandler ( BcelWorld world , ExceptionRange exceptionRange , LazyMethodGen enclosingMethod , InstructionHandle startOfHandler , BcelShadow enclosingShadow ) { } public static BcelShadow makeIfaceInitialization ( BcelWorld world , LazyMethodGen constructor , BcelShadow ifaceCExecShadow , Member interfaceConstructorSignature ) { } public static BcelShadow makeIfaceConstructorExecution ( BcelWorld world , LazyMethodGen constructor , InstructionHandle next , Member interfaceConstructorSignature ) { } public static BcelShadow makeUnfinishedInitialization ( BcelWorld world , LazyMethodGen constructor ) { } public static BcelShadow makeUnfinishedPreinitialization ( BcelWorld world , LazyMethodGen constructor ) { } public static BcelShadow makeMethodExecution ( BcelWorld world , LazyMethodGen enclosingMethod ) { } public static BcelShadow makeShadowForMethod ( BcelWorld world , LazyMethodGen enclosingMethod , Shadow . Kind kind , Member sig ) { } public static BcelShadow makeAdviceExecution ( BcelWorld world , LazyMethodGen enclosingMethod ) { } public static BcelShadow makeConstructorCall ( BcelWorld world , LazyMethodGen enclosingMethod , InstructionHandle callHandle , BcelShadow enclosingShadow ) { } public static BcelShadow makeMethodCall ( BcelWorld world , LazyMethodGen enclosingMethod , InstructionHandle callHandle , BcelShadow enclosingShadow ) { } public static BcelShadow makeShadowForMethodCall ( BcelWorld world , LazyMethodGen enclosingMethod , InstructionHandle callHandle , BcelShadow enclosingShadow , Kind kind , ResolvedMember sig ) { } public static BcelShadow makeFieldGet ( BcelWorld world , LazyMethodGen enclosingMethod , InstructionHandle getHandle , BcelShadow enclosingShadow ) { } public static BcelShadow makeFieldSet ( BcelWorld world , LazyMethodGen enclosingMethod , InstructionHandle setHandle , BcelShadow enclosingShadow ) { } public static void retargetAllBranches ( InstructionHandle from , InstructionHandle to ) { } public boolean terminatesWithReturn ( ) { } public boolean arg0HoldsThis ( ) { } private BcelVar thisVar = null ; private BcelVar targetVar = null ; private BcelVar [ ] argVars = null ; public Var getThisVar ( ) { } public Var getTargetVar ( ) { } public Var getArgVar ( int i ) { } private BcelVar thisJoinPointVar = null ; private BcelVar thisJoinPointStaticPartVar = null ; public final Var getThisJoinPointVar ( ) { } public final Var getThisJoinPointStaticPartVar ( ) { } public final Var getThisEnclosingJoinPointStaticPartVar ( ) { } public BcelVar getThisJoinPointBcelVar ( ) { } public BcelVar getThisJoinPointStaticPartBcelVar ( ) { } public BcelVar getThisEnclosingJoinPointStaticPartBcelVar ( ) { } public Member getEnclosingCodeSignature ( ) { } private InstructionList makeArgsObjectArray ( ) { } private void initializeThisVar ( ) { } public void initializeTargetVar ( ) { } public void initializeArgVars ( ) { } public void initializeForAroundClosure ( ) { } void weaveBefore ( BcelAdvice munger ) { } public void weaveAfter ( BcelAdvice munger ) { } public void weaveAfterReturning ( BcelAdvice munger ) { } public void weaveAfterThrowing ( BcelAdvice munger , TypeX catchType ) { } public void weaveSoftener ( BcelAdvice munger , TypeX catchType ) { } public void weavePerObjectEntry ( final BcelAdvice munger , final BcelVar onVar ) { } public void weaveCflowEntry ( final BcelAdvice munger , final Member cflowStackField ) { } public void weaveAroundInline ( BcelAdvice munger , boolean hasDynamicTest ) { } private InstructionList getRedoneProceedCall ( InstructionFactory fact , LazyMethodGen callbackMethod , BcelAdvice munger , LazyMethodGen localAdviceMethod , List argVarList ) { } public void weaveAroundClosure ( BcelAdvice munger , boolean hasDynamicTest ) { InstructionFactory fact = getFactory ( ) ; enclosingMethod . setCanInline ( false ) ; LazyMethodGen callbackMethod = extractMethod ( NameMangler . aroundCallbackMethodName ( getSignature ( ) , getEnclosingClass ( ) ) ) ; BcelVar [ ] adviceVars = munger . getExposedStateAsBcelVars ( ) ; String closureClassName = NameMangler . makeClosureClassName ( getEnclosingClass ( ) . getType ( ) , getEnclosingClass ( ) . getNewGeneratedNameTag ( ) ) ; Member constructorSig = new Member ( Member . CONSTRUCTOR , TypeX . forName ( closureClassName ) , 0 , "<init>" , "([Ljava//lang//Object;)V" ) ; BcelVar closureHolder = null ; if ( ( getKind ( ) ) == ( PreInitialization ) ) { closureHolder = genTempVar ( AROUND_CLOSURE_TYPE ) ; } InstructionList closureInstantiation = makeClosureInstantiation ( constructorSig , closureHolder ) ; <START_BUG> LazyMethodGen constructor = makeClosureClassAndReturnConstructor ( closureClassName , callbackMethod , makeProceedArgumentMap ( adviceVars ) ) ; <END_BUG> InstructionList returnConversionCode ; if ( ( getKind ( ) ) == ( PreInitialization ) ) { returnConversionCode = new InstructionList ( ) ; BcelVar stateTempVar = genTempVar ( OBJECTARRAY ) ; closureHolder . appendLoad ( returnConversionCode , fact ) ; returnConversionCode . append ( Utility . createInvoke ( fact , world , AjcMemberMaker . aroundClosurePreInitializationGetter ( ) ) ) ; stateTempVar . appendStore ( returnConversionCode , fact ) ; Type [ ] stateTypes = getSuperConstructorParameterTypes ( ) ; returnConversionCode . append ( ALOAD_0 ) ; for ( int i = 0 , len = stateTypes . length ; i < len ; i ++ ) { stateTempVar . appendConvertableArrayLoad ( returnConversionCode , fact , i , world . resolve ( BcelWorld . fromBcel ( stateTypes [ i ] ) ) ) ; } } else { returnConversionCode = Utility . createConversion ( getFactory ( ) , BcelWorld . makeBcelType ( munger . getSignature ( ) . getReturnType ( ) ) , callbackMethod . getReturnType ( ) ) ; if ( ! ( isFallsThrough ( ) ) ) { returnConversionCode . append ( InstructionFactory . createReturn ( callbackMethod . getReturnType ( ) ) ) ; } } InstructionList advice = new InstructionList ( ) ; advice . append ( munger . getAdviceArgSetup ( this , null , closureInstantiation ) ) ; advice . append ( munger . getNonTestAdviceInstructions ( this ) ) ; advice . append ( returnConversionCode ) ; if ( ! hasDynamicTest ) { range . append ( advice ) ; } else { InstructionList callback = makeCallToCallback ( callbackMethod ) ; InstructionList postCallback = new InstructionList ( ) ; if ( terminatesWithReturn ( ) ) { callback . append ( InstructionFactory . createReturn ( callbackMethod . getReturnType ( ) ) ) ; } else { advice . append ( InstructionFactory . createBranchInstruction ( GOTO , postCallback . append ( NOP ) ) ) ;

Fix:
makeClosureClassAndReturnConstructor ( closureClassName , callbackMethod , makeProceedArgumentMap ( adviceVars ) ) ;