nus-yam/ex-repair huggingface dataset:
Program: 40910
Project: 40910
Buggy source:
public void testSlice2() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  WarningSet warnings=new WarningSet();
  ClassHierarchy cha=ClassHierarchy.make(scope,warnings);
  Entrypoints entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE2_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,cha,scope,warnings);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  dumpSlice(slice);
  assertEquals(22,slice.size());
}

Fixed version (ground truth):
public void testSlice2() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  WarningSet warnings=new WarningSet();
  ClassHierarchy cha=ClassHierarchy.make(scope,warnings);
  Entrypoints entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE2_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,cha,scope,warnings);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  dumpSlice(slice);
  assertEquals(30,slice.size());
}
Program: 40911
Project: 40911
Buggy source:
public void testSlice1() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  WarningSet warnings=new WarningSet();
  ClassHierarchy cha=ClassHierarchy.make(scope,warnings);
  Entrypoints entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE1_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,cha,scope,warnings);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMainMethod(cg);
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  dumpSlice(slice);
  assertEquals(18,slice.size());
}

Fixed version (ground truth):
public void testSlice1() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  WarningSet warnings=new WarningSet();
  ClassHierarchy cha=ClassHierarchy.make(scope,warnings);
  Entrypoints entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE1_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,cha,scope,warnings);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMainMethod(cg);
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  dumpSlice(slice);
  assertEquals(26,slice.size());
}
Program: 40912
Project: 40912
Buggy source:
public static void main(String[] args) throws Exception {
  String in=args[0];
  String out=args[1];
  String[] match=new String[args.length - 2];
  System.arraycopy(args,2,match,0,match.length);
  JarFile inJar=new JarFile(in);
  JarOutputStream outJar=new JarOutputStream(new FileOutputStream(out));
  JarFile[] matches=new JarFile[match.length];
  for (int i=0; i < match.length; i++) {
    matches[i]=new JarFile(match[i]);
  }
  for (Enumeration e=inJar.entries(); e.hasMoreElements(); ) {
    JarEntry entry=(JarEntry)e.nextElement();
    if (matchEntry(matches,entry)) {
      outJar.putNextEntry(entry);
      byte[] data=new byte[(int)entry.getSize()];
      InputStream stream=inJar.getInputStream(entry);
      readFully(stream,data);
      outJar.write(data);
      outJar.flush();
    }
  }
  outJar.close();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception, IllegalArgumentException {
  if (args.length < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String in=args[0];
  String out=args[1];
  String[] match=new String[args.length - 2];
  System.arraycopy(args,2,match,0,match.length);
  JarFile inJar=new JarFile(in);
  JarOutputStream outJar=new JarOutputStream(new FileOutputStream(out));
  JarFile[] matches=new JarFile[match.length];
  for (int i=0; i < match.length; i++) {
    matches[i]=new JarFile(match[i]);
  }
  for (Enumeration e=inJar.entries(); e.hasMoreElements(); ) {
    JarEntry entry=(JarEntry)e.nextElement();
    if (matchEntry(matches,entry)) {
      outJar.putNextEntry(entry);
      byte[] data=new byte[(int)entry.getSize()];
      InputStream stream=inJar.getInputStream(entry);
      readFully(stream,data);
      outJar.write(data);
      outJar.flush();
    }
  }
  outJar.close();
}
Program: 40913
Project: 40913
Buggy source:
public static ArrayStoreInstruction make(String type){
  int i=Util.getTypeIndex(type);
  if (i < 0 || i > TYPE_boolean_index) {
    throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str");
  }
  return preallocated[i];
}

Fixed version (ground truth):
public static ArrayStoreInstruction make(String type) throws IllegalArgumentException {
  int i=Util.getTypeIndex(type);
  if (i < 0 || i > TYPE_boolean_index) {
    throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str");
  }
  return preallocated[i];
}
Program: 40914
Project: 40914
Buggy source:
public static ConversionInstruction make(String fromType,String toType){
  int from=Util.getTypeIndex(fromType);
  int to=Util.getTypeIndex(toType);
  if (from < 0 || from > TYPE_double_index) {
    throw new IllegalArgumentException("String_Node_Str" + fromType);
  }
  if (from == TYPE_int_index && (to >= TYPE_byte_index && to <= TYPE_short_index)) {
    return preallocated[(OP_i2b - OP_i2l) + (to - TYPE_byte_index)];
  }
 else {
    if (to < 0 || to > TYPE_double_index) {
      throw new IllegalArgumentException("String_Node_Str" + fromType + "String_Node_Str"+ toType);
    }
    if (to == from) {
      throw new IllegalArgumentException("String_Node_Str" + fromType + "String_Node_Str");
    }
    return preallocated[from * 3 + (to > from ? to - 1 : to)];
  }
}

Fixed version (ground truth):
public static ConversionInstruction make(String fromType,String toType) throws IllegalArgumentException {
  int from=Util.getTypeIndex(fromType);
  int to=Util.getTypeIndex(toType);
  if (from < 0 || from > TYPE_double_index) {
    throw new IllegalArgumentException("String_Node_Str" + fromType);
  }
  if (from == TYPE_int_index && (to >= TYPE_byte_index && to <= TYPE_short_index)) {
    return preallocated[(OP_i2b - OP_i2l) + (to - TYPE_byte_index)];
  }
 else {
    if (to < 0 || to > TYPE_double_index) {
      throw new IllegalArgumentException("String_Node_Str" + fromType + "String_Node_Str"+ toType);
    }
    if (to == from) {
      throw new IllegalArgumentException("String_Node_Str" + fromType + "String_Node_Str");
    }
    return preallocated[from * 3 + (to > from ? to - 1 : to)];
  }
}
Program: 40915
Project: 40915
Buggy source:
public static LoadInstruction make(String type,int index){
  int t=Util.getTypeIndex(type);
  if (t < 0 || t > TYPE_Object_index) {
    throw new IllegalArgumentException("String_Node_Str" + type);
  }
  if (index < 16) {
    return preallocated[t * 16 + index];
  }
 else {
    return new LoadInstruction((short)(OP_iload + t),index);
  }
}

Fixed version (ground truth):
public static LoadInstruction make(String type,int index) throws IllegalArgumentException {
  int t=Util.getTypeIndex(type);
  if (t < 0 || t > TYPE_Object_index) {
    throw new IllegalArgumentException("String_Node_Str" + type);
  }
  if (index < 16) {
    return preallocated[t * 16 + index];
  }
 else {
    return new LoadInstruction((short)(OP_iload + t),index);
  }
}
Program: 40916
Project: 40916
Buggy source:
/** 
 * @param type the type of the object that will be returned (in JVM format, e.g., [Ljava/lang/String;)
 * @param arrayBoundsCount the number of array dimensions to preconstruct (equal to the number of integer parameters this instruction expects)
 */
public static NewInstruction make(String type,int arrayBoundsCount){
  if (arrayBoundsCount < 0 || arrayBoundsCount > 255) {
    throw new IllegalArgumentException("String_Node_Str" + arrayBoundsCount);
  }
 else {
    if (type.length() < arrayBoundsCount + 1) {
      throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str"+ arrayBoundsCount);
    }
    for (int i=0; i < arrayBoundsCount; i++) {
      if (type.charAt(i) != '[') {
        throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str"+ arrayBoundsCount);
      }
    }
    short opcode;
    if (arrayBoundsCount == 0) {
      opcode=OP_new;
    }
 else     if (arrayBoundsCount == 1) {
      char ch=type.charAt(1);
      if (ch != 'L' && ch != '[') {
        opcode=OP_newarray;
      }
 else {
        opcode=OP_anewarray;
      }
    }
 else {
      opcode=OP_multianewarray;
    }
    return new NewInstruction(opcode,type,(short)arrayBoundsCount);
  }
}

Fixed version (ground truth):
/** 
 * @param type the type of the object that will be returned (in JVM format, e.g., [Ljava/lang/String;)
 * @param arrayBoundsCount the number of array dimensions to preconstruct (equal to the number of integer parameters this instruction expects)
 */
public static NewInstruction make(String type,int arrayBoundsCount) throws IllegalArgumentException {
  if (arrayBoundsCount < 0 || arrayBoundsCount > 255) {
    throw new IllegalArgumentException("String_Node_Str" + arrayBoundsCount);
  }
 else {
    if (type.length() < arrayBoundsCount + 1) {
      throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str"+ arrayBoundsCount);
    }
    for (int i=0; i < arrayBoundsCount; i++) {
      if (type.charAt(i) != '[') {
        throw new IllegalArgumentException("String_Node_Str" + type + "String_Node_Str"+ arrayBoundsCount);
      }
    }
    short opcode;
    if (arrayBoundsCount == 0) {
      opcode=OP_new;
    }
 else     if (arrayBoundsCount == 1) {
      char ch=type.charAt(1);
      if (ch != 'L' && ch != '[') {
        opcode=OP_newarray;
      }
 else {
        opcode=OP_anewarray;
      }
    }
 else {
      opcode=OP_multianewarray;
    }
    return new NewInstruction(opcode,type,(short)arrayBoundsCount);
  }
}
Program: 40917
Project: 40917
Buggy source:
public static ReturnInstruction make(String type){
  if (type.equals(TYPE_void)) {
    return preallocatedVoid;
  }
 else {
    int t=Util.getTypeIndex(type);
    if (t < 0 || t > TYPE_Object_index) {
      throw new IllegalArgumentException("String_Node_Str" + type);
    }
    return preallocated[t];
  }
}

Fixed version (ground truth):
public static ReturnInstruction make(String type) throws IllegalArgumentException {
  if (type.equals(TYPE_void)) {
    return preallocatedVoid;
  }
 else {
    int t=Util.getTypeIndex(type);
    if (t < 0 || t > TYPE_Object_index) {
      throw new IllegalArgumentException("String_Node_Str" + type);
    }
    return preallocated[t];
  }
}
Program: 40918
Project: 40918
Buggy source:
public static StoreInstruction make(String type,int index){
  int t=Util.getTypeIndex(type);
  if (t < 0 || t > TYPE_Object_index) {
    throw new IllegalArgumentException("String_Node_Str" + type);
  }
  if (index < 16) {
    return preallocated[t * 16 + index];
  }
 else {
    return new StoreInstruction((short)(OP_istore + t),index);
  }
}

Fixed version (ground truth):
public static StoreInstruction make(String type,int index) throws IllegalArgumentException {
  int t=Util.getTypeIndex(type);
  if (t < 0 || t > TYPE_Object_index) {
    throw new IllegalArgumentException("String_Node_Str" + type);
  }
  if (index < 16) {
    return preallocated[t * 16 + index];
  }
 else {
    return new StoreInstruction((short)(OP_istore + t),index);
  }
}
Program: 40919
Project: 40919
Buggy source:
/** 
 * Convert a JVM type name back into a Java class name.
 */
public static String makeClass(String t){
  if (t.startsWith("String_Node_Str")) {
    return t;
  }
 else   if (!t.startsWith("String_Node_Str")) {
    throw new IllegalArgumentException(t + "String_Node_Str");
  }
 else {
    return t.substring(1,t.length() - 1).replace('/','.');
  }
}

Fixed version (ground truth):
/** 
 * Convert a JVM type name back into a Java class name.
 */
public static String makeClass(String t) throws IllegalArgumentException {
  if (t.startsWith("String_Node_Str")) {
    return t;
  }
 else   if (!t.startsWith("String_Node_Str")) {
    throw new IllegalArgumentException(t + "String_Node_Str");
  }
 else {
    return t.substring(1,t.length() - 1).replace('/','.');
  }
}
Program: 40920
Project: 40920
Buggy source:
/** 
 * Append some class information to the store.
 * @param cl the JVM type of the class being added (e.g., Ljava/lang/Object;)
 * @param isInterface true iff it's an interface
 * @param isFinal true iff it's final
 * @param superClass the JVM type of the superclass, or null if this is Object
 * @param superInterfaces the JVM types of its implemented interfaces
 */
public void setClassInfo(String cl,boolean isInterface,boolean isFinal,String superClass,String[] superInterfaces){
  if (superClass != null && superClass.equals(cl)) {
    throw new Error("String_Node_Str" + cl + "String_Node_Str");
  }
  contents.put(cl,new ClassInfo(isInterface,isFinal,superClass,superInterfaces));
}

Fixed version (ground truth):
/** 
 * Append some class information to the store.
 * @param cl the JVM type of the class being added (e.g., Ljava/lang/Object;)
 * @param isInterface true iff it's an interface
 * @param isFinal true iff it's final
 * @param superClass the JVM type of the superclass, or null if this is Object
 * @param superInterfaces the JVM types of its implemented interfaces
 */
public void setClassInfo(String cl,boolean isInterface,boolean isFinal,String superClass,String[] superInterfaces) throws IllegalArgumentException {
  if (superClass != null && superClass.equals(cl)) {
    throw new IllegalArgumentException("String_Node_Str" + cl + "String_Node_Str");
  }
  contents.put(cl,new ClassInfo(isInterface,isFinal,superClass,superInterfaces));
}
Program: 40921
Project: 40921
Buggy source:
/** 
 * Set the JAR Comment for the output JAR.
 */
final public void setJARComment(String comment) throws IOException {
  makeOutputJar();
  outputJar.setComment(comment);
}

Fixed version (ground truth):
/** 
 * Set the JAR Comment for the output JAR.
 */
final public void setJARComment(String comment) throws IOException, IllegalArgumentException {
  makeOutputJar();
  outputJar.setComment(comment);
}
Program: 40922
Project: 40922
Buggy source:
/** 
 * Set the 8 bytes at offset 'offset' in 'buf' to the double value in v.
 */
public static void setDouble(byte[] buf,int offset,double v){
  setLong(buf,offset,Double.doubleToRawLongBits(v));
}

Fixed version (ground truth):
/** 
 * Set the 8 bytes at offset 'offset' in 'buf' to the double value in v.
 */
public static void setDouble(byte[] buf,int offset,double v) throws IllegalArgumentException {
  setLong(buf,offset,Double.doubleToRawLongBits(v));
}
Program: 40923
Project: 40923
Buggy source:
/** 
 * Set the 4 bytes at offset 'offset' in 'buf' to the signed 32-bit value in v.
 */
public static void setInt(byte[] buf,int offset,int v){
  buf[offset]=(byte)(v >> 24);
  buf[offset + 1]=(byte)(v >> 16);
  buf[offset + 2]=(byte)(v >> 8);
  buf[offset + 3]=(byte)v;
}

Fixed version (ground truth):
/** 
 * Set the 4 bytes at offset 'offset' in 'buf' to the signed 32-bit value in v.
 */
public static void setInt(byte[] buf,int offset,int v) throws IllegalArgumentException {
  if (offset >= buf.length) {
    throw new IllegalArgumentException("String_Node_Str" + offset);
  }
  buf[offset]=(byte)(v >> 24);
  buf[offset + 1]=(byte)(v >> 16);
  buf[offset + 2]=(byte)(v >> 8);
  buf[offset + 3]=(byte)v;
}
Program: 40924
Project: 40924
Buggy source:
/** 
 * Set the 8 bytes at offset 'offset' in 'buf' to the signed 64-bit value in v.
 */
public static void setLong(byte[] buf,int offset,long v){
  setInt(buf,offset,(int)(v >> 32));
  setInt(buf,offset + 4,(int)v);
}

Fixed version (ground truth):
/** 
 * Set the 8 bytes at offset 'offset' in 'buf' to the signed 64-bit value in v.
 */
public static void setLong(byte[] buf,int offset,long v) throws IllegalArgumentException {
  setInt(buf,offset,(int)(v >> 32));
  setInt(buf,offset + 4,(int)v);
}
Program: 40925
Project: 40925
Buggy source:
/** 
 * Set the 2 bytes at offset 'offset' in 'buf' to the unsigned 16-bit value in v.
 */
public static void setUShort(byte[] buf,int offset,int v){
  if (offset + 1 >= buf.length) {
    throw new IllegalArgumentException("String_Node_Str" + buf.length + "String_Node_Str"+ offset);
  }
  buf[offset]=(byte)(v >> 8);
  buf[offset + 1]=(byte)v;
}

Fixed version (ground truth):
/** 
 * Set the 2 bytes at offset 'offset' in 'buf' to the unsigned 16-bit value in v.
 */
public static void setUShort(byte[] buf,int offset,int v) throws IllegalArgumentException {
  if (offset + 1 >= buf.length) {
    throw new IllegalArgumentException("String_Node_Str" + buf.length + "String_Node_Str"+ offset);
  }
  buf[offset]=(byte)(v >> 8);
  buf[offset + 1]=(byte)v;
}
Program: 40926
Project: 40926
Buggy source:
/** 
 * Set the constant pool index for the name of the class.
 */
public void setNameIndex(int c){
  if (c < 1 || c > 0xFFFF) {
    throw new IllegalArgumentException("String_Node_Str" + c);
  }
  thisClass=c;
}

Fixed version (ground truth):
/** 
 * Set the constant pool index for the name of the class.
 */
public void setNameIndex(int c) throws IllegalArgumentException {
  if (c < 1 || c > 0xFFFF) {
    throw new IllegalArgumentException("String_Node_Str" + c);
  }
  thisClass=c;
}
Program: 40927
Project: 40927
Buggy source:
/** 
 * Set the 4 bytes at offset 'offset' in 'buf' to the float value in v.
 */
public static void setFloat(byte[] buf,int offset,float v){
  setInt(buf,offset,Float.floatToIntBits(v));
}

Fixed version (ground truth):
/** 
 * Set the 4 bytes at offset 'offset' in 'buf' to the float value in v.
 */
public static void setFloat(byte[] buf,int offset,float v) throws IllegalArgumentException {
  setInt(buf,offset,Float.floatToIntBits(v));
}
Program: 40928
Project: 40928
Buggy source:
/** 
 * Set the byte at offset 'offset' in 'buf' to the unsigned 8-bit value in v.
 */
public static void setUByte(byte[] buf,int offset,int v){
  buf[offset]=(byte)v;
}

Fixed version (ground truth):
/** 
 * Set the byte at offset 'offset' in 'buf' to the unsigned 8-bit value in v.
 */
public static void setUByte(byte[] buf,int offset,int v) throws IllegalArgumentException {
  if (offset >= buf.length) {
    throw new IllegalArgumentException("String_Node_Str" + offset);
  }
  buf[offset]=(byte)v;
}
Program: 40930
Project: 40930
Buggy source:
public int getSize(){
  verify();
  int size=14 + code.length + 2+ (exnHandlers == null ? 0 : exnHandlers.length) * 2 + 2;
  if (attributes != null) {
    for (int i=0; i < attributes.length; i++) {
      size+=attributes[i].getSize();
    }
  }
  return size;
}

Fixed version (ground truth):
public int getSize() throws IllegalArgumentException {
  verify();
  int size=14 + code.length + 2+ (exnHandlers == null ? 0 : exnHandlers.length) * 2 + 2;
  if (attributes != null) {
    for (int i=0; i < attributes.length; i++) {
      size+=attributes[i].getSize();
    }
  }
  return size;
}
Program: 40931
Project: 40931
Buggy source:
public int copyInto(byte[] buf,int offset){
  verify();
  int start=offset;
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setUShort(buf,offset + 6,maxStack);
  ClassWriter.setUShort(buf,offset + 8,maxLocals);
  ClassWriter.setInt(buf,offset + 10,code.length);
  offset+=14;
  System.arraycopy(code,0,buf,offset,code.length);
  offset+=code.length;
  ClassWriter.setUShort(buf,offset,(exnHandlers == null ? 0 : exnHandlers.length) / 4);
  offset+=2;
  if (exnHandlers != null) {
    for (int i=0; i < exnHandlers.length; i++) {
      ClassWriter.setUShort(buf,offset,exnHandlers[i]);
      offset+=2;
    }
  }
  ClassWriter.setUShort(buf,offset,(attributes == null ? 0 : attributes.length));
  offset+=2;
  if (attributes != null) {
    for (int i=0; i < attributes.length; i++) {
      offset=attributes[i].copyInto(buf,offset);
    }
  }
  ClassWriter.setInt(buf,start + 2,offset - start - 6);
  return offset;
}

Fixed version (ground truth):
public int copyInto(byte[] buf,int offset) throws IllegalArgumentException {
  verify();
  int start=offset;
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setUShort(buf,offset + 6,maxStack);
  ClassWriter.setUShort(buf,offset + 8,maxLocals);
  ClassWriter.setInt(buf,offset + 10,code.length);
  offset+=14;
  System.arraycopy(code,0,buf,offset,code.length);
  offset+=code.length;
  ClassWriter.setUShort(buf,offset,(exnHandlers == null ? 0 : exnHandlers.length) / 4);
  offset+=2;
  if (exnHandlers != null) {
    for (int i=0; i < exnHandlers.length; i++) {
      ClassWriter.setUShort(buf,offset,exnHandlers[i]);
      offset+=2;
    }
  }
  ClassWriter.setUShort(buf,offset,(attributes == null ? 0 : attributes.length));
  offset+=2;
  if (attributes != null) {
    for (int i=0; i < attributes.length; i++) {
      offset=attributes[i].copyInto(buf,offset);
    }
  }
  ClassWriter.setInt(buf,start + 2,offset - start - 6);
  return offset;
}
Program: 40932
Project: 40932
Buggy source:
public int copyInto(byte[] buf,int offset){
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,getSize() - 6);
  ClassWriter.setUShort(buf,offset + 6,table == null ? 0 : table.length);
  offset+=8;
  if (table != null) {
    for (int i=0; i < table.length; i++) {
      ClassWriter.setUShort(buf,offset,table[i]);
      offset+=2;
    }
  }
  return offset;
}

Fixed version (ground truth):
public int copyInto(byte[] buf,int offset) throws IllegalArgumentException {
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,getSize() - 6);
  ClassWriter.setUShort(buf,offset + 6,table == null ? 0 : table.length);
  offset+=8;
  if (table != null) {
    for (int i=0; i < table.length; i++) {
      ClassWriter.setUShort(buf,offset,table[i]);
      offset+=2;
    }
  }
  return offset;
}
Program: 40933
Project: 40933
Buggy source:
public int copyInto(byte[] buf,int offset){
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,2 + rawTable.length * 2);
  ClassWriter.setUShort(buf,offset + 6,rawTable.length / 2);
  offset+=8;
  for (int i=0; i < rawTable.length; i++) {
    ClassWriter.setUShort(buf,offset,rawTable[i]);
    offset+=2;
  }
  return offset;
}

Fixed version (ground truth):
public int copyInto(byte[] buf,int offset) throws IllegalArgumentException {
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,2 + rawTable.length * 2);
  ClassWriter.setUShort(buf,offset + 6,rawTable.length / 2);
  offset+=8;
  for (int i=0; i < rawTable.length; i++) {
    ClassWriter.setUShort(buf,offset,rawTable[i]);
    offset+=2;
  }
  return offset;
}
Program: 40934
Project: 40934
Buggy source:
public int copyInto(byte[] buf,int offset){
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,2 + rawTable.length * 2);
  ClassWriter.setUShort(buf,offset + 6,rawTable.length / 5);
  offset+=8;
  for (int i=0; i < rawTable.length; i++) {
    ClassWriter.setUShort(buf,offset,rawTable[i]);
    offset+=2;
  }
  return offset;
}

Fixed version (ground truth):
public int copyInto(byte[] buf,int offset) throws IllegalArgumentException {
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,2 + rawTable.length * 2);
  ClassWriter.setUShort(buf,offset + 6,rawTable.length / 5);
  offset+=8;
  for (int i=0; i < rawTable.length; i++) {
    ClassWriter.setUShort(buf,offset,rawTable[i]);
    offset+=2;
  }
  return offset;
}
Program: 40935
Project: 40935
Buggy source:
public int copyInto(byte[] buf,int offset){
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,getSize() - 6);
  offset+=6;
  if (table != null) {
    for (int i=0; i < table.length; i++) {
      ClassWriter.setUByte(buf,offset,table[i]);
      offset++;
    }
  }
  return offset;
}

Fixed version (ground truth):
public int copyInto(byte[] buf,int offset) throws IllegalArgumentException {
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,getSize() - 6);
  offset+=6;
  if (table != null) {
    for (int i=0; i < table.length; i++) {
      ClassWriter.setUByte(buf,offset,table[i]);
      offset++;
    }
  }
  return offset;
}
Program: 40936
Project: 40936
Buggy source:
public int getSize(){
  verify();
  return 8;
}

Fixed version (ground truth):
public int getSize() throws IllegalArgumentException {
  verify();
  return 8;
}
Program: 40937
Project: 40937
Buggy source:
/** 
 * Convert a JVM type name (either for a primitive or a class name) into a Java type name.
 */
public static String makeClassAll(String t){
  String alias=classAliases.get(t);
  if (alias != null) {
    return alias;
  }
 else {
    return makeClass(t);
  }
}

Fixed version (ground truth):
/** 
 * Convert a JVM type name (either for a primitive or a class name) into a Java type name.
 */
static String makeClassAll(String t){
  String alias=classAliases.get(t);
  if (alias != null) {
    return alias;
  }
 else {
    return makeClass(t);
  }
}
Program: 40938
Project: 40938
Buggy source:
/** 
 * Compute the total number of JVM "stack words" occupied by the method parameters for method signature "type". Any "this" parameter is not included.
 */
public static int getParamsWordSize(String type){
  int index=1;
  int count=0;
  if (type.indexOf(')',1) < 0) {
    throw new IllegalArgumentException("String_Node_Str" + type);
  }
  while (type.charAt(index) != ')') {
    count+=getWordSize(type,index);
    index+=getTypeLength(type,index);
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Compute the total number of JVM "stack words" occupied by the method parameters for method signature "type". Any "this" parameter is not included.
 */
public static int getParamsWordSize(String type) throws IllegalArgumentException {
  int index=1;
  int count=0;
  if (type.indexOf(')',1) < 0) {
    throw new IllegalArgumentException("String_Node_Str" + type);
  }
  while (type.charAt(index) != ')') {
    count+=getWordSize(type,index);
    index+=getTypeLength(type,index);
  }
  return count;
}
Program: 40939
Project: 40939
Buggy source:
/** 
 * Computes the character length of the internal JVM type given by s.substring(i).
 */
public static int getTypeLength(String s,int i){
switch (s.charAt(i)) {
case 'L':
    return s.indexOf(';',i) - i + 1;
case '[':
  return getTypeLength(s,i + 1) + 1;
default :
return 1;
}
}

Fixed version (ground truth):
/** 
 * Computes the character length of the internal JVM type given by s.substring(i).
 */
private static int getTypeLength(String s,int i){
switch (s.charAt(i)) {
case 'L':
    return s.indexOf(';',i) - i + 1;
case '[':
  return getTypeLength(s,i + 1) + 1;
default :
return 1;
}
}
Program: 40940
Project: 40940
Buggy source:
/** 
 * Compute the number of parameters given by method signature "type". Any "this" parameter is not included.
 */
public static int getParamsCount(String type){
  int index=1;
  int count=0;
  while (type.charAt(index) != ')') {
    count++;
    index+=getTypeLength(type,index);
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Compute the number of parameters given by method signature "type". Any "this" parameter is not included.
 */
static int getParamsCount(String type){
  int index=1;
  int count=0;
  while (type.charAt(index) != ')') {
    count++;
    index+=getTypeLength(type,index);
  }
  return count;
}
Program: 40941
Project: 40941
Buggy source:
/** 
 * @return true iff t is an array type
 */
public static boolean isArrayType(String t){
  if (t == null) {
    return false;
  }
 else {
switch (t.charAt(0)) {
case '[':
      return true;
default :
    return false;
}
}
}

Fixed version (ground truth):
/** 
 * @return true iff t is an array type
 */
public static boolean isArrayType(String t){
  if (t == null || t.length() == 0) {
    return false;
  }
 else {
switch (t.charAt(0)) {
case '[':
      return true;
default :
    return false;
}
}
}
Program: 40942
Project: 40942
Buggy source:
/** 
 * @return the JVM "stack word size" for the given JVM type, looking at index'index'
 */
public static byte getWordSize(String s,int index){
switch (s.charAt(index)) {
case 'V':
    return 0;
case 'J':
case 'D':
  return 2;
default :
return 1;
}
}

Fixed version (ground truth):
/** 
 * @return the JVM "stack word size" for the given JVM type, looking at index'index'
 */
static byte getWordSize(String s,int index){
switch (s.charAt(index)) {
case 'V':
    return 0;
case 'J':
case 'D':
  return 2;
default :
return 1;
}
}
Program: 40943
Project: 40943
Buggy source:
final void makeOutputJar() throws IOException {
  if (outputJar == null) {
    if (outputFile == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    outputJar=new JarOutputStream(new FileOutputStream(outputFile));
  }
}

Fixed version (ground truth):
final void makeOutputJar() throws IOException, IllegalStateException {
  if (outputJar == null) {
    if (outputFile == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    outputJar=new JarOutputStream(new FileOutputStream(outputFile));
  }
}
Program: 40944
Project: 40944
Buggy source:
/** 
 * Complete and flush the entry initiated by addOutputJarEntry.
 */
final public void endOutputJarEntry() throws IOException {
  outputJar.closeEntry();
}

Fixed version (ground truth):
/** 
 * Complete and flush the entry initiated by addOutputJarEntry.
 */
final public void endOutputJarEntry() throws IOException, IllegalStateException {
  if (outputJar == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  outputJar.closeEntry();
}
Program: 40945
Project: 40945
Buggy source:
/** 
 * Skip the last class returned in every future traversal of the class list.
 */
final public void setIgnore(boolean ignore){
  if (inputIndex == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ignoringInputs.set(inputIndex - 1);
}

Fixed version (ground truth):
/** 
 * Skip the last class returned in every future traversal of the class list.
 */
final public void setIgnore(boolean ignore) throws IllegalArgumentException {
  if (inputIndex == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ignoringInputs.set(inputIndex - 1);
}
Program: 40946
Project: 40946
Buggy source:
private void putNextEntry(ZipEntry newEntry) throws IOException {
  outputJar.putNextEntry(newEntry);
  entryNames.add(newEntry.getName());
  if (manifestBuilder != null) {
    manifestBuilder.addEntry(newEntry);
  }
}

Fixed version (ground truth):
private void putNextEntry(ZipEntry newEntry) throws IOException, IllegalStateException {
  if (outputJar == null) {
    throw new IllegalStateException();
  }
  outputJar.putNextEntry(newEntry);
  entryNames.add(newEntry.getName());
  if (manifestBuilder != null) {
    manifestBuilder.addEntry(newEntry);
  }
}
Program: 40947
Project: 40947
Buggy source:
/** 
 * Add a raw ZipEntry to the output JAR. Call endOutputJarEntry() when you're done.
 * @return the OutputStream to be used to write the entry contents
 */
final public OutputStream addOutputJarEntry(ZipEntry ze) throws IOException {
  putNextEntry(ze);
  return outputJar;
}

Fixed version (ground truth):
/** 
 * Add a raw ZipEntry to the output JAR. Call endOutputJarEntry() when you're done.
 * @return the OutputStream to be used to write the entry contents
 */
final public OutputStream addOutputJarEntry(ZipEntry ze) throws IOException, IllegalStateException {
  if (outputJar == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  putNextEntry(ze);
  return outputJar;
}
Program: 40948
Project: 40948
Buggy source:
/** 
 * Set the JAR Comment for the output JAR.
 */
final public void setJARComment(String comment) throws IOException, IllegalArgumentException {
  makeOutputJar();
  outputJar.setComment(comment);
}

Fixed version (ground truth):
/** 
 * Set the JAR Comment for the output JAR.
 */
final public void setJARComment(String comment) throws IOException, IllegalStateException {
  makeOutputJar();
  outputJar.setComment(comment);
}
Program: 40950
Project: 40950
Buggy source:
/** 
 * Set the bytecodes for this Code attribute.
 */
public void setCode(byte[] code){
  if (code.length > 0xFFFF) {
    throw new IllegalArgumentException("String_Node_Str" + code.length);
  }
  if (code.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.code=code;
}

Fixed version (ground truth):
/** 
 * Set the bytecodes for this Code attribute.
 */
public void setCode(byte[] code) throws IllegalArgumentException {
  if (code.length > 0xFFFF) {
    throw new IllegalArgumentException("String_Node_Str" + code.length);
  }
  if (code.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.code=code;
}
Program: 40951
Project: 40951
Buggy source:
public int getCodeLength(){
  return code.length;
}

Fixed version (ground truth):
public int getCodeLength() throws IllegalStateException {
  if (code == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  return code.length;
}
Program: 40952
Project: 40952
Buggy source:
public int copyInto(byte[] buf,int offset){
  verify();
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,2);
  ClassWriter.setUShort(buf,offset + 6,index);
  return offset + 8;
}

Fixed version (ground truth):
public int copyInto(byte[] buf,int offset) throws IllegalArgumentException {
  verify();
  ClassWriter.setUShort(buf,offset,attrID);
  ClassWriter.setInt(buf,offset + 2,2);
  ClassWriter.setUShort(buf,offset + 6,index);
  return offset + 8;
}
Program: 40953
Project: 40953
Buggy source:
/** 
 * Set the index of the constant pool item holding the source file name.
 */
public void setSourceFileCPIndex(int index){
  if (index < 1 || index > 0xFFFF) {
    throw new IllegalArgumentException("String_Node_Str" + index);
  }
  this.index=index;
}

Fixed version (ground truth):
/** 
 * Set the index of the constant pool item holding the source file name.
 */
public void setSourceFileCPIndex(int index) throws IllegalArgumentException {
  if (index < 1 || index > 0xFFFF) {
    throw new IllegalArgumentException("String_Node_Str" + index);
  }
  this.index=index;
}
Program: 40954
Project: 40954
Buggy source:
public void launch() throws WalaException {
  Process p=spawnProcess(getCmd());
  Thread d1=drainStdErr(p);
  Thread d2=isCaptureOutput() ? captureStdOut(p) : drainStdOut(p);
  try {
    d1.join();
    d2.join();
  }
 catch (  InterruptedException e) {
    throw new WalaException("String_Node_Str",e);
  }
  if (isCaptureOutput()) {
    Drainer d=(Drainer)d2;
    setOutput(d.getCapture().toByteArray());
  }
}

Fixed version (ground truth):
public void launch() throws WalaException, IllegalArgumentException {
  Process p=spawnProcess(getCmd());
  Thread d1=drainStdErr(p);
  Thread d2=isCaptureOutput() ? captureStdOut(p) : drainStdOut(p);
  try {
    d1.join();
    d2.join();
  }
 catch (  InterruptedException e) {
    throw new WalaException("String_Node_Str",e);
  }
  if (isCaptureOutput()) {
    Drainer d=(Drainer)d2;
    setOutput(d.getCapture().toByteArray());
  }
}
Program: 40955
Project: 40955
Buggy source:
public AbstractStatement takeStatement(){
  AbstractStatement result=(AbstractStatement)super.take();
  contents.remove(result);
  return result;
}

Fixed version (ground truth):
public AbstractStatement takeStatement() throws NoSuchElementException {
  AbstractStatement result=(AbstractStatement)super.take();
  contents.remove(result);
  return result;
}
Program: 40956
Project: 40956
Buggy source:
public SSAInstruction copyForSSA(int[] defs,int[] uses){
  return new SSAArrayLengthInstruction(defs == null ? result : defs[0],uses == null ? arrayref : uses[0]);
}

Fixed version (ground truth):
public SSAInstruction copyForSSA(int[] defs,int[] uses) throws IllegalArgumentException {
  if (defs != null && defs.length != 1) {
    throw new IllegalArgumentException();
  }
  if (uses != null && uses.length != 1) {
    throw new IllegalArgumentException();
  }
  return new SSAArrayLengthInstruction(defs == null ? result : defs[0],uses == null ? arrayref : uses[0]);
}
Program: 40957
Project: 40957
Buggy source:
public SSAInstruction copyForSSA(int[] defs,int[] uses){
  return new SSAThrowInstruction(uses == null ? getException() : uses[0]);
}

Fixed version (ground truth):
public SSAInstruction copyForSSA(int[] defs,int[] uses) throws IllegalArgumentException {
  if (uses != null && uses.length != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new SSAThrowInstruction(uses == null ? getException() : uses[0]);
}
Program: 40958
Project: 40958
Buggy source:
/** 
 * @param b a byte array holding the string representation of this descriptor
 * @return the canonical representative for this descriptor value
 */
public static Descriptor findOrCreate(ImmutableByteArray b){
  TypeName returnType=StringStuff.parseForReturnTypeName(b);
  TypeName[] parameters=StringStuff.parseForParameterNames(b);
  Key k=new Key(returnType,parameters);
  Descriptor result=map.get(k);
  if (result == null) {
    result=new Descriptor(k);
    map.put(k,result);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param b a byte array holding the string representation of this descriptor
 * @return the canonical representative for this descriptor value
 */
public static Descriptor findOrCreate(ImmutableByteArray b) throws IllegalArgumentException {
  TypeName returnType=StringStuff.parseForReturnTypeName(b);
  TypeName[] parameters=StringStuff.parseForParameterNames(b);
  Key k=new Key(returnType,parameters);
  Descriptor result=map.get(k);
  if (result == null) {
    result=new Descriptor(k);
    map.put(k,result);
  }
  return result;
}
Program: 40959
Project: 40959
Buggy source:
/** 
 * @param s string representation of this descriptor
 * @return the canonical representative for this descriptor value
 */
public static Descriptor findOrCreateUTF8(String s){
  byte[] b=UTF8Convert.toUTF8(s);
  return findOrCreate(new ImmutableByteArray(b));
}

Fixed version (ground truth):
/** 
 * @param s string representation of this descriptor
 * @return the canonical representative for this descriptor value
 */
public static Descriptor findOrCreateUTF8(String s) throws IllegalArgumentException {
  byte[] b=UTF8Convert.toUTF8(s);
  return findOrCreate(new ImmutableByteArray(b));
}
Program: 40960
Project: 40960
Buggy source:
public static TypeArgument make(String string){
  if (string.equals("String_Node_Str")) {
    return WILDCARD;
  }
 else {
    Assertions.UNREACHABLE();
    return null;
  }
}

Fixed version (ground truth):
public static TypeArgument make(String string) throws UnimplementedError {
  if (string.equals("String_Node_Str")) {
    return WILDCARD;
  }
 else {
    Assertions.UNREACHABLE("String_Node_Str");
    return null;
  }
}
Program: 40961
Project: 40961
Buggy source:
/** 
 * Parse an array descriptor to obtain number of dimensions in corresponding array type. b: descriptor - something like "[Ljava/lang/String;" or "[[I"
 * @return dimensionality - something like "1" or "2"
 */
public static short parseForArrayDimensionality(ImmutableByteArray b,int start,int length){
  for (int i=start; i < start + length; ++i) {
    if (b.b[i] != '[') {
      return (short)(i - start);
    }
  }
  Assertions.UNREACHABLE();
  return -1;
}

Fixed version (ground truth):
/** 
 * Parse an array descriptor to obtain number of dimensions in corresponding array type. b: descriptor - something like "[Ljava/lang/String;" or "[[I"
 * @return dimensionality - something like "1" or "2"
 */
public static short parseForArrayDimensionality(ImmutableByteArray b,int start,int length) throws IllegalArgumentException {
  for (int i=start; i < start + length; ++i) {
    if (b.b[i] != '[') {
      return (short)(i - start);
    }
  }
  throw new IllegalArgumentException("String_Node_Str" + b);
}
Program: 40962
Project: 40962
Buggy source:
/** 
 * Parse method descriptor to obtain description of method's return type. TODO: tune this .. probably combine with parseForParameters.
 * @param b method descriptor - something like "(III)V"
 * @return type description
 */
public static final TypeName parseForReturnTypeName(ImmutableByteArray b){
  if (Assertions.verifyAssertions) {
    if (b.get(0) != '(') {
      Assertions._assert(b.get(0) == '(',"String_Node_Str" + b);
    }
  }
  int i=0;
  while (b.get(i++) != ')')   ;
switch (b.get(i)) {
case TypeReference.VoidTypeCode:
    return TypeReference.Void.getName();
case TypeReference.BooleanTypeCode:
  return TypeReference.Boolean.getName();
case TypeReference.ByteTypeCode:
return TypeReference.Byte.getName();
case TypeReference.ShortTypeCode:
return TypeReference.Short.getName();
case TypeReference.IntTypeCode:
return TypeReference.Int.getName();
case TypeReference.LongTypeCode:
return TypeReference.Long.getName();
case TypeReference.FloatTypeCode:
return TypeReference.Float.getName();
case TypeReference.DoubleTypeCode:
return TypeReference.Double.getName();
case TypeReference.CharTypeCode:
return TypeReference.Char.getName();
case TypeReference.ClassTypeCode:
case TypeReference.ArrayTypeCode:
if (b.get(b.length() - 1) == ';') {
return TypeName.findOrCreate(b,i,b.length() - i - 1);
}
 else {
return TypeName.findOrCreate(b,i,b.length() - i);
}
default :
if (Assertions.verifyAssertions) {
Assertions._assert(false,"String_Node_Str" + b);
}
return null;
}
}

Fixed version (ground truth):
/** 
 * Parse method descriptor to obtain description of method's return type. TODO: tune this .. probably combine with parseForParameters.
 * @param b method descriptor - something like "(III)V"
 * @return type description
 */
public static final TypeName parseForReturnTypeName(ImmutableByteArray b) throws IllegalArgumentException {
  if (b.length() <= 2) {
    throw new IllegalArgumentException("String_Node_Str" + b);
  }
  if (b.get(0) != '(') {
    throw new IllegalArgumentException("String_Node_Str" + b);
  }
  int i=0;
  while (b.get(i++) != ')')   ;
switch (b.get(i)) {
case TypeReference.VoidTypeCode:
    return TypeReference.Void.getName();
case TypeReference.BooleanTypeCode:
  return TypeReference.Boolean.getName();
case TypeReference.ByteTypeCode:
return TypeReference.Byte.getName();
case TypeReference.ShortTypeCode:
return TypeReference.Short.getName();
case TypeReference.IntTypeCode:
return TypeReference.Int.getName();
case TypeReference.LongTypeCode:
return TypeReference.Long.getName();
case TypeReference.FloatTypeCode:
return TypeReference.Float.getName();
case TypeReference.DoubleTypeCode:
return TypeReference.Double.getName();
case TypeReference.CharTypeCode:
return TypeReference.Char.getName();
case TypeReference.ClassTypeCode:
case TypeReference.ArrayTypeCode:
if (b.get(b.length() - 1) == ';') {
return TypeName.findOrCreate(b,i,b.length() - i - 1);
}
 else {
return TypeName.findOrCreate(b,i,b.length() - i);
}
default :
if (Assertions.verifyAssertions) {
Assertions._assert(false,"String_Node_Str" + b);
}
return null;
}
}
Program: 40963
Project: 40963
Buggy source:
/** 
 * Given that name[start:start+length] is a Type name in JVM format, strip the package and return the "package-free" class name
 * @return an ImmutableByteArray that represents the package, or null if it'sthe unnamed package
 */
public static ImmutableByteArray parseForClass(ImmutableByteArray name){
  return parseForClass(name,0,name.length());
}

Fixed version (ground truth):
/** 
 * Given that name[start:start+length] is a Type name in JVM format, strip the package and return the "package-free" class name
 * @return an ImmutableByteArray that represents the package, or null if it'sthe unnamed package
 */
public static ImmutableByteArray parseForClass(ImmutableByteArray name) throws IllegalArgumentException {
  return parseForClass(name,0,name.length());
}
Program: 40964
Project: 40964
Buggy source:
/** 
 * @param name
 * @param start
 * @param length
 * @return true iff the class returned by parseForClass is primitive
 */
public static boolean classIsPrimitive(ImmutableByteArray name,int start,int length){
  while (length > 0 && name.b[start] == '[') {
    start++;
    length--;
  }
  return name.b[start] != 'L';
}

Fixed version (ground truth):
/** 
 * @param name
 * @param start
 * @param length
 * @return true iff the class returned by parseForClass is primitive
 */
public static boolean classIsPrimitive(ImmutableByteArray name,int start,int length) throws IllegalArgumentException {
  while (length > 0 && name.b[start] == '[') {
    start++;
    length--;
  }
  if (start >= name.b.length) {
    throw new IllegalArgumentException("String_Node_Str" + name);
  }
  return name.b[start] != 'L';
}
Program: 40965
Project: 40965
Buggy source:
/** 
 * @param methodSig something like "java_cup.lexer.advance()V"
 */
public static MethodReference makeMethodReference(String methodSig){
  String type=methodSig.substring(0,methodSig.lastIndexOf('.'));
  type=deployment2CanonicalTypeString(type);
  TypeReference t=TypeReference.findOrCreate(ClassLoaderReference.Application,type);
  String methodName=methodSig.substring(methodSig.lastIndexOf('.') + 1,methodSig.indexOf('('));
  String desc=methodSig.substring(methodSig.indexOf('('));
  return MethodReference.findOrCreate(t,methodName,desc);
}

Fixed version (ground truth):
/** 
 * @param methodSig something like "java_cup.lexer.advance()V"
 */
public static MethodReference makeMethodReference(String methodSig) throws IllegalArgumentException {
  if (methodSig.lastIndexOf('.') < 0) {
    throw new IllegalArgumentException("String_Node_Str" + methodSig);
  }
  String type=methodSig.substring(0,methodSig.lastIndexOf('.'));
  type=deployment2CanonicalTypeString(type);
  TypeReference t=TypeReference.findOrCreate(ClassLoaderReference.Application,type);
  String methodName=methodSig.substring(methodSig.lastIndexOf('.') + 1,methodSig.indexOf('('));
  String desc=methodSig.substring(methodSig.indexOf('('));
  return MethodReference.findOrCreate(t,methodName,desc);
}