nus-yam/ex-repair huggingface dataset:
Program: 100490
Project: 100490
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public IStructuredSelection getSelection(){
  GraphViewer viewer=(GraphViewer)getApplicationWindow();
  return (IStructuredSelection)viewer.viewer.getSelection();
}

Fixed version (ground truth):
/** 
 * @return
 * @throws IllegalStateException
 */
public IStructuredSelection getSelection() throws IllegalStateException {
  GraphViewer viewer=(GraphViewer)getApplicationWindow();
  if (viewer == null || viewer.viewer == null) {
    throw new IllegalStateException();
  }
  return (IStructuredSelection)viewer.viewer.getSelection();
}
Program: 100491
Project: 100491
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: 100492
Project: 100492
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: 100493
Project: 100493
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: 100494
Project: 100494
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: 100495
Project: 100495
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: 100496
Project: 100496
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: 100497
Project: 100497
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: 100498
Project: 100498
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: 100499
Project: 100499
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: 100500
Project: 100500
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: 100501
Project: 100501
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: 100502
Project: 100502
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);
}
Program: 100504
Project: 100504
Buggy source:
/** 
 * Convert a JVM encoded type name to a readable type name.
 * @param jvmType a String containing a type name in JVM internal format.
 * @return the same type name in readable (source code) format.
 */
public static String jvmToReadableType(String jvmType){
  StringBuffer readable=new StringBuffer();
  int numberOfDimensions=0;
  char prefix=jvmType.charAt(0);
  while (prefix == '[') {
    numberOfDimensions++;
    prefix=jvmType.charAt(numberOfDimensions);
  }
  if (prefix == 'V') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'B') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'C') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'D') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'F') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'I') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'J') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'S') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'Z') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'L') {
    readable.append(jvmType.substring(numberOfDimensions + 1,jvmType.length()));
    readable=new StringBuffer(slashToDot(readable.toString()));
    readable=new StringBuffer(dollarToDot(readable.toString()));
  }
  for (int i=0; i < numberOfDimensions; ++i) {
    readable.append("String_Node_Str");
  }
  return readable.toString();
}

Fixed version (ground truth):
/** 
 * Convert a JVM encoded type name to a readable type name.
 * @param jvmType a String containing a type name in JVM internal format.
 * @return the same type name in readable (source code) format.
 */
public static String jvmToReadableType(String jvmType) throws IllegalArgumentException {
  StringBuffer readable=new StringBuffer();
  int numberOfDimensions=0;
  if (jvmType.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str" + jvmType);
  }
  char prefix=jvmType.charAt(0);
  while (prefix == '[') {
    numberOfDimensions++;
    prefix=jvmType.charAt(numberOfDimensions);
  }
  if (prefix == 'V') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'B') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'C') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'D') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'F') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'I') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'J') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'S') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'Z') {
    readable.append("String_Node_Str");
  }
 else   if (prefix == 'L') {
    readable.append(jvmType.substring(numberOfDimensions + 1,jvmType.length()));
    readable=new StringBuffer(slashToDot(readable.toString()));
    readable=new StringBuffer(dollarToDot(readable.toString()));
  }
  for (int i=0; i < numberOfDimensions; ++i) {
    readable.append("String_Node_Str");
  }
  return readable.toString();
}
Program: 100505
Project: 100505
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: 100506
Project: 100506
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: 100507
Project: 100507
Buggy source:
/** 
 * Add an integer value to this set.
 * @param i
 * @return true iff the value of this changes.
 */
public boolean add(int i){
  boolean pr=primaryImpl.add(i);
  boolean sr=secondaryImpl.add(i);
  Assertions._assert(pr == sr);
  return pr;
}

Fixed version (ground truth):
/** 
 * Add an integer value to this set.
 * @param i
 * @return true iff the value of this changes.
 */
public boolean add(int i){
  boolean pr=primaryImpl.add(i);
  boolean sr=secondaryImpl.add(i);
  if (pr != sr) {
    Assertions._assert(pr == sr,"String_Node_Str" + i + "String_Node_Str"+ primaryImpl+ "String_Node_Str"+ pr+ "String_Node_Str"+ i+ "String_Node_Str"+ secondaryImpl+ "String_Node_Str"+ sr);
  }
  return pr;
}
Program: 100508
Project: 100508
Buggy source:
/** 
 */
public int size(){
  Assertions._assert(primaryImpl.size() == secondaryImpl.size());
  return primaryImpl.size();
}

Fixed version (ground truth):
/** 
 */
public int size(){
  if (primaryImpl.size() != secondaryImpl.size()) {
    Assertions._assert(primaryImpl.size() == secondaryImpl.size(),"String_Node_Str" + primaryImpl.size() + "String_Node_Str"+ primaryImpl+ "String_Node_Str"+ "String_Node_Str"+ secondaryImpl.size()+ "String_Node_Str"+ secondaryImpl);
  }
  return primaryImpl.size();
}
Program: 100509
Project: 100509
Buggy source:
void growCapacity(float fraction){
  expand(offset,(int)fraction * (bits.length << LOG_BITS_PER_UNIT));
}

Fixed version (ground truth):
void growCapacity(float fraction){
  expand(offset,(int)(fraction * (bits.length << LOG_BITS_PER_UNIT)));
}
Program: 100510
Project: 100510
Buggy source:
/** 
 * Add an integer value to this set.
 * @param i integer to add
 * @return true iff the value of this changes.
 */
public boolean add(int i){
  if (!contains(i)) {
    if (densePart != null && densePart.getOffset() <= i && densePart.length() > i) {
      densePart.set(i);
    }
 else {
      sparsePart.add(i);
      fixAfterSparseInsert();
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Add an integer value to this set.
 * @param i integer to add
 * @return true iff the value of this changes.
 */
public boolean add(int i){
  if (densePart != null && inDenseRange(i)) {
    if (!densePart.get(i)) {
      densePart.set(i);
      assertDisjoint();
      return true;
    }
  }
 else   if (!sparsePart.contains(i)) {
    sparsePart.add(i);
    assertDisjoint();
    fixAfterSparseInsert();
    return true;
  }
  return false;
}
Program: 100511
Project: 100511
Buggy source:
/** 
 * @param i
 * @return true iff this set contains integer i
 */
public boolean contains(int i){
  return sparsePart.contains(i) || (densePart != null && densePart.contains(i));
}

Fixed version (ground truth):
/** 
 * @param i
 * @return true iff this set contains integer i
 */
public boolean contains(int i){
  if (densePart != null && inDenseRange(i)) {
    return densePart.contains(i);
  }
 else {
    return sparsePart.contains(i);
  }
}
Program: 100513
Project: 100513
Buggy source:
/** 
 */
public void init(){
  fakeRoot=makeFakeRootNode();
  Key k=new Key(fakeRoot.getMethod(),fakeRoot.getContext());
  registerNode(k,fakeRoot);
  fakeWorldClinit=makeFakeWorldClinitNode();
  k=new Key(fakeWorldClinit.getMethod(),fakeWorldClinit.getContext());
  registerNode(k,fakeWorldClinit);
  CallSiteReference site=CallSiteReference.make(1,fakeWorldClinit.getMethod().getReference(),IInvokeInstruction.Dispatch.STATIC);
  ((FakeRootMethod)fakeRoot.getMethod()).addInvocation(null,site);
  fakeRoot.addTarget(site,fakeWorldClinit);
}

Fixed version (ground truth):
/** 
 */
public void init(){
  fakeRoot=makeFakeRootNode();
  Key k=new Key(fakeRoot.getMethod(),fakeRoot.getContext());
  registerNode(k,fakeRoot);
  fakeWorldClinit=makeFakeWorldClinitNode();
  k=new Key(fakeWorldClinit.getMethod(),fakeWorldClinit.getContext());
  registerNode(k,fakeWorldClinit);
  CallSiteReference site=CallSiteReference.make(1,fakeWorldClinit.getMethod().getReference(),IInvokeInstruction.Dispatch.STATIC);
  site=((FakeRootMethod)fakeRoot.getMethod()).addInvocation(null,site).getCallSite();
  fakeRoot.addTarget(site,fakeWorldClinit);
}
Program: 100514
Project: 100514
Buggy source:
/** 
 * Allocate a fresh label. This must be called during a pass and not during code emission.
 */
public int allocateLabel(){
  verifyState(DURING_PASS);
  return nextLabel++;
}

Fixed version (ground truth):
/** 
 * Allocate a fresh label. This must be called during a pass and not during code emission.
 */
public int allocateLabel() throws IllegalArgumentException {
  verifyState(DURING_PASS);
  return nextLabel++;
}
Program: 100517
Project: 100517
Buggy source:
/** 
 * @return the name of the Class at constant pool item i, in JVM format (e.g.,java/lang/Object)
 */
public String getCPClass(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Class) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  String s=cpItems[i];
  if (s == null) {
    try {
      s=getCPUtf8(getUShort(offset + 1));
    }
 catch (    IllegalArgumentException ex) {
      throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
    }
    cpItems[i]=s;
  }
  return s;
}

Fixed version (ground truth):
/** 
 * @return the name of the Class at constant pool item i, in JVM format (e.g.,java/lang/Object)
 */
public String getCPClass(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Class) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  String s=cpItems[i];
  if (s == null) {
    try {
      s=getCPUtf8(getUShort(offset + 1));
    }
 catch (    IllegalArgumentException ex) {
      throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
    }
    cpItems[i]=s;
  }
  return s;
}
Program: 100518
Project: 100518
Buggy source:
/** 
 * @return the value of the Double at constant pool item i
 */
public double getCPDouble(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Double) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getDouble(offset + 1);
}

Fixed version (ground truth):
/** 
 * @return the value of the Double at constant pool item i
 */
public double getCPDouble(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Double) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getDouble(offset + 1);
}
Program: 100519
Project: 100519
Buggy source:
/** 
 * @return the type part of the FieldRef, MethodRef, or InterfaceMethodRef atconstant pool item i, in JVM format (e.g., I, Z, or Ljava/lang/Object;)
 */
public String getCPRefType(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || !isRef(getByte(offset))) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPNATType(getUShort(offset + 3));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @return the type part of the FieldRef, MethodRef, or InterfaceMethodRef atconstant pool item i, in JVM format (e.g., I, Z, or Ljava/lang/Object;)
 */
public String getCPRefType(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || !isRef(getByte(offset))) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPNATType(getUShort(offset + 3));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 100520
Project: 100520
Buggy source:
/** 
 * @return the value of the Long at constant pool item i
 */
public long getCPLong(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Long) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getLong(offset + 1);
}

Fixed version (ground truth):
/** 
 * @return the value of the Long at constant pool item i
 */
public long getCPLong(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Long) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getLong(offset + 1);
}
Program: 100521
Project: 100521
Buggy source:
/** 
 * @return the name part of the NameAndType at constant pool item i
 */
public String getCPNATName(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_NameAndType) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPUtf8(getUShort(offset + 1));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @return the name part of the NameAndType at constant pool item i
 */
public String getCPNATName(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_NameAndType) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPUtf8(getUShort(offset + 1));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 100522
Project: 100522
Buggy source:
/** 
 * @return the value of the Integer at constant pool item i
 */
public int getCPInt(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Integer) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getInt(offset + 1);
}

Fixed version (ground truth):
/** 
 * @return the value of the Integer at constant pool item i
 */
public int getCPInt(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Integer) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getInt(offset + 1);
}
Program: 100523
Project: 100523
Buggy source:
/** 
 * @return the size of the constant pool data in the raw class file buffer
 */
public int getRawSize(){
  return cpOffsets[cpOffsets.length - 1] - cpOffsets[1];
}

Fixed version (ground truth):
/** 
 * @return the size of the constant pool data in the raw class file buffer
 */
public int getRawSize() throws IllegalStateException {
  if (cpOffsets.length < 2) {
    throw new IllegalStateException();
  }
  return cpOffsets[cpOffsets.length - 1] - cpOffsets[1];
}
Program: 100524
Project: 100524
Buggy source:
/** 
 * @return the type part of the NameAndType at constant pool item i, in JVMformat (e.g., I, Z, or Ljava/lang/Object;)
 */
public String getCPNATType(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_NameAndType) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPUtf8(getUShort(offset + 3));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @return the type part of the NameAndType at constant pool item i, in JVMformat (e.g., I, Z, or Ljava/lang/Object;)
 */
public String getCPNATType(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_NameAndType) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPUtf8(getUShort(offset + 3));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 100525
Project: 100525
Buggy source:
/** 
 * @return the name part of the FieldRef, MethodRef, or InterfaceMethodRef atconstant pool item i
 */
public String getCPRefName(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || !isRef(getByte(offset))) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPNATName(getUShort(offset + 3));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @return the name part of the FieldRef, MethodRef, or InterfaceMethodRef atconstant pool item i
 */
public String getCPRefName(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || !isRef(getByte(offset))) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPNATName(getUShort(offset + 3));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 100526
Project: 100526
Buggy source:
/** 
 * @return the type of constant pool item i, or 0 if i is an unused constantpool item
 */
public byte getItemType(int i){
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0) {
    return 0;
  }
 else {
    return getByte(offset);
  }
}

Fixed version (ground truth):
/** 
 * @return the type of constant pool item i, or 0 if i is an unused constantpool item
 */
public byte getItemType(int i) throws IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0) {
    return 0;
  }
 else {
    return getByte(offset);
  }
}
Program: 100527
Project: 100527
Buggy source:
/** 
 * @return the String at constant pool item i
 */
public String getCPString(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_String) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  String s=cpItems[i];
  if (s == null) {
    try {
      s=getCPUtf8(getUShort(offset + 1));
    }
 catch (    IllegalArgumentException ex) {
      throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
    }
    cpItems[i]=s;
  }
  return s;
}

Fixed version (ground truth):
/** 
 * @return the String at constant pool item i
 */
public String getCPString(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_String) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  String s=cpItems[i];
  if (s == null) {
    try {
      s=getCPUtf8(getUShort(offset + 1));
    }
 catch (    IllegalArgumentException ex) {
      throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
    }
    cpItems[i]=s;
  }
  return s;
}
Program: 100528
Project: 100528
Buggy source:
/** 
 * @return the name of the class part of the FieldRef, MethodRef, orInterfaceMethodRef at constant pool item i
 */
public String getCPRefClass(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || !isRef(getByte(offset))) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPClass(getUShort(offset + 1));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * @return the name of the class part of the FieldRef, MethodRef, orInterfaceMethodRef at constant pool item i
 */
public String getCPRefClass(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || !isRef(getByte(offset))) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  try {
    return getCPClass(getUShort(offset + 1));
  }
 catch (  IllegalArgumentException ex) {
    throw new InvalidClassFileException(offset,"String_Node_Str" + i + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 100529
Project: 100529
Buggy source:
/** 
 * @return the value of the Float at constant pool item i
 */
public float getCPFloat(int i) throws InvalidClassFileException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Float) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getFloat(offset + 1);
}

Fixed version (ground truth):
/** 
 * @return the value of the Float at constant pool item i
 */
public float getCPFloat(int i) throws InvalidClassFileException, IllegalArgumentException {
  if (i < 1 || i >= cpItems.length) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  int offset=cpOffsets[i];
  if (offset == 0 || getByte(offset) != CONSTANT_Float) {
    throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str");
  }
  return getFloat(offset + 1);
}
Program: 100530
Project: 100530
Buggy source:
/** 
 * @return the offset of the constant pool data in the raw class file buffer
 */
public int getRawOffset(){
  return cpOffsets[1];
}

Fixed version (ground truth):
/** 
 * @return the offset of the constant pool data in the raw class file buffer
 */
public int getRawOffset() throws IllegalStateException {
  if (cpOffsets.length < 2) {
    throw new IllegalStateException();
  }
  return cpOffsets[1];
}
Program: 100531
Project: 100531
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: 100532
Project: 100532
Buggy source:
/** 
 * Set the index of the constant pool item holding the constant value.
 */
public void setValueCPIndex(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 constant value.
 */
public void setValueCPIndex(int index) throws IllegalArgumentException {
  if (index < 1 || index > 0xFFFF) {
    throw new IllegalArgumentException("String_Node_Str" + index);
  }
  this.index=index;
}
Program: 100533
Project: 100533
Buggy source:
public void set(int x,Object value){
  if (Assertions.verifyAssertions) {
    Assertions._assert(x >= 0);
  }
  maxIndex=Math.max(maxIndex,x);
  if (value == null) {
    if (x >= store.length) {
      return;
    }
 else {
      store[x]=value;
    }
  }
 else {
    ensureCapacity(x);
    store[x]=value;
  }
}

Fixed version (ground truth):
public void set(int x,T value){
  if (Assertions.verifyAssertions) {
    Assertions._assert(x >= 0);
  }
  maxIndex=Math.max(maxIndex,x);
  if (value == null) {
    if (x >= store.length) {
      return;
    }
 else {
      store[x]=value;
    }
  }
 else {
    ensureCapacity(x);
    store[x]=value;
  }
}
Program: 100534
Project: 100534
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: 100535
Project: 100535
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: 100536
Project: 100536
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: 100537
Project: 100537
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: 100538
Project: 100538
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: 100539
Project: 100539
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: 100540
Project: 100540
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: 100541
Project: 100541
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: 100542
Project: 100542
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: 100543
Project: 100543
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);
  }
}