Buggy code:
public class StatsTask implements Runnable { private String clazzName ; private String methodName ; public StatsTask ( String clazzName , String methodName ) { } @ Override public void run ( ) { } private MethodStatistics calculate ( Method method ) throws CalculationException { ClassFileLocation location = null ; ClassParser parser ; JavaClass clazz ; try { location = getLocation ( clazzName ) ; if ( location . isZip ( ) ) { parser = new ClassParser ( location . getZipName ( ) , location . getFileName ( ) ) ; } else { parser = new ClassParser ( location . getFileName ( ) ) ; } clazz = parser . parse ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } org . apache . bcel . classfile . Method bcelMethod = clazz . getMethod ( method ) ; if ( bcelMethod == null ) { throw new CalculationException ( "Bcel<seq2seq4repair_space>method<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>obtained" ) ; } Code methodCode = bcelMethod . getCode ( ) ; int methodLength = methodCode . getLength ( ) ; ConstantPoolGen cpg = new ConstantPoolGen ( clazz . getConstantPool ( ) ) ; MethodGen mg = new MethodGen ( bcelMethod , clazz . getClassName ( ) , cpg ) ; InstructionList instructionList = mg . getInstructionList ( ) ; Iterator insIt = instructionList . iterator ( ) ; int localVariableTableSize = mg . getLocalVariables ( ) . length ; int invokeCount = 0 ; int newOpCount = 0 ; int throwOpCount = 0 ; int directIOCount = 0 ; int fieldAccessCount = 0 ; int branchCount = 0 ; int loopCount = 0 ; while ( insIt . hasNext ( ) ) { InstructionHandle insHandle = ( ( InstructionHandle ) ( insIt . next ( ) ) ) ; Instruction instruction = insHandle . getInstruction ( ) ; if ( instruction instanceof InvokeInstruction ) { invokeCount ++ ; InvokeInstruction ii = ( ( InvokeInstruction ) ( instruction ) ) ; ReferenceType referenceType = ii . getReferenceType ( cpg ) ; String callee = ii . getName ( cpg ) ; String calleeFullName = ( referenceType + "." ) + callee ; if ( ( ( ( calleeFullName . equals ( "java.io.FileInputStream.read" ) ) || ( calleeFullName . equals ( "java.io.OutputStream.write" ) ) ) || ( calleeFullName . equals ( "java.net.SocketInputStream.read" ) ) ) || ( calleeFullName . equals ( "java.net.SocketOutputStream.write" ) ) ) { directIOCount ++ ; } } else if ( instruction instanceof NEW ) { newOpCount ++ ; } else if ( instruction instanceof ATHROW ) { throwOpCount ++ ; } else if ( instruction instanceof FieldInstruction ) { fieldAccessCount ++ ; } else if ( instruction instanceof BranchInstruction ) { BranchInstruction bi = ( ( BranchInstruction ) ( instruction ) ) ; int targetPos = bi . getTarget ( ) . getPosition ( ) ; int currentPos = insHandle . getPosition ( ) ; if ( targetPos < currentPos ) { loopCount ++ ; } else { branchCount ++ ; } } } <START_BUG> MethodStatistics stats = new MethodStatistics ( methodName ) ; <END_BUG> stats . put ( "localVariableTableSize" , Double . valueOf ( localVariableTableSize ) ) ; stats . put ( "invokeCount" , Double . valueOf ( invokeCount ) ) ; stats . put ( "newOpCount" , Double . valueOf ( newOpCount ) ) ; stats . put ( "throwOpCount" , Double . valueOf ( throwOpCount ) ) ; stats . put ( "directIOCount" , Double . valueOf ( directIOCount ) ) ; stats . put ( "fieldAccessCount" , Double . valueOf ( fieldAccessCount ) ) ; stats . put ( "branchCount" , Double . valueOf ( branchCount ) ) ; stats . put ( "loopCount" , Double . valueOf ( loopCount ) ) ; stats . put ( "methodLength" , Double . valueOf ( methodLength ) ) ; return stats ; } private Method getReflectedMethod ( String clazzName , String methodName ) throws ClassNotFoundException , NoSuchMethodException { } private ClassFileLocation getLocation ( String clazzName ) { } }

Fix:
MethodStatistics stats = new MethodStatistics ( ( ( ( clazzName ) + "." ) + ( methodName ) ) ) ;