Program: 29985
Project: 29985
Buggy source:
public static byte[] generateBtraceClientClassData(int clientID,Collection<FlashlightProbe> probes){
  String generatedClassName="String_Node_Str" + clientID;
  int cwFlags=ClassWriter.COMPUTE_FRAMES + ClassWriter.COMPUTE_MAXS;
  ClassWriter cw=new ClassWriter(cwFlags);
  int access=Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL;
  cw.visit(Opcodes.V1_5,access,generatedClassName,null,"String_Node_Str",null);
  cw.visitAnnotation("String_Node_Str",true);
  int methodCounter=0;
  for (  FlashlightProbe probe : probes) {
    String typeDesc="String_Node_Str";
    StringBuilder methodDesc=new StringBuilder("String_Node_Str");
    methodDesc.append(probe.getProviderJavaMethodName()).append("String_Node_Str");
    methodDesc.append(clientID).append("String_Node_Str").append(methodCounter).append("String_Node_Str");
    methodDesc.append("String_Node_Str");
    typeDesc+="String_Node_Str";
    String delim="String_Node_Str";
    String typeDelim="String_Node_Str";
    Class[] paramTypes=probe.getParamTypes();
    for (int index=0; index < paramTypes.length; index++) {
      Class paramType=paramTypes[index];
      methodDesc.append(delim).append(paramType.getName());
      if (!(probe.hasSelf() && (index == 0))) {
        typeDesc+=typeDelim + paramType.getName();
        typeDelim="String_Node_Str";
      }
      delim="String_Node_Str";
    }
    methodDesc.append("String_Node_Str");
    typeDesc+="String_Node_Str";
    Method m=Method.getMethod(methodDesc.toString());
    GeneratorAdapter gen=new GeneratorAdapter(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC,m,null,null,cw);
    if (probe.hasSelf()) {
      String[] paramNames=probe.getProbeParamNames();
      for (int index=0; index < paramNames.length; index++) {
        if (paramNames[index].equalsIgnoreCase(FlashlightProbe.SELF)) {
          AnnotationVisitor paramVisitor=gen.visitParameterAnnotation(index,"String_Node_Str",true);
          paramVisitor.visitEnd();
        }
      }
    }
    AnnotationVisitor av=gen.visitAnnotation("String_Node_Str",true);
    av.visit("String_Node_Str","String_Node_Str" + probe.getProviderClazz().getName());
    av.visit("String_Node_Str",probe.getProviderJavaMethodName());
    av.visit("String_Node_Str",typeDesc);
    av.visitEnd();
    gen.push(probe.getId());
    gen.loadArgArray();
    gen.invokeStatic(Type.getType(ProbeRegistry.class),Method.getMethod("String_Node_Str"));
    gen.returnValue();
    gen.endMethod();
    methodCounter++;
  }
  BtraceClientGenerator.generateConstructor(cw);
  cw.visitEnd();
  byte[] classData=cw.toByteArray();
  writeClass(classData,generatedClassName);
  return classData;
}

Fixed version (ground truth):
public static byte[] generateBtraceClientClassData(int clientID,Collection<FlashlightProbe> probes){
  String generatedClassName="String_Node_Str" + clientID;
  int cwFlags=ClassWriter.COMPUTE_FRAMES + ClassWriter.COMPUTE_MAXS;
  ClassWriter cw=new ClassWriter(cwFlags);
  int access=Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL;
  cw.visit(Opcodes.V1_5,access,generatedClassName,null,"String_Node_Str",null);
  cw.visitAnnotation("String_Node_Str",true);
  int methodCounter=0;
  for (  FlashlightProbe probe : probes) {
    StringBuilder typeDesc=new StringBuilder("String_Node_Str");
    StringBuilder methodDesc=new StringBuilder("String_Node_Str");
    methodDesc.append(probe.getProviderJavaMethodName()).append("String_Node_Str");
    methodDesc.append(clientID).append("String_Node_Str").append(methodCounter).append("String_Node_Str");
    methodDesc.append("String_Node_Str");
    typeDesc.append("String_Node_Str");
    String delim="String_Node_Str";
    String typeDelim="String_Node_Str";
    Class[] paramTypes=probe.getParamTypes();
    for (int index=0; index < paramTypes.length; index++) {
      Class paramType=paramTypes[index];
      methodDesc.append(delim).append(paramType.getName());
      if (!(probe.hasSelf() && (index == 0))) {
        typeDesc.append(typeDelim).append(paramType.getName());
        typeDelim="String_Node_Str";
      }
      delim="String_Node_Str";
    }
    methodDesc.append("String_Node_Str");
    typeDesc.append("String_Node_Str");
    Method m=Method.getMethod(methodDesc.toString());
    GeneratorAdapter gen=new GeneratorAdapter(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC,m,null,null,cw);
    if (probe.hasSelf()) {
      String[] paramNames=probe.getProbeParamNames();
      for (int index=0; index < paramNames.length; index++) {
        if (paramNames[index].equalsIgnoreCase(FlashlightProbe.SELF)) {
          AnnotationVisitor paramVisitor=gen.visitParameterAnnotation(index,"String_Node_Str",true);
          paramVisitor.visitEnd();
        }
      }
    }
    AnnotationVisitor av=gen.visitAnnotation("String_Node_Str",true);
    av.visit("String_Node_Str","String_Node_Str" + probe.getProviderClazz().getName());
    av.visit("String_Node_Str",probe.getProviderJavaMethodName());
    av.visit("String_Node_Str",typeDesc.toString());
    av.visitEnd();
    gen.push(probe.getId());
    gen.loadArgArray();
    gen.invokeStatic(Type.getType(ProbeRegistry.class),Method.getMethod("String_Node_Str"));
    gen.returnValue();
    gen.endMethod();
    methodCounter++;
  }
  BtraceClientGenerator.generateConstructor(cw);
  cw.visitEnd();
  byte[] classData=cw.toByteArray();
  writeClass(classData,generatedClassName);
  return classData;
}