nus-yam/ex-repair huggingface dataset:
Program: 149919
Project: 149919
Buggy source:
private VM_Type resolveInternal() throws NoClassDefFoundError, IllegalArgumentException {
  if (resolvedType != null)   return resolvedType;
  if (isClassType()) {
    VM_Type ans;
    if (VM.runningVM) {
      Class<?> klass;
      String myName=name.classNameFromDescriptor();
      try {
        klass=classloader.loadClass(myName);
      }
 catch (      ClassNotFoundException cnf) {
        NoClassDefFoundError ncdfe=new NoClassDefFoundError("String_Node_Str" + myName + "String_Node_Str"+ cnf.getMessage());
        ncdfe.initCause(cnf);
        throw ncdfe;
      }
      ans=java.lang.JikesRVMSupport.getTypeForClass(klass);
    }
 else {
      ans=((VM_BootstrapClassLoader)classloader).loadVMClass(name.classNameFromDescriptor());
    }
    if (VM.VerifyAssertions)     VM._assert(resolvedType == null || resolvedType == ans);
    resolvedType=ans;
  }
 else   if (isArrayType()) {
    if (isWordArrayType() || isCodeArrayType()) {
      resolvedType=getArrayElementType().getArrayTypeForElementType().resolve();
    }
 else {
      VM_Type elementType=getArrayElementType().resolve();
      if (elementType.getClassLoader() != classloader) {
        VM_TypeReference canonical=VM_TypeReference.findOrCreate(elementType.getClassLoader(),name);
        resolvedType=canonical.resolve();
      }
 else {
        resolvedType=new VM_Array(this,elementType);
      }
    }
  }
 else {
    resolvedType=VM_Primitive.createPrimitive(this);
  }
  return resolvedType;
}

Fixed version (ground truth):
private VM_Type resolveInternal() throws NoClassDefFoundError, IllegalArgumentException {
  if (resolvedType != null)   return resolvedType;
  if (isClassType()) {
    VM_Type ans;
    if (VM.runningVM) {
      Class<?> klass;
      String myName=name.classNameFromDescriptor();
      try {
        klass=classloader.loadClass(myName);
      }
 catch (      ClassNotFoundException cnf) {
        NoClassDefFoundError ncdfe=new NoClassDefFoundError("String_Node_Str" + myName + "String_Node_Str"+ cnf.getMessage());
        ncdfe.initCause(cnf);
        throw ncdfe;
      }
      ans=java.lang.JikesRVMSupport.getTypeForClass(klass);
    }
 else {
      ans=((VM_BootstrapClassLoader)classloader).loadVMClass(name.classNameFromDescriptor());
    }
    if (VM.VerifyAssertions)     VM._assert(resolvedType == null || resolvedType == ans);
    setResolvedType(ans);
  }
 else   if (isArrayType()) {
    if (isWordArrayType() || isCodeArrayType()) {
      setResolvedType(getArrayElementType().getArrayTypeForElementType().resolve());
    }
 else {
      VM_Type elementType=getArrayElementType().resolve();
      if (elementType.getClassLoader() != classloader) {
        VM_TypeReference canonical=VM_TypeReference.findOrCreate(elementType.getClassLoader(),name);
        setResolvedType(canonical.resolve());
      }
 else {
        setResolvedType(new VM_Array(this,elementType));
      }
    }
  }
 else {
    setResolvedType(VM_Primitive.createPrimitive(this));
  }
  return resolvedType;
}
Program: 149920
Project: 149920
Buggy source:
/** 
 * Has the type reference already been resolved into a type?
 */
@Uninterruptible public boolean isResolved(){
  return resolvedType != null;
}

Fixed version (ground truth):
/** 
 * Has the type reference already been resolved into a type? NB this can return true when a type itself isn't resolved during the bootstrap
 */
@Uninterruptible public boolean isResolved(){
  return resolvedType != null;
}
Program: 149921
Project: 149921
Buggy source:
private static DefUseEffect getObjTib(OPT_Instruction s){
  if (CF_TIB) {
    OPT_Operand op=GuardedUnary.getVal(s);
    if (op.isNullConstant()) {
      Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),OPT_TrapCodeOperand.NullPtr());
      return DefUseEffect.TRAP_REDUCED;
    }
 else     if (op.isConstant()) {
      try {
        VM_Type type=op.getType().resolve();
        Move.mutate(s,REF_MOVE,GuardedUnary.getClearResult(s),new OPT_TIBConstantOperand(type));
        return DefUseEffect.MOVE_FOLDED;
      }
 catch (      NoClassDefFoundError e) {
        if (VM.runningVM) {
          throw e;
        }
 else {
          System.out.println("String_Node_Str" + op.getType() + "String_Node_Str"+ e.getMessage());
        }
      }
    }
 else {
      OPT_RegisterOperand rop=op.asRegister();
      VM_TypeReference typeRef=rop.getType();
      if (typeRef.isResolved() && rop.isPreciseType()) {
        Move.mutate(s,REF_MOVE,GuardedUnary.getClearResult(s),new OPT_TIBConstantOperand(typeRef.peekResolvedType()));
        return DefUseEffect.MOVE_FOLDED;
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}

Fixed version (ground truth):
private static DefUseEffect getObjTib(OPT_Instruction s){
  if (CF_TIB) {
    OPT_Operand op=GuardedUnary.getVal(s);
    if (VM.VerifyAssertions && op.isNullConstant()) {
      OPT_RegisterOperand result=GetField.getClearResult(s);
      Move.mutate(s,OPT_IRTools.getMoveOp(result.getType()),result,new OPT_UnreachableOperand());
      return DefUseEffect.MOVE_FOLDED;
    }
 else     if (op.isConstant()) {
      try {
        VM_Type type=op.getType().resolve();
        Move.mutate(s,REF_MOVE,GuardedUnary.getClearResult(s),new OPT_TIBConstantOperand(type));
        return DefUseEffect.MOVE_FOLDED;
      }
 catch (      NoClassDefFoundError e) {
        if (VM.runningVM) {
          throw e;
        }
 else {
          System.out.println("String_Node_Str" + op.getType() + "String_Node_Str"+ e.getMessage());
        }
      }
    }
 else {
      OPT_RegisterOperand rop=op.asRegister();
      VM_TypeReference typeRef=rop.getType();
      if (typeRef.isResolved() && rop.isPreciseType()) {
        Move.mutate(s,REF_MOVE,GuardedUnary.getClearResult(s),new OPT_TIBConstantOperand(typeRef.peekResolvedType()));
        return DefUseEffect.MOVE_FOLDED;
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}
Program: 149922
Project: 149922
Buggy source:
private static DefUseEffect getField(OPT_Instruction s){
  if (CF_FIELDS) {
    OPT_Operand ref=GetField.getRef(s);
    if (ref.isNullConstant()) {
      Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),OPT_TrapCodeOperand.NullPtr());
      return DefUseEffect.TRAP_REDUCED;
    }
 else     if (ref.isObjectConstant()) {
      VM_Field field=GetField.getLocation(s).getFieldRef().resolve();
      if (field.isFinal() && field.getDeclaringClass().isInitialized()) {
        try {
          OPT_ConstantOperand op=OPT_StaticFieldReader.getFieldValueAsConstant(field,ref.asObjectConstant().value);
          Move.mutate(s,OPT_IRTools.getMoveOp(field.getType()),GetField.getClearResult(s),op);
          return DefUseEffect.MOVE_FOLDED;
        }
 catch (        NoSuchFieldException e) {
          if (VM.runningVM) {
            throw new Error("String_Node_Str",e);
          }
 else {
          }
        }
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}

Fixed version (ground truth):
private static DefUseEffect getField(OPT_Instruction s){
  if (CF_FIELDS) {
    OPT_Operand ref=GetField.getRef(s);
    if (VM.VerifyAssertions && ref.isNullConstant()) {
      OPT_RegisterOperand result=GetField.getClearResult(s);
      Move.mutate(s,OPT_IRTools.getMoveOp(result.getType()),result,new OPT_UnreachableOperand());
      return DefUseEffect.MOVE_FOLDED;
    }
 else     if (ref.isObjectConstant()) {
      VM_Field field=GetField.getLocation(s).getFieldRef().resolve();
      if (field.isFinal() && field.getDeclaringClass().isInitialized()) {
        try {
          OPT_ConstantOperand op=OPT_StaticFieldReader.getFieldValueAsConstant(field,ref.asObjectConstant().value);
          Move.mutate(s,OPT_IRTools.getMoveOp(field.getType()),GetField.getClearResult(s),op);
          return DefUseEffect.MOVE_FOLDED;
        }
 catch (        NoSuchFieldException e) {
          if (VM.runningVM) {
            throw new Error("String_Node_Str",e);
          }
 else {
          }
        }
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}
Program: 149923
Project: 149923
Buggy source:
private static DefUseEffect call(OPT_Instruction s){
  if (CF_FIELDS) {
    OPT_MethodOperand methOp=Call.getMethod(s);
    if ((methOp != null) && methOp.isVirtual() && !methOp.hasPreciseTarget()) {
      OPT_Operand calleeThis=Call.getParam(s,0);
      if (calleeThis.isNullConstant()) {
        Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),OPT_TrapCodeOperand.NullPtr());
        return DefUseEffect.TRAP_REDUCED;
      }
 else       if (calleeThis.isConstant() || calleeThis.asRegister().isPreciseType()) {
        VM_TypeReference calleeClass=calleeThis.getType();
        if (calleeClass.isResolved()) {
          methOp.refine(calleeClass.peekResolvedType());
          return DefUseEffect.UNCHANGED;
        }
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}

Fixed version (ground truth):
private static DefUseEffect call(OPT_Instruction s){
  if (CF_FIELDS) {
    OPT_MethodOperand methOp=Call.getMethod(s);
    if ((methOp != null) && methOp.isVirtual() && !methOp.hasPreciseTarget()) {
      OPT_Operand calleeThis=Call.getParam(s,0);
      if (calleeThis.isNullConstant()) {
        Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),OPT_TrapCodeOperand.NullPtr());
        return DefUseEffect.TRAP_REDUCED;
      }
 else       if (calleeThis.isConstant() || calleeThis.asRegister().isPreciseType()) {
        VM_TypeReference calleeClass=calleeThis.getType();
        if (calleeClass.isResolved()) {
          if (VM.runningVM || calleeClass.peekResolvedType().isResolved()) {
            methOp.refine(calleeClass.peekResolvedType());
            return DefUseEffect.UNCHANGED;
          }
        }
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}
Program: 149924
Project: 149924
Buggy source:
@Interruptible int size(){
  int size=TYPE.peekResolvedType().asClass().getInstanceSize();
  if (MCSites != null)   size+=VM_Array.IntArray.getInstanceSize(MCSites.length);
  if (referenceMaps != null)   size+=VM_Array.ByteArray.getInstanceSize(referenceMaps.length);
  if (jsrInfo != null && jsrInfo.unusualReferenceMaps != null)   size+=VM_Array.JavaLangObjectArray.getInstanceSize(jsrInfo.unusualReferenceMaps.length);
  return size;
}

Fixed version (ground truth):
@Interruptible int size(){
  int size=VM_TypeReference.VM_ReferenceMaps.peekResolvedType().asClass().getInstanceSize();
  if (MCSites != null)   size+=VM_Array.IntArray.getInstanceSize(MCSites.length);
  if (referenceMaps != null)   size+=VM_Array.ByteArray.getInstanceSize(referenceMaps.length);
  if (jsrInfo != null && jsrInfo.unusualReferenceMaps != null)   size+=VM_Array.JavaLangObjectArray.getInstanceSize(jsrInfo.unusualReferenceMaps.length);
  return size;
}
Program: 149927
Project: 149927
Buggy source:
/** 
 * Read an annotation attribute from the class file
 * @param constantPool from constant pool being loaded
 * @param input the data being rea
 */
static VM_Annotation readAnnotation(int[] constantPool,DataInputStream input,ClassLoader classLoader) throws IOException, ClassNotFoundException {
  VM_Atom type;
  int typeIndex=input.readUnsignedShort();
  type=VM_Class.getUtf(constantPool,typeIndex);
  int numAnnotationMembers=input.readUnsignedShort();
  AnnotationMember[] elementValuePairs=new AnnotationMember[numAnnotationMembers];
  for (int i=0; i < numAnnotationMembers; i++) {
    elementValuePairs[i]=AnnotationMember.readAnnotationMember(constantPool,input,classLoader);
  }
  VM_Annotation result=new VM_Annotation(type,elementValuePairs,classLoader);
  return result;
}

Fixed version (ground truth):
/** 
 * Read an annotation attribute from the class file
 * @param constantPool from constant pool being loaded
 * @param input the data being rea
 */
static VM_Annotation readAnnotation(int[] constantPool,DataInputStream input,ClassLoader classLoader) throws IOException, ClassNotFoundException {
  VM_Atom type;
  int typeIndex=input.readUnsignedShort();
  type=VM_Class.getUtf(constantPool,typeIndex);
  int numAnnotationMembers=input.readUnsignedShort();
  AnnotationMember[] elementValuePairs=new AnnotationMember[numAnnotationMembers];
  for (int i=0; i < numAnnotationMembers; i++) {
    elementValuePairs[i]=AnnotationMember.readAnnotationMember(constantPool,input,classLoader);
  }
  return new VM_Annotation(type,elementValuePairs,classLoader);
}
Program: 149928
Project: 149928
Buggy source:
@Interruptible public int size(){
  int size=TYPE.peekResolvedType().asClass().getInstanceSize();
  size+=_mcMap.size();
  if (eTable != null)   size+=VM_Array.IntArray.getInstanceSize(eTable.length);
  if (patchMap != null)   size+=VM_Array.IntArray.getInstanceSize(patchMap.length);
  return size;
}

Fixed version (ground truth):
@Interruptible public int size(){
  int size=VM_TypeReference.VM_ExceptionTable.peekResolvedType().asClass().getInstanceSize();
  size+=_mcMap.size();
  if (eTable != null)   size+=VM_Array.IntArray.getInstanceSize(eTable.length);
  if (patchMap != null)   size+=VM_Array.IntArray.getInstanceSize(patchMap.length);
  return size;
}
Program: 149930
Project: 149930
Buggy source:
/** 
 * Construct the JNIFuntionTable. This is not very efficient, but is done at bootImageWriting time, so we just don't worry about it.
 */
public static VM_CodeArray[] buildTable(){
  String[] names=initNames();
  VM_CodeArray[] functions=new VM_CodeArray[VM_JNIFunctions.FUNCTIONCOUNT];
  VM_TypeReference tRef=VM_TypeReference.findOrCreate(VM_BootstrapClassLoader.getBootstrapClassLoader(),VM_Atom.findOrCreateAsciiAtom("String_Node_Str"));
  VM_Class cls=(VM_Class)tRef.peekResolvedType();
  if (VM.VerifyAssertions)   VM._assert(cls.isInstantiated());
  for (  VM_Method mth : cls.getDeclaredMethods()) {
    String methodName=mth.getName().toString();
    int jniIndex=indexOf(names,methodName);
    if (jniIndex != -1) {
      functions[jniIndex]=mth.getCurrentEntryCodeArray();
    }
  }
  return functions;
}

Fixed version (ground truth):
/** 
 * Construct the JNIFuntionTable. This is not very efficient, but is done at bootImageWriting time, so we just don't worry about it.
 */
public static VM_CodeArray[] buildTable(){
  String[] names=initNames();
  VM_CodeArray[] functions=new VM_CodeArray[VM_JNIFunctions.FUNCTIONCOUNT];
  VM_Class cls=VM_TypeReference.VM_JNIFunctions.peekResolvedType().asClass();
  if (VM.VerifyAssertions)   VM._assert(cls.isInstantiated());
  for (  VM_Method mth : cls.getDeclaredMethods()) {
    String methodName=mth.getName().toString();
    int jniIndex=indexOf(names,methodName);
    if (jniIndex != -1) {
      functions[jniIndex]=mth.getCurrentEntryCodeArray();
    }
  }
  return functions;
}
Program: 149931
Project: 149931
Buggy source:
/** 
 * Sorting method for Comparable. Sort by string value 
 */
public int compareTo(Object o){
  return value.compareTo(((Prefix)o).value);
}

Fixed version (ground truth):
/** 
 * Sorting method for Comparable. Sort by string value 
 */
public int compareTo(Object o){
  return -value.compareTo(((Prefix)o).value);
}
Program: 149932
Project: 149932
Buggy source:
/** 
 * Extract the first -D... command line argument that matches a given variable, and return it.
 * @return the environment arg, or null if there is none.
 */
public static String getEnvironmentArg(String variable){
  String[] allEnvArgs=getArgs(ENVIRONMENT_ARG);
  String prefix=variable + "String_Node_Str";
  if (allEnvArgs != null)   for (  String allEnvArg : allEnvArgs)   if (allEnvArg.startsWith(prefix))   return allEnvArg.substring(variable.length() + 1);
  if (variable.equals("String_Node_Str"))   return getRvmRoot();
 else   if (variable.equals("String_Node_Str"))   return getRvmBuild();
 else   if (variable.equals("String_Node_Str"))   return getRvmRoot();
 else   if (variable.equals("String_Node_Str"))   return "String_Node_Str" + getRvmBuild();
 else   if (variable.equals("String_Node_Str"))   return "String_Node_Str";
 else   if (variable.equals("String_Node_Str"))   return getUserHome();
 else   if (variable.equals("String_Node_Str"))   return getCWD();
 else   if (variable.equals("String_Node_Str"))   return getOsName();
 else   if (variable.equals("String_Node_Str"))   return getOsVersion();
 else   if (variable.equals("String_Node_Str"))   return getOsArch();
  return null;
}

Fixed version (ground truth):
/** 
 * Extract the first -D... command line argument that matches a given variable, and return it.
 * @return the environment arg, or null if there is none.
 */
public static String getEnvironmentArg(String variable){
  if (!VM.runningVM)   throw new IllegalAccessError("String_Node_Str");
  String[] allEnvArgs=getArgs(ENVIRONMENT_ARG);
  String prefix=variable + "String_Node_Str";
  if (allEnvArgs != null)   for (  String allEnvArg : allEnvArgs)   if (allEnvArg.startsWith(prefix))   return allEnvArg.substring(variable.length() + 1);
  if (variable.equals("String_Node_Str"))   return getRvmRoot();
 else   if (variable.equals("String_Node_Str"))   return getRvmBuild();
 else   if (variable.equals("String_Node_Str"))   return getRvmRoot();
 else   if (variable.equals("String_Node_Str"))   return "String_Node_Str" + getRvmBuild();
 else   if (variable.equals("String_Node_Str"))   return "String_Node_Str";
 else   if (variable.equals("String_Node_Str"))   return getUserHome();
 else   if (variable.equals("String_Node_Str"))   return getCWD();
 else   if (variable.equals("String_Node_Str"))   return getOsName();
 else   if (variable.equals("String_Node_Str"))   return getOsVersion();
 else   if (variable.equals("String_Node_Str"))   return getOsArch();
  return null;
}
Program: 149934
Project: 149934
Buggy source:
/** 
 * Find the VM_Field that this field reference refers to using the search order specified in JVM spec 5.4.3.2.
 * @return the VM_Field that this method ref resolved to.
 */
public final VM_Field resolve(){
  if (resolvedMember != null)   return resolvedMember;
  return resolveInternal((VM_Class)type.resolve());
}

Fixed version (ground truth):
/** 
 * Find the VM_Field that this field reference refers to using the search order specified in JVM spec 5.4.3.2.
 * @return the VM_Field that this method ref resolved to.
 */
public final synchronized VM_Field resolve(){
  if (resolvedMember != null)   return resolvedMember;
  return resolveInternal((VM_Class)type.resolve());
}
Program: 149935
Project: 149935
Buggy source:
/** 
 * Find the VM_Method that this field reference refers to using the search order specified in JVM spec 5.4.3.3.
 * @return the VM_Method that this method ref resolved to.
 */
public final VM_Method resolve(){
  if (resolvedMember != null)   return resolvedMember;
  return resolveInternal((VM_Class)type.resolve());
}

Fixed version (ground truth):
/** 
 * Find the VM_Method that this field reference refers to using the search order specified in JVM spec 5.4.3.3.
 * @return the VM_Method that this method ref resolved to.
 */
public final synchronized VM_Method resolve(){
  if (resolvedMember != null)   return resolvedMember;
  return resolveInternal((VM_Class)type.resolve());
}
Program: 149936
Project: 149936
Buggy source:
/** 
 * Resolve the method reference for an invoke special into a target method, return null if the method cannot be resolved without classloading.
 */
public final VM_Method resolveInvokeSpecial(){
  VM_Class thisClass=(VM_Class)type.peekResolvedType();
  if (thisClass == null && name != VM_ClassLoader.StandardObjectInitializerMethodName) {
    thisClass=(VM_Class)type.resolve();
  }
  if (thisClass == null)   return null;
  VM_Method sought=resolveInternal(thisClass);
  if (sought.isObjectInitializer())   return sought;
  VM_Class cls=sought.getDeclaringClass();
  if (!cls.isSpecial())   return sought;
  for (; cls != null; cls=cls.getSuperClass()) {
    VM_Method found=cls.findDeclaredMethod(sought.getName(),sought.getDescriptor());
    if (found != null)     return found;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Resolve the method reference for an invoke special into a target method, return null if the method cannot be resolved without classloading.
 */
public final synchronized VM_Method resolveInvokeSpecial(){
  VM_Class thisClass=(VM_Class)type.peekResolvedType();
  if (thisClass == null && name != VM_ClassLoader.StandardObjectInitializerMethodName) {
    thisClass=(VM_Class)type.resolve();
  }
  if (thisClass == null)   return null;
  VM_Method sought=resolveInternal(thisClass);
  if (sought.isObjectInitializer())   return sought;
  VM_Class cls=sought.getDeclaringClass();
  if (!cls.isSpecial())   return sought;
  for (; cls != null; cls=cls.getSuperClass()) {
    VM_Method found=cls.findDeclaredMethod(sought.getName(),sought.getDescriptor());
    if (found != null)     return found;
  }
  return null;
}
Program: 149938
Project: 149938
Buggy source:
/** 
 * What is the first word after the array?
 */
public static Address getObjectEndAddress(Object obj,VM_Array type,int numElements){
  int size=type.getInstanceSize(numElements);
  if (ADDRESS_BASED_HASHING) {
    Word hashState=VM_Magic.getWordAtOffset(obj,STATUS_OFFSET).and(HASH_STATE_MASK);
    if (hashState.NE(HASH_STATE_UNHASHED)) {
      size+=HASHCODE_BYTES;
    }
  }
  return VM_Magic.objectAsAddress(obj).plus(VM_Memory.alignUp(size,BYTES_IN_INT) - OBJECT_REF_OFFSET);
}

Fixed version (ground truth):
/** 
 * What is the first word after the array?
 */
public static Address getObjectEndAddress(Object obj,VM_Array type,int numElements){
  int size=type.getInstanceSize(numElements);
  if (ADDRESS_BASED_HASHING && DYNAMIC_HASH_OFFSET) {
    Word hashState=VM_Magic.getWordAtOffset(obj,STATUS_OFFSET).and(HASH_STATE_MASK);
    if (hashState.EQ(HASH_STATE_HASHED_AND_MOVED)) {
      size+=HASHCODE_BYTES;
    }
  }
  return VM_Magic.objectAsAddress(obj).plus(VM_Memory.alignUp(size,BYTES_IN_INT) - OBJECT_REF_OFFSET);
}
Program: 149939
Project: 149939
Buggy source:
@Inline protected static Object getReferenceWhenCopiedTo(Object obj,Address to){
  if (ADDRESS_BASED_HASHING) {
    Word statusWord=VM_Magic.getWordAtOffset(obj,STATUS_OFFSET);
    Word hashState=statusWord.and(HASH_STATE_MASK);
    if (hashState.EQ(HASH_STATE_HASHED) && !DYNAMIC_HASH_OFFSET) {
      to=to.plus(HASHCODE_BYTES);
    }
  }
  return VM_Magic.addressAsObject(to.plus(OBJECT_REF_OFFSET));
}

Fixed version (ground truth):
@Inline protected static Object getReferenceWhenCopiedTo(Object obj,Address to){
  if (ADDRESS_BASED_HASHING && !DYNAMIC_HASH_OFFSET) {
    Word statusWord=VM_Magic.getWordAtOffset(obj,STATUS_OFFSET);
    Word hashState=statusWord.and(HASH_STATE_MASK);
    if (hashState.EQ(HASH_STATE_HASHED)) {
      to=to.plus(HASHCODE_BYTES);
    }
  }
  return VM_Magic.addressAsObject(to.plus(OBJECT_REF_OFFSET));
}
Program: 149944
Project: 149944
Buggy source:
/** 
 * Helper function for   {@link #dumpStack(Address,Address)}.  Print a stack frame showing the method.  
 */
private static void showMethod(VM_Method method,int lineNumber){
  VM.sysWrite("String_Node_Str");
  if (method == null) {
    VM.sysWrite("String_Node_Str");
  }
 else {
    VM.sysWrite(method.getDeclaringClass().getDescriptor());
    VM.sysWrite("String_Node_Str");
    VM.sysWrite(method.getName());
    VM.sysWrite(method.getDescriptor());
  }
  if (lineNumber > 0) {
    VM.sysWrite("String_Node_Str");
    VM.sysWriteInt(lineNumber);
  }
  VM.sysWrite("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Helper function for   {@link #dumpStack(Address,Address)}.  Print a stack frame showing the method.  
 */
private static void showMethod(VM_Method method,int lineNumber,Address fp){
  showPrologue(fp);
  if (method == null) {
    VM.sysWrite("String_Node_Str");
  }
 else {
    VM.sysWrite(method.getDeclaringClass().getDescriptor());
    VM.sysWrite("String_Node_Str");
    VM.sysWrite(method.getName());
    VM.sysWrite(method.getDescriptor());
  }
  if (lineNumber > 0) {
    VM.sysWrite("String_Node_Str");
    VM.sysWriteInt(lineNumber);
  }
  VM.sysWrite("String_Node_Str");
}
Program: 149949
Project: 149949
Buggy source:
/** 
 * Allocate a new spill location and grow the frame size to reflect the new layout.
 * @param type the type to spill
 * @return the spill location
 */
public final int allocateNewSpillLocation(int type){
  spillPointer+=OPT_PhysicalRegisterSet.getSpillSize(type);
  if (spillPointer > frameSize) {
    frameSize=spillPointer;
  }
  return spillPointer - OPT_PhysicalRegisterSet.getSpillSize(type);
}

Fixed version (ground truth):
/** 
 * Allocate a new spill location and grow the frame size to reflect the new layout.
 * @param type the type to spill
 * @return the spill location
 */
public final int allocateNewSpillLocation(int type){
  int spillSize=OPT_PhysicalRegisterSet.getSpillSize(type);
  spillPointer=align(spillPointer,spillSize);
  spillPointer+=spillSize;
  if (spillPointer > frameSize) {
    frameSize=spillPointer;
  }
  return spillPointer - spillSize;
}
Program: 149950
Project: 149950
Buggy source:
/** 
 * Create a new driver for a generational immortal space.
 * @param server The GCspy ServerInterpreter
 * @param spaceName The name of this GCspy space
 * @param mmtkSpace The MMTk space
 * @param blockSize The tile size
 * @param mainSpace Is this the main space?
 */
@Interruptible public GenImmortalSpaceDriver(ServerInterpreter server,String spaceName,Space mmtkSpace,int blockSize,boolean mainSpace){
  super(server,spaceName,mmtkSpace,blockSize,mainSpace);
  remsetStream=createRemsetStream();
  if (DEBUG) {
    Log.write("String_Node_Str");
    Log.write(spaceName);
    Log.write("String_Node_Str");
    Log.write(blockSize);
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getStart());
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getExtent());
    Log.write("String_Node_Str");
    Log.writeln(maxTileNum);
  }
  resetData();
}

Fixed version (ground truth):
/** 
 * Create a new driver for a generational immortal space.
 * @param server The GCspy ServerInterpreter
 * @param spaceName The name of this GCspy space
 * @param mmtkSpace The MMTk space
 * @param blockSize The tile size
 * @param mainSpace Is this the main space?
 */
public GenImmortalSpaceDriver(ServerInterpreter server,String spaceName,Space mmtkSpace,int blockSize,boolean mainSpace){
  super(server,spaceName,mmtkSpace,blockSize,mainSpace);
  remsetStream=createRemsetStream();
  if (DEBUG) {
    Log.write("String_Node_Str");
    Log.write(spaceName);
    Log.write("String_Node_Str");
    Log.write(blockSize);
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getStart());
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getExtent());
    Log.write("String_Node_Str");
    Log.writeln(maxTileNum);
  }
  resetData();
}
Program: 149951
Project: 149951
Buggy source:
/** 
 * Create a new driver for this collector
 * @param server The name of the GCspy server that owns this space
 * @param spaceName The name of this driver
 * @param lospace the large object space for this allocator
 * @param blockSize The tile size
 * @param threshold the size threshold of the LOS
 * @param mainSpace Is this the main space?
 */
@Interruptible public GenLOSDriver(ServerInterpreter server,String spaceName,LargeObjectSpace lospace,int blockSize,int threshold,boolean mainSpace){
  super(server,spaceName,lospace,blockSize,threshold,mainSpace);
  remsetStream=createRemsetStream();
  resetData();
}

Fixed version (ground truth):
/** 
 * Create a new driver for this collector
 * @param server The name of the GCspy server that owns this space
 * @param spaceName The name of this driver
 * @param lospace the large object space for this allocator
 * @param blockSize The tile size
 * @param threshold the size threshold of the LOS
 * @param mainSpace Is this the main space?
 */
public GenLOSDriver(ServerInterpreter server,String spaceName,LargeObjectSpace lospace,int blockSize,int threshold,boolean mainSpace){
  super(server,spaceName,lospace,blockSize,threshold,mainSpace);
  remsetStream=createRemsetStream();
  resetData();
}
Program: 149952
Project: 149952
Buggy source:
/** 
 * Create a new driver for an immortal Contiguous MMTk space.
 * @param server The GCspy ServerInterpreter
 * @param spaceName The name of this GCspy space
 * @param mmtkSpace The MMTk space
 * @param blockSize The tile size
 * @param mainSpace Is this the main space?
 */
@Interruptible public ImmortalSpaceDriver(ServerInterpreter server,String spaceName,Space mmtkSpace,int blockSize,boolean mainSpace){
  super(server,spaceName,mmtkSpace,blockSize,mainSpace);
  if (DEBUG) {
    Log.write("String_Node_Str");
    Log.write(spaceName);
    Log.write("String_Node_Str");
    Log.write(blockSize);
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getStart());
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getExtent());
    Log.write("String_Node_Str");
    Log.writeln(maxTileNum);
  }
  registeredDrivers=new AbstractDriver[0];
}

Fixed version (ground truth):
/** 
 * Create a new driver for an immortal Contiguous MMTk space.
 * @param server The GCspy ServerInterpreter
 * @param spaceName The name of this GCspy space
 * @param mmtkSpace The MMTk space
 * @param blockSize The tile size
 * @param mainSpace Is this the main space?
 */
public ImmortalSpaceDriver(ServerInterpreter server,String spaceName,Space mmtkSpace,int blockSize,boolean mainSpace){
  super(server,spaceName,mmtkSpace,blockSize,mainSpace);
  if (DEBUG) {
    Log.write("String_Node_Str");
    Log.write(spaceName);
    Log.write("String_Node_Str");
    Log.write(blockSize);
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getStart());
    Log.write("String_Node_Str");
    Log.write(mmtkSpace.getExtent());
    Log.write("String_Node_Str");
    Log.writeln(maxTileNum);
  }
  registeredDrivers=new AbstractDriver[0];
}
Program: 149953
Project: 149953
Buggy source:
/** 
 * Can we store an object of type RHSType in a variable of type LHSType? Assumption. LHSType and RHSType are already resolved.
 * @param LHSType the left-hand-side type
 * @param RHSType the right-hand-size type
 * @return <code>true</code> if we can store an object of RHSType into a variable of type LSType or <code>false</code> if we cannot.
 */
public static boolean instanceOfResolved(VM_Type LHSType,VM_Type RHSType){
  int LHSDimension=LHSType.getDimensionality();
  int RHSDimension=RHSType.getDimensionality();
  if (LHSDimension < 0 || RHSDimension < 0)   return false;
  if (LHSDimension == 0)   return instanceOfNonArray(LHSType.asClass(),RHSType.getTypeInformationBlock());
  VM_Type LHSInnermostElementType=LHSType.asArray().getInnermostElementType();
  if (LHSInnermostElementType == VM_Type.JavaLangObjectType) {
    if (RHSDimension < LHSDimension)     return false;
    if (RHSDimension > LHSDimension)     return true;
    return RHSType.asArray().getInnermostElementType().isClassType();
  }
 else   if (!LHSInnermostElementType.isPrimitiveType()) {
    if (RHSDimension != LHSDimension)     return false;
    VM_Type RHSInnermostElementType=RHSType.asArray().getInnermostElementType();
    if (RHSInnermostElementType.isPrimitiveType())     return false;
    return instanceOfNonArray(LHSInnermostElementType.asClass(),RHSInnermostElementType.getTypeInformationBlock());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Can we store an object of type RHSType in a variable of type LHSType? Assumption. LHSType and RHSType are already resolved.
 * @param LHSType the left-hand-side type
 * @param RHSType the right-hand-size type
 * @return <code>true</code> if we can store an object of RHSType into a variable of type LSType or <code>false</code> if we cannot.
 */
public static boolean instanceOfResolved(VM_Type LHSType,VM_Type RHSType){
  int LHSDimension=LHSType.getDimensionality();
  int RHSDimension=RHSType.getDimensionality();
  if (LHSDimension < 0 || RHSDimension < 0)   return false;
  if (LHSDimension == 0)   return instanceOfNonArray(LHSType.asClass(),RHSType.getTypeInformationBlock());
  VM_Type LHSInnermostElementType=LHSType.asArray().getInnermostElementType();
  if (LHSInnermostElementType == VM_Type.JavaLangObjectType) {
    if (RHSDimension < LHSDimension)     return false;
    if (RHSDimension > LHSDimension)     return true;
    return RHSType.asArray().getInnermostElementType().isClassType();
  }
 else   if (!LHSInnermostElementType.isPrimitiveType()) {
    if (RHSDimension == LHSDimension) {
      VM_Type RHSInnermostElementType=RHSType.asArray().getInnermostElementType();
      if (RHSInnermostElementType.isPrimitiveType())       return false;
      return instanceOfNonArray(LHSInnermostElementType.asClass(),RHSInnermostElementType.getTypeInformationBlock());
    }
 else {
      return (LHSDimension < RHSDimension && (LHSInnermostElementType == VM_Type.JavaLangCloneableType || LHSInnermostElementType == VM_Type.JavaIoSerializableType));
    }
  }
 else {
    return false;
  }
}
Program: 149954
Project: 149954
Buggy source:
/** 
 * Return the innermost element type reference for an array
 */
public final VM_TypeReference getInnermostElementType(){
  if (isWordArrayType() || isCodeArrayType()) {
    return getArrayElementType();
  }
 else {
    return findOrCreate(classloader,name.parseForInnermostArrayElementDescriptor());
  }
}

Fixed version (ground truth):
/** 
 * Return the innermost element type reference for an array
 */
public final VM_TypeReference getInnermostElementType(){
  VM_TypeReference elem=getArrayElementType();
  if (elem.isArrayType()) {
    return elem.getInnermostElementType();
  }
 else {
    return elem;
  }
}
Program: 149955
Project: 149955
Buggy source:
public int compare(Object a,Object b){
  if (a == null)   return 1;
  if (b == null)   return -1;
  if ((a instanceof VM_Type) && (b instanceof VM_Type)) {
    VM_Type typeA=(VM_Type)a;
    VM_Type typeB=(VM_Type)b;
    DemographicInformation infoA=(DemographicInformation)demographicData.get(typeA);
    if (infoA == null)     return 1;
    DemographicInformation infoB=(DemographicInformation)demographicData.get(typeA);
    if (infoB == null)     return -1;
    if (infoA.size > infoB.size)     return -1;
    if (infoA.size < infoB.size)     return 1;
    return 0;
  }
  return 0;
}

Fixed version (ground truth):
public int compare(Object a,Object b){
  if (a == null)   return 1;
  if (b == null)   return -1;
  if ((a instanceof VM_Type) && (b instanceof VM_Type)) {
    VM_Type typeA=(VM_Type)a;
    VM_Type typeB=(VM_Type)b;
    DemographicInformation infoA=(DemographicInformation)demographicData.get(typeA);
    if (infoA == null)     return 1;
    DemographicInformation infoB=(DemographicInformation)demographicData.get(typeB);
    if (infoB == null)     return -1;
    if (infoA.size > infoB.size)     return -1;
    if (infoA.size < infoB.size)     return 1;
    return 0;
  }
  return 0;
}
Program: 149957
Project: 149957
Buggy source:
/** 
 * Is the given operand a branch target?
 * @see #getLabel
 * @see #isLabel
 * @param op the operand being queried
 * @return true if it represents a branch target
 */
boolean isImmOrLabel(OPT_Operand op){
  return (isImm(op) || isLabel(op));
}

Fixed version (ground truth):
/** 
 * Is the given operand a branch target?
 * @see #getLabel
 * @see #isLabel
 * @param op the operand being queried
 * @return true if it represents a branch target
 */
boolean isImmOrLabel(OPT_Operand op) throws NoInlinePragma {
  return (isImm(op) || isLabel(op));
}
Program: 149958
Project: 149958
Buggy source:
private static Word roundDown(Word value,int logBase){
  Word mask=Word.one().lsh(logBase).minus(Word.one()).not();
  return value.and(mask);
}

Fixed version (ground truth):
public static int roundDown(int value,int alignment){
  return value & ~(alignment - 1);
}
Program: 149959
Project: 149959
Buggy source:
/** 
 * This method calculates the minimum size that will guarantee the allocation of a specified number of bytes at the specified alignment.
 * @param size The number of bytes (not aligned).
 * @param alignment The requested alignment (some factor of 2).
 * @param knownAlignment The known minimum alignment. Specifically for use inallocators that enforce greater than particle alignment.
 */
final public static int getMaximumAlignedSize(int size,int alignment,int knownAlignment) throws InlinePragma {
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(knownAlignment >= MIN_ALIGNMENT);
  if (MAX_ALIGNMENT <= MIN_ALIGNMENT || alignment <= knownAlignment) {
    return size;
  }
 else {
    return size + alignment - knownAlignment;
  }
}

Fixed version (ground truth):
/** 
 * This method calculates the minimum size that will guarantee the allocation of a specified number of bytes at the specified alignment.
 * @param size The number of bytes (not aligned).
 * @param alignment The requested alignment (some factor of 2).
 * @param knownAlignment The known minimum alignment. Specifically for use inallocators that enforce greater than particle alignment. It is a <b>precondition</b> that size is aligned to knownAlignment, and that knownAlignment >= MIN_ALGINMENT.
 */
final public static int getMaximumAlignedSize(int size,int alignment,int knownAlignment) throws InlinePragma {
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(size == Conversions.roundDown(size,knownAlignment));
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(knownAlignment >= MIN_ALIGNMENT);
  if (MAX_ALIGNMENT <= MIN_ALIGNMENT || alignment <= knownAlignment) {
    return size;
  }
 else {
    return size + alignment - knownAlignment;
  }
}
Program: 149960
Project: 149960
Buggy source:
/** 
 * Allocate an array object.
 * @param numElements number of array elements
 * @param logElementSize size in bytes of an array element, log base 2.
 * @param headerSize size in bytes of array header
 * @param tib type information block for array object
 * @param allocator int that encodes which allocator should be used
 * @param align the alignment requested; must be a power of 2.
 * @param offset the offset at which the alignment is desired.
 * @param site allocation site.
 * @return array object with header installed and all elements set to zero/null See also: bytecode 0xbc ("newarray") and 0xbd ("anewarray")
 */
public static Object allocateArray(int numElements,int logElementSize,int headerSize,Object[] tib,int allocator,int align,int offset,int site) throws UninterruptiblePragma, InlinePragma {
  SelectedMutatorContext mutator=SelectedMutatorContext.get();
  int elemBytes=numElements << logElementSize;
  if ((elemBytes >>> logElementSize) != numElements) {
    Assert.failWithOutOfMemoryErrorStatic();
  }
  int size=elemBytes + headerSize;
  allocator=mutator.checkAllocator(size,align,allocator);
  Address region=allocateSpace(mutator,size,align,offset,allocator,site);
  Object result=VM_ObjectModel.initializeArray(region,tib,numElements,size);
  mutator.postAlloc(ObjectReference.fromObject(result),ObjectReference.fromObject(tib),size,allocator);
  return result;
}

Fixed version (ground truth):
/** 
 * Allocate an array object.
 * @param numElements number of array elements
 * @param logElementSize size in bytes of an array element, log base 2.
 * @param headerSize size in bytes of array header
 * @param tib type information block for array object
 * @param allocator int that encodes which allocator should be used
 * @param align the alignment requested; must be a power of 2.
 * @param offset the offset at which the alignment is desired.
 * @param site allocation site.
 * @return array object with header installed and all elements set to zero/null See also: bytecode 0xbc ("newarray") and 0xbd ("anewarray")
 */
public static Object allocateArray(int numElements,int logElementSize,int headerSize,Object[] tib,int allocator,int align,int offset,int site) throws UninterruptiblePragma, InlinePragma {
  SelectedMutatorContext mutator=SelectedMutatorContext.get();
  int elemBytes=numElements << logElementSize;
  if ((elemBytes >>> logElementSize) != numElements) {
    Assert.failWithOutOfMemoryErrorStatic();
  }
  int size=elemBytes + headerSize;
  allocator=mutator.checkAllocator(VM_Memory.alignUp(size,MIN_ALIGNMENT),align,allocator);
  Address region=allocateSpace(mutator,size,align,offset,allocator,site);
  Object result=VM_ObjectModel.initializeArray(region,tib,numElements,size);
  mutator.postAlloc(ObjectReference.fromObject(result),ObjectReference.fromObject(tib),size,allocator);
  return result;
}
Program: 149961
Project: 149961
Buggy source:
/** 
 * Allocate a scalar object.
 * @param size Size in bytes of the object, including any headersthat need space.
 * @param tib  Type of the object (pointer to TIB).
 * @param allocator Specify which allocation scheme/area JMTk shouldallocate the memory from.
 * @param align the alignment requested; must be a power of 2.
 * @param offset the offset at which the alignment is desired.
 * @param site allocation site.
 * @return the initialized Object
 */
public static Object allocateScalar(int size,Object[] tib,int allocator,int align,int offset,int site) throws UninterruptiblePragma, InlinePragma {
  SelectedMutatorContext mutator=SelectedMutatorContext.get();
  allocator=mutator.checkAllocator(size,align,allocator);
  Address region=allocateSpace(mutator,size,align,offset,allocator,site);
  Object result=VM_ObjectModel.initializeScalar(region,tib,size);
  mutator.postAlloc(ObjectReference.fromObject(result),ObjectReference.fromObject(tib),size,allocator);
  return result;
}

Fixed version (ground truth):
/** 
 * Allocate a scalar object.
 * @param size Size in bytes of the object, including any headersthat need space.
 * @param tib  Type of the object (pointer to TIB).
 * @param allocator Specify which allocation scheme/area JMTk shouldallocate the memory from.
 * @param align the alignment requested; must be a power of 2.
 * @param offset the offset at which the alignment is desired.
 * @param site allocation site.
 * @return the initialized Object
 */
public static Object allocateScalar(int size,Object[] tib,int allocator,int align,int offset,int site) throws UninterruptiblePragma, InlinePragma {
  SelectedMutatorContext mutator=SelectedMutatorContext.get();
  allocator=mutator.checkAllocator(VM_Memory.alignUp(size,MIN_ALIGNMENT),align,allocator);
  Address region=allocateSpace(mutator,size,align,offset,allocator,site);
  Object result=VM_ObjectModel.initializeScalar(region,tib,size);
  mutator.postAlloc(ObjectReference.fromObject(result),ObjectReference.fromObject(tib),size,allocator);
  return result;
}
Program: 149962
Project: 149962
Buggy source:
/** 
 * Close the tail buffer (normalizing if necessary), and enqueue it at the tail of the shared buffer queue.
 * @param arity The arity of this buffer.
 */
private final void closeAndEnqueueTail(int arity) throws NoInlinePragma {
  Address last;
  if (!bufferOffset(tail).isZero()) {
    last=normalizeTail(arity);
  }
 else {
    last=tail.plus(bufferLastOffset(arity));
  }
  queue.enqueue(last.plus(BYTES_IN_ADDRESS),arity,true);
}

Fixed version (ground truth):
/** 
 * Close the tail buffer (normalizing if necessary), and enqueue it at the tail of the shared buffer queue.
 * @param arity The arity of this buffer.
 */
private final void closeAndEnqueueTail(int arity) throws NoInlinePragma {
  Address last;
  if (!bufferOffset(tail).isZero()) {
    last=normalizeTail(arity);
  }
 else {
    last=tailBufferEnd.minus(BYTES_IN_ADDRESS);
  }
  queue.enqueue(last.plus(BYTES_IN_ADDRESS),arity,true);
}
Program: 149963
Project: 149963
Buggy source:
/** 
 * Find or allocate a slot in the jtoc for a class literal
 * @param typeReferenceID the type reference ID for the class
 * @return the offset of slot that was allocated
 */
public static int findOrCreateClassLiteral(int typeReferenceID){
  Class literalAsClass=VM_TypeReference.getTypeRef(typeReferenceID).resolve().asClass().getClassForType();
  Integer offAsInt;
synchronized (objectLiterals) {
    offAsInt=(Integer)objectLiterals.get(literalAsClass);
  }
  if (offAsInt != null) {
    return offAsInt.intValue();
  }
 else {
    Offset newOff=allocateReferenceSlot();
    Integer newOffAsInt=new Integer(newOff.toInt());
synchronized (objectLiterals) {
      objectLiterals.put(literalAsClass,newOffAsInt);
      setSlotContents(newOff,literalAsClass);
    }
    return newOff.toInt();
  }
}

Fixed version (ground truth):
/** 
 * Find or allocate a slot in the jtoc for a class literal
 * @param typeReferenceID the type reference ID for the class
 * @return the offset of slot that was allocated
 */
public static int findOrCreateClassLiteral(int typeReferenceID){
  Class literalAsClass=VM_TypeReference.getTypeRef(typeReferenceID).resolve().getClassForType();
  Integer offAsInt;
synchronized (objectLiterals) {
    offAsInt=(Integer)objectLiterals.get(literalAsClass);
  }
  if (offAsInt != null) {
    return offAsInt.intValue();
  }
 else {
    Offset newOff=allocateReferenceSlot();
    Integer newOffAsInt=new Integer(newOff.toInt());
synchronized (objectLiterals) {
      objectLiterals.put(literalAsClass,newOffAsInt);
      setSlotContents(newOff,literalAsClass);
    }
    return newOff.toInt();
  }
}
Program: 149965
Project: 149965
Buggy source:
/** 
 * Constructor
 * @param trace The shared deque that is used.
 */
public DecBuffer(SharedDeque queue){
  super("String_Node_Str",queue);
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param queue The shared deque that is used.
 */
public DecBuffer(SharedDeque queue){
  super("String_Node_Str",queue);
}
Program: 149966
Project: 149966
Buggy source:
/** 
 * Vist as many purple objects as time allows and transitively mark grey. This means "pretending" that the initial object is dead, and thus applying temporary decrements to each of the object's decendents.
 * @param timeCap The time by which we must stop markinggrey.
 */
private final void doMarkGreyPhase(){
  ObjectReference object=ObjectReference.nullReference();
  while (!(object=filteredPurpleBuffer.pop()).isNull()) {
    processGreyObject(object,cycleBufferA);
  }
}

Fixed version (ground truth):
/** 
 * Vist as many purple objects as time allows and transitively mark grey. This means "pretending" that the initial object is dead, and thus applying temporary decrements to each of the object's decendents.
 */
private final void doMarkGreyPhase(){
  ObjectReference object=ObjectReference.nullReference();
  while (!(object=filteredPurpleBuffer.pop()).isNull()) {
    processGreyObject(object,cycleBufferA);
  }
}
Program: 149967
Project: 149967
Buggy source:
/** 
 * Return the allocator instance associated with a space <code>space</code>, for this plan instance.  This exists to support   {@link org.mmtk.plan.CollectorContext#getOwnAllocator(Allocator)}.
 * @see org.mmtk.plan.CollectorContext#getOwnAllocator(Allocator)
 * @param space The space for which the allocator instance is desired.
 * @return The allocator instance associated with this plan instancewhich is allocating into <code>space</code>, or <code>null</code> if no appropriate allocator can be established.
 */
public final Allocator getAllocatorFromSpace(Space space){
  if (space == GenRC.nurserySpace)   return nursery;
  return super.getAllocatorFromSpace(space);
}

Fixed version (ground truth):
/** 
 * Return the allocator instance associated with a space <code>space</code>, for this plan instance.  This exists to support   {@link org.mmtk.plan.MutatorContext#getOwnAllocator(Allocator)}.
 * @see org.mmtk.plan.MutatorContext#getOwnAllocator(Allocator)
 * @param space The space for which the allocator instance is desired.
 * @return The allocator instance associated with this plan instancewhich is allocating into <code>space</code>, or <code>null</code> if no appropriate allocator can be established.
 */
public final Allocator getAllocatorFromSpace(Space space){
  if (space == GenRC.nurserySpace)   return nursery;
  return super.getAllocatorFromSpace(space);
}