nus-yam/ex-repair huggingface dataset:
Program: 149639
Project: 149639
Buggy source:
@Override public boolean onBlockActivated(World world,int par2,int par3,int par4,EntityPlayer player,int par6,float par7,float par8,float par9){
  if (player.getCurrentEquippedItem() == null && player.isSneaking()) {
    if (world.getBlockMetadata(par2,par3,par4) == 0) {
      world.setBlockMetadataWithNotify(par2,par3,par4,1,2);
    }
 else {
      world.setBlockMetadataWithNotify(par2,par3,par4,0,2);
    }
    return true;
  }
  if (!player.isSneaking() && world.getBlockTileEntity(par2,par3,par4) instanceof TileEntityControler) {
    if (((TileEntityControler)world.getBlockTileEntity(par2,par3,par4)).getMultiblockController().isAssembled()) {
      player.openGui(EvenMoreUtilities.instance,4,world,par2,par3,par4);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,int par2,int par3,int par4,EntityPlayer player,int par6,float par7,float par8,float par9){
  if (player.getCurrentEquippedItem() == null && player.isSneaking()) {
    world.setBlockMetadataWithNotify(par2,par3,par4,world.getBlockMetadata(par2,par3,par4) ^ 1,2);
    return true;
  }
  if (!player.isSneaking() && world.getBlockTileEntity(par2,par3,par4) instanceof TileEntityControler) {
    if (((TileEntityControler)world.getBlockTileEntity(par2,par3,par4)).getMultiblockController().isAssembled()) {
      player.openGui(EvenMoreUtilities.instance,4,world,par2,par3,par4);
      return true;
    }
  }
  return false;
}
Program: 149640
Project: 149640
Buggy source:
@Override public Icon getBlockTexture(IBlockAccess blockAccess,int x,int y,int z,int side){
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  World world=blockAccess.getBlockTileEntity(x,y,z) != null ? blockAccess.getBlockTileEntity(x,y,z).worldObj : null;
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId) {
    return transparentIcon;
  }
  if (isEnergyHandler(world,x + out.offsetX,y + out.offsetY,z + out.offsetZ))   return icons[blockAccess.getBlockMetadata(x,y,z)][15];
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || isEnergyHandler(world,x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ)) {
      iconIdx|=1 << i;
    }
  }
  return icons[blockAccess.getBlockMetadata(x,y,z)][iconIdx];
}

Fixed version (ground truth):
@Override public Icon getBlockTexture(IBlockAccess blockAccess,int x,int y,int z,int side){
  ForgeDirection[] dirsToCheck=Sides.neighborsBySide[side];
  ForgeDirection dir;
  int myBlockId=blockAccess.getBlockId(x,y,z);
  World world=blockAccess.getBlockTileEntity(x,y,z) != null ? blockAccess.getBlockTileEntity(x,y,z).worldObj : null;
  ForgeDirection out=ForgeDirection.getOrientation(side);
  if (blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + out.offsetX,y + out.offsetY,z + out.offsetZ) == myBlockId) {
    return transparentIcon;
  }
  if (isEnergyHandler(world,x + out.offsetX,y + out.offsetY,z + out.offsetZ))   return icons[getBlockType(blockAccess,x,y,z)][15];
  int iconIdx=0;
  for (int i=0; i < dirsToCheck.length; i++) {
    dir=dirsToCheck[i];
    if (blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == BlockWire.instance.blockID || blockAccess.getBlockId(x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ) == myBlockId || isEnergyHandler(world,x + dir.offsetX,y + dir.offsetY,z + dir.offsetZ)) {
      iconIdx|=1 << i;
    }
  }
  return icons[getBlockType(blockAccess,x,y,z)][iconIdx];
}
Program: 149641
Project: 149641
Buggy source:
@Override public Icon getIcon(int side,int metadata){
  return icons[metadata][0];
}

Fixed version (ground truth):
@Override public Icon getIcon(int side,int metadata){
  return icons[metadata & 1][0];
}
Program: 149642
Project: 149642
Buggy source:
@Override public boolean renderWorldBlock(IBlockAccess world,int x,int y,int z,Block block,int modelId,RenderBlocks renderer){
  renderer.renderStandardBlock(block,x,y,z);
  renderGlow(world,x,y,z,block,renderer);
  return true;
}

Fixed version (ground truth):
@Override public boolean renderWorldBlock(IBlockAccess world,int x,int y,int z,Block block,int modelId,RenderBlocks renderer){
  if (SuperConductorMod.pass == 0) {
    renderer.renderStandardBlock(block,x,y,z);
    return true;
  }
 else {
    renderGlow(world,x,y,z,block,renderer);
  }
  return true;
}
Program: 149643
Project: 149643
Buggy source:
public boolean isOutput(){
  return worldObj.getBlockMetadata(xCoord,yCoord,zCoord) == 0;
}

Fixed version (ground truth):
public boolean isOutput(){
  return (worldObj.getBlockMetadata(xCoord,yCoord,zCoord) & 1) == 0;
}
Program: 149644
Project: 149644
Buggy source:
@Override protected void isMachineWhole() throws MultiblockValidationException {
  if (controlers.size() < 3) {
    throw new MultiblockValidationException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void isMachineWhole() throws MultiblockValidationException {
  if (controlers.size() < 2) {
    throw new MultiblockValidationException("String_Node_Str");
  }
}
Program: 149645
Project: 149645
Buggy source:
@Override protected void onMachineRestored(){
}

Fixed version (ground truth):
@Override protected void onMachineRestored(){
  tank.setCapacity(connectedParts.size() * 4000);
  if (tank.getFluidAmount() > tank.getCapacity()) {
    tank.getFluid().amount=tank.getCapacity();
  }
}
Program: 149646
Project: 149646
Buggy source:
@Override protected void onBlockRemoved(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.remove((TileEntityControler)arg0);
  }
  tank.setCapacity(Math.max(0,tank.getCapacity() - 4000));
}

Fixed version (ground truth):
@Override protected void onBlockRemoved(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.remove((TileEntityControler)arg0);
  }
}
Program: 149647
Project: 149647
Buggy source:
@Override protected void onBlockAdded(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.add((TileEntityControler)arg0);
  }
  tank.setCapacity(tank.getCapacity() + 4000);
}

Fixed version (ground truth):
@Override protected void onBlockAdded(IMultiblockPart arg0){
  if (arg0 instanceof TileEntityControler) {
    controlers.add((TileEntityControler)arg0);
  }
}
Program: 149648
Project: 149648
Buggy source:
@Override protected void onMachineAssembled(){
}

Fixed version (ground truth):
@Override protected void onMachineAssembled(){
  tank.setCapacity(connectedParts.size() * 4000);
  if (tank.getFluidAmount() > tank.getCapacity()) {
    tank.getFluid().amount=tank.getCapacity();
  }
}
Program: 149649
Project: 149649
Buggy source:
@Override public boolean onBlockActivated(World world,int par2,int par3,int par4,EntityPlayer player,int par6,float par7,float par8,float par9){
  if (player.getCurrentEquippedItem() == null && player.isSneaking()) {
    if (world.getBlockMetadata(par2,par3,par4) == 0) {
      world.setBlockMetadataWithNotify(par2,par3,par4,1,2);
    }
 else {
      world.setBlockMetadataWithNotify(par2,par3,par4,0,2);
    }
    return true;
  }
  if (!player.isSneaking()) {
    player.openGui(EvenMoreUtilities.instance,4,world,par2,par3,par4);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,int par2,int par3,int par4,EntityPlayer player,int par6,float par7,float par8,float par9){
  if (player.getCurrentEquippedItem() == null && player.isSneaking()) {
    if (world.getBlockMetadata(par2,par3,par4) == 0) {
      world.setBlockMetadataWithNotify(par2,par3,par4,1,2);
    }
 else {
      world.setBlockMetadataWithNotify(par2,par3,par4,0,2);
    }
    return true;
  }
  if (!player.isSneaking() && world.getBlockTileEntity(par2,par3,par4) instanceof TileEntityControler) {
    if (((TileEntityControler)world.getBlockTileEntity(par2,par3,par4)).getMultiblockController().isAssembled()) {
      player.openGui(EvenMoreUtilities.instance,4,world,par2,par3,par4);
      return true;
    }
  }
  return false;
}
Program: 149650
Project: 149650
Buggy source:
public Optional<AmazonS3ExceptionBuilder> parse(HttpResponseStatus status,ByteBuf content) throws IOException {
  try {
    AmazonS3ExceptionBuilder response=parseResponse(status,content);
    ReferenceCountUtil.release(content);
    return Optional.of(response);
  }
  finally {
    ReferenceCountUtil.release(content);
  }
}

Fixed version (ground truth):
public Optional<AmazonS3ExceptionBuilder> parse(HttpResponseStatus status,ByteBuf content) throws IOException {
  try {
    AmazonS3ExceptionBuilder response=parseResponse(status,content);
    return Optional.of(response);
  }
  finally {
    ReferenceCountUtil.release(content);
  }
}
Program: 149653
Project: 149653
Buggy source:
@Override public void run(){
  while (!interrupted()) {
    try {
synchronized (this) {
        idleImpl();
      }
    }
 catch (    IllegalMonitorStateException e) {
      throw e;
    }
catch (    InterruptedException e) {
      return;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!interrupted()) {
    try {
synchronized (this) {
        idleImpl();
      }
    }
 catch (    InterruptedException e) {
      return;
    }
  }
}
Program: 149654
Project: 149654
Buggy source:
/** 
 * This is the findOrCreate() method through which all Atoms are ultimately created.   The constructor for Atom is a private method, so someone has to call one of the public findOrCreate() methods to get a new one.  And they all feed through here.
 */
private static Atom findOrCreate(byte[] bytes,boolean create,String str){
  Atom val=new Atom(bytes,-1,str);
  val=dictionary.get(val);
  if (val != null || !create)   return val;
synchronized (Atom.class) {
    val=new Atom(bytes,nextId++,str);
    int column=val.id >> LOG_ROW_SIZE;
    if (column == atoms.length) {
      Atom[][] tmp=new Atom[column + 1][];
      for (int i=0; i < column; i++) {
        tmp[i]=atoms[i];
      }
      atoms=tmp;
      atoms[column]=new Atom[1 << LOG_ROW_SIZE];
    }
    atoms[column][val.id & ROW_MASK]=val;
    dictionary.put(val,val);
  }
  return val;
}

Fixed version (ground truth):
/** 
 * This is the findOrCreate() method through which all Atoms are ultimately created.   The constructor for Atom is a private method, so someone has to call one of the public findOrCreate() methods to get a new one.  And they all feed through here.
 */
private static Atom findOrCreate(byte[] bytes,boolean create,String str){
  Atom val=new Atom(bytes,-1,str);
  val=dictionary.get(val);
  if (val != null || !create)   return val;
synchronized (Atom.class) {
    val=new Atom(bytes,-1,str);
    val=dictionary.get(val);
    if (val != null)     return val;
    val=new Atom(bytes,nextId++,str);
    int column=val.id >> LOG_ROW_SIZE;
    if (column == atoms.length) {
      Atom[][] tmp=new Atom[column + 1][];
      for (int i=0; i < column; i++) {
        tmp[i]=atoms[i];
      }
      atoms=tmp;
      atoms[column]=new Atom[1 << LOG_ROW_SIZE];
    }
    atoms[column][val.id & ROW_MASK]=val;
    dictionary.put(val,val);
  }
  return val;
}
Program: 149655
Project: 149655
Buggy source:
public RVMField[] finish(){
  RVMField[] result=popularFVs.get(this);
  if (result != null) {
    array=result;
    return result;
  }
 else {
    adjustLength(cnt);
    popularFVs.put(this,array);
    return array;
  }
}

Fixed version (ground truth):
public RVMField[] finish(){
synchronized (RVMField.class) {
    RVMField[] result=popularFVs.get(this);
    if (result != null) {
      array=result;
      return result;
    }
 else {
      adjustLength(cnt);
      popularFVs.put(this,array);
      return array;
    }
  }
}
Program: 149656
Project: 149656
Buggy source:
public RVMMethod[] finish(){
  RVMMethod[] result=popularMVs.get(this);
  if (result != null) {
    array=result;
    return result;
  }
 else {
    adjustLength(cnt);
    popularMVs.put(this,array);
    return array;
  }
}

Fixed version (ground truth):
public RVMMethod[] finish(){
synchronized (MethodVector.class) {
    RVMMethod[] result=popularMVs.get(this);
    if (result != null) {
      array=result;
      return result;
    }
 else {
      adjustLength(cnt);
      popularMVs.put(this,array);
      return array;
    }
  }
}
Program: 149657
Project: 149657
Buggy source:
/** 
 * Add to list of classes that derive from this one.
 */
private void addSubClass(RVMClass sub){
  int n=subClasses.length;
  RVMClass[] tmp=new RVMClass[n + 1];
  for (int i=0; i < n; ++i) {
    tmp[i]=subClasses[i];
  }
  tmp[n]=sub;
  subClasses=tmp;
}

Fixed version (ground truth):
/** 
 * Add to list of classes that derive from this one.
 */
private synchronized void addSubClass(RVMClass sub){
  int n=subClasses.length;
  RVMClass[] tmp=new RVMClass[n + 1];
  for (int i=0; i < n; ++i) {
    tmp[i]=subClasses[i];
  }
  tmp[n]=sub;
  subClasses=tmp;
}
Program: 149660
Project: 149660
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void collect(){
  Phase.beginNewPhaseStack(Phase.scheduleComplex(global().collection));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void collect(){
  if (RCBase.BUILD_FOR_GENRC)   Phase.beginNewPhaseStack(Phase.scheduleComplex(global().genRCCollection));
 else   Phase.beginNewPhaseStack(Phase.scheduleComplex(global().refCountCollection));
}
Program: 149661
Project: 149661
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void collectionPhase(short phaseId,boolean primary){
  if (phaseId == RCBase.PREPARE) {
    rc.prepare();
    return;
  }
  if (phaseId == RCBase.PROCESS_MODBUFFER) {
    modBuffer.flushLocal();
    return;
  }
  if (phaseId == RCBase.PROCESS_DECBUFFER) {
    decBuffer.flushLocal();
    return;
  }
  if (phaseId == RCBase.RELEASE) {
    if (RCBase.CC_BACKUP_TRACE && RCBase.performCycleCollection) {
      immortal.linearScan(btSweepImmortal);
    }
    rc.release();
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(modBuffer.isEmpty());
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(decBuffer.isEmpty());
    return;
  }
  super.collectionPhase(phaseId,primary);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void collectionPhase(short phaseId,boolean primary){
  if (phaseId == RCBase.PREPARE) {
    rc.prepare();
    return;
  }
  if (phaseId == RCBase.PROCESS_MODBUFFER) {
    modBuffer.flushLocal();
    return;
  }
  if (phaseId == RCBase.PROCESS_DECBUFFER) {
    decBuffer.flushLocal();
    return;
  }
  if (phaseId == RCBase.RELEASE) {
    if (RCBase.CC_BACKUP_TRACE && RCBase.performCycleCollection) {
      immortal.linearScan(btSweepImmortal);
    }
    rc.release();
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(modBuffer.isEmpty());
    if (!RCBase.BUILD_FOR_GENRC) {
      if (VM.VERIFY_ASSERTIONS)       VM.assertions._assert(decBuffer.isEmpty());
    }
    return;
  }
  super.collectionPhase(phaseId,primary);
}
Program: 149662
Project: 149662
Buggy source:
@Override @Inline public void postAlloc(ObjectReference ref,ObjectReference typeRef,int bytes,int allocator){
switch (allocator) {
case RCBase.ALLOC_DEFAULT:
case RCBase.ALLOC_NON_MOVING:
case RCBase.ALLOC_CODE:
    break;
case RCBase.ALLOC_LOS:
case RCBase.ALLOC_PRIMITIVE_LOS:
case RCBase.ALLOC_LARGE_CODE:
  decBuffer.push(ref);
RCBase.rcloSpace.initializeHeader(ref,true);
return;
case RCBase.ALLOC_IMMORTAL:
decBuffer.push(ref);
return;
default :
VM.assertions.fail("String_Node_Str");
return;
}
}

Fixed version (ground truth):
@Override @Inline public void postAlloc(ObjectReference ref,ObjectReference typeRef,int bytes,int allocator){
switch (allocator) {
case RCBase.ALLOC_DEFAULT:
case RCBase.ALLOC_NON_MOVING:
    if (RCBase.BUILD_FOR_GENRC)     modBuffer.push(ref);
case RCBase.ALLOC_CODE:
  if (RCBase.BUILD_FOR_GENRC) {
    decBuffer.push(ref);
    RCHeader.initializeHeader(ref,true);
    ExplicitFreeListSpace.unsyncSetLiveBit(ref);
  }
break;
case RCBase.ALLOC_LOS:
if (RCBase.BUILD_FOR_GENRC) modBuffer.push(ref);
case RCBase.ALLOC_PRIMITIVE_LOS:
case RCBase.ALLOC_LARGE_CODE:
decBuffer.push(ref);
if (RCBase.BUILD_FOR_GENRC) RCHeader.initializeHeader(ref,true);
RCBase.rcloSpace.initializeHeader(ref,true);
return;
case RCBase.ALLOC_IMMORTAL:
if (RCBase.BUILD_FOR_GENRC) modBuffer.push(ref);
decBuffer.push(ref);
if (RCBase.BUILD_FOR_GENRC) RCHeader.initializeHeader(ref,true);
return;
default :
VM.assertions.fail("String_Node_Str");
return;
}
}
Program: 149663
Project: 149663
Buggy source:
/** 
 * Initialize the reference count of an object.  Return either <code>INC_OLD</code> if the object is not new, <code>INC_NEW</code> if the object is new.
 * @param object The object whose RC is to be initialized.
 * @return <code>INC_OLD</code> if the object is not new,<code>INC_NEW</code> if the object is new.
 */
@Inline public static int initRC(ObjectReference object){
  Word oldValue, newValue;
  int rtn;
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(RCBase.isRCObject(object));
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    newValue=oldValue.and(WRITE_MASK).or(INCREMENT);
    if (isHeaderNew(oldValue)) {
      newValue=newValue.or(NEW_BIT_MASK);
      rtn=INC_NEW;
    }
 else {
      rtn=INC_OLD;
    }
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,newValue));
  return rtn;
}

Fixed version (ground truth):
/** 
 * Initialize the reference count of an object.  Return either <code>INC_OLD</code> if the object is not new, <code>INC_NEW</code> if the object is new.
 * @param object The object whose RC is to be initialized.
 * @return <code>INC_OLD</code> if the object is not new,<code>INC_NEW</code> if the object is new.
 */
@Inline public static int initRC(ObjectReference object){
  Word oldValue, newValue;
  int rtn;
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(RCBase.isRCObject(object));
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    newValue=oldValue.and(WRITE_MASK).or(INCREMENT);
    if (RCBase.BUILD_FOR_GENRC) {
      rtn=INC_OLD;
    }
 else {
      if (isHeaderNew(oldValue)) {
        newValue=newValue.or(NEW_BIT_MASK);
        rtn=INC_NEW;
      }
 else {
        rtn=INC_OLD;
      }
    }
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,newValue));
  return rtn;
}
Program: 149664
Project: 149664
Buggy source:
/** 
 * Increment the reference count of an object.  Return either <code>INC_OLD</code> if the object is not new, <code>INC_NEW</code> if the object is new.
 * @param object The object whose RC is to be incremented.
 * @return <code>INC_OLD</code> if the object is not new,<code>INC_NEW</code> if the object is new.
 */
@Inline public static int incRC(ObjectReference object){
  Word oldValue, newValue;
  int rtn;
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(RCBase.isRCObject(object));
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    if (isStuck(oldValue))     return INC_OLD;
    if (isHeaderNew(oldValue)) {
      newValue=oldValue.plus(DOUBLE_INCREMENT);
      newValue=newValue.or(NEW_BIT_MASK);
      rtn=INC_NEW;
    }
 else {
      newValue=oldValue.plus(INCREMENT);
      rtn=INC_OLD;
    }
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,newValue));
  return rtn;
}

Fixed version (ground truth):
/** 
 * Increment the reference count of an object.  Return either <code>INC_OLD</code> if the object is not new, <code>INC_NEW</code> if the object is new.
 * @param object The object whose RC is to be incremented.
 * @return <code>INC_OLD</code> if the object is not new,<code>INC_NEW</code> if the object is new.
 */
@Inline public static int incRC(ObjectReference object){
  Word oldValue, newValue;
  int rtn;
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(RCBase.isRCObject(object));
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    if (isStuck(oldValue))     return INC_OLD;
    if (RCBase.BUILD_FOR_GENRC) {
      newValue=oldValue.plus(INCREMENT);
      rtn=INC_OLD;
    }
 else {
      if (isHeaderNew(oldValue)) {
        newValue=oldValue.plus(DOUBLE_INCREMENT);
        newValue=newValue.or(NEW_BIT_MASK);
        rtn=INC_NEW;
      }
 else {
        newValue=oldValue.plus(INCREMENT);
        rtn=INC_OLD;
      }
    }
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,newValue));
  return rtn;
}
Program: 149665
Project: 149665
Buggy source:
/** 
 * Retain the reference count of an object.  Return either <code>INC_OLD</code> if the object is not new, <code>INC_NEW</code> if the object is new.
 * @param object The object whose RC is to be retained.
 * @return <code>INC_OLD</code> if the object is not new,<code>INC_NEW</code> if the object is new.
 */
@Inline public static int remainRC(ObjectReference object){
  Word oldValue, newValue;
  int rtn;
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(RCBase.isRCObject(object));
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    newValue=oldValue;
    if (isHeaderNew(oldValue)) {
      newValue=newValue.or(NEW_BIT_MASK);
      rtn=INC_NEW;
    }
 else {
      return INC_OLD;
    }
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,newValue));
  return rtn;
}

Fixed version (ground truth):
/** 
 * Retain the reference count of an object.  Return either <code>INC_OLD</code> if the object is not new, <code>INC_NEW</code> if the object is new.
 * @param object The object whose RC is to be retained.
 * @return <code>INC_OLD</code> if the object is not new,<code>INC_NEW</code> if the object is new.
 */
@Inline public static int remainRC(ObjectReference object){
  Word oldValue, newValue;
  int rtn;
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(RCBase.isRCObject(object));
  do {
    oldValue=VM.objectModel.prepareAvailableBits(object);
    newValue=oldValue;
    if (RCBase.BUILD_FOR_GENRC) {
      return INC_OLD;
    }
 else {
      if (isHeaderNew(oldValue)) {
        newValue=newValue.or(NEW_BIT_MASK);
        rtn=INC_NEW;
      }
 else {
        return INC_OLD;
      }
    }
  }
 while (!VM.objectModel.attemptAvailableBits(object,oldValue,newValue));
  return rtn;
}
Program: 149666
Project: 149666
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final void collectionPhase(short phaseId,boolean primary){
  if (phaseId == RCBase.PREPARE) {
    super.collectionPhase(phaseId,primary);
    rc.prepare();
    return;
  }
  if (phaseId == RCBase.RELEASE) {
    rc.release();
    super.collectionPhase(phaseId,primary);
    return;
  }
  super.collectionPhase(phaseId,primary);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final void collectionPhase(short phaseId,boolean primary){
  if (phaseId == RCBase.PREPARE) {
    super.collectionPhase(phaseId,primary);
    rc.prepare();
    return;
  }
  if (phaseId == RCBase.CLOSURE) {
    super.collectionPhase(phaseId,primary);
    rc.flush();
    return;
  }
  if (phaseId == RCBase.RELEASE) {
    rc.release();
    super.collectionPhase(phaseId,primary);
    return;
  }
  super.collectionPhase(phaseId,primary);
}
Program: 149667
Project: 149667
Buggy source:
@Override public boolean hasPrevious(){
  return cursor != l.head;
}

Fixed version (ground truth):
@Override public boolean hasPrevious(){
  return cursor != null && cursor != l.head;
}
Program: 149668
Project: 149668
Buggy source:
public final boolean compare(Stack<T> s2){
  Iterator<T> i1=iterator();
  Iterator<T> i2=s2.iterator();
  if (isEmpty() && s2.isEmpty()) {
    return true;
  }
 else   if (isEmpty() || s2.isEmpty()) {
    return false;
  }
  for (T t1=i1.next(), t2=i2.next(); i1.hasNext() && i2.hasNext(); ) {
    if (t1 != t2) {
      return false;
    }
  }
  return !i1.hasNext() && !i2.hasNext();
}

Fixed version (ground truth):
public final boolean compare(Stack<T> s2){
  Iterator<T> i1=iterator();
  Iterator<T> i2=s2.iterator();
  if (isEmpty() && s2.isEmpty()) {
    return true;
  }
 else   if (isEmpty() || s2.isEmpty()) {
    return false;
  }
  for (T t1=i1.next(), t2=i2.next(); i1.hasNext() && i2.hasNext(); ) {
    if (t1 != t2) {
      return false;
    }
    t1=i1.next();
    t2=i2.next();
  }
  return !i1.hasNext() && !i2.hasNext();
}
Program: 149669
Project: 149669
Buggy source:
/** 
 * Perform the actual read of a boolean read barrier.
 * @param objref The object that has the boolean field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final boolean booleanRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getByteAtOffset(objref.toObject(),offset.toOffset()) == 0;
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a boolean read barrier.
 * @param objref The object that has the boolean field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final boolean booleanRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getByteAtOffset(objref.toObject(),offset.toOffset()) == 0;
}
Program: 149670
Project: 149670
Buggy source:
/** 
 * Perform the actual read of a char read barrier.
 * @param objref The object that has the char field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final char charRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getCharAtOffset(objref.toObject(),offset.toOffset());
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a char read barrier.
 * @param objref The object that has the char field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final char charRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getCharAtOffset(objref.toObject(),offset.toOffset());
}
Program: 149671
Project: 149671
Buggy source:
/** 
 * Perform the actual read of a int read barrier.
 * @param objref The object that has the int field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final int intRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getIntAtOffset(objref.toObject(),offset.toOffset());
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a int read barrier.
 * @param objref The object that has the int field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final int intRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getIntAtOffset(objref.toObject(),offset.toOffset());
}
Program: 149672
Project: 149672
Buggy source:
/** 
 * Perform the actual write of the non-heap write barrier.  This is used when the store is not to an object, but to a non-heap location such as statics or the stack.
 * @param target The value that the slot will be updated to
 * @param unusedA The offset from the ref
 * @param unusedB Unused
 * @param ref The object that has the reference field
 */
@Inline @Override public final void objectReferenceNonHeapWrite(Address slot,ObjectReference target,Word unusedA,Word unusedB){
  slot.store(target);
}

Fixed version (ground truth):
/** 
 * Perform the actual write of the non-heap write barrier.  This is used when the store is not to an object, but to a non-heap location such as statics or the stack.
 * @param slot The slot to be updated
 * @param target The value that the slot will be updated to
 * @param unusedA Unused
 * @param unusedB Unused
 */
@Inline @Override public final void objectReferenceNonHeapWrite(Address slot,ObjectReference target,Word unusedA,Word unusedB){
  slot.store(target);
}
Program: 149673
Project: 149673
Buggy source:
/** 
 * Perform the actual read of a byte read barrier.
 * @param objref The object that has the byte field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final byte byteRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getByteAtOffset(objref.toObject(),offset.toOffset());
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a byte read barrier.
 * @param objref The object that has the byte field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final byte byteRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getByteAtOffset(objref.toObject(),offset.toOffset());
}
Program: 149674
Project: 149674
Buggy source:
/** 
 * Perform the actual read of a long read barrier.
 * @param objref The object that has the long field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final long longRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getLongAtOffset(objref.toObject(),offset.toOffset());
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a long read barrier.
 * @param objref The object that has the long field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final long longRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getLongAtOffset(objref.toObject(),offset.toOffset());
}
Program: 149675
Project: 149675
Buggy source:
/** 
 * Perform the actual read of a double read barrier.
 * @param objref The object that has the double field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final double doubleRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getDoubleAtOffset(objref.toObject(),offset.toOffset());
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a double read barrier.
 * @param objref The object that has the double field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final double doubleRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getDoubleAtOffset(objref.toObject(),offset.toOffset());
}
Program: 149676
Project: 149676
Buggy source:
/** 
 * Perform the actual read of a short read barrier.
 * @param objref The object that has the short field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final short shortRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getShortAtOffset(objref.toObject(),offset.toOffset());
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a short read barrier.
 * @param objref The object that has the short field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final short shortRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getShortAtOffset(objref.toObject(),offset.toOffset());
}
Program: 149677
Project: 149677
Buggy source:
/** 
 * Perform the actual read of a float read barrier.
 * @param objref The object that has the float field
 * @param offset The offset from the ref
 * @param unused Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final float floatRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getFloatAtOffset(objref.toObject(),offset.toOffset());
}

Fixed version (ground truth):
/** 
 * Perform the actual read of a float read barrier.
 * @param objref The object that has the float field
 * @param offset The offset from the ref
 * @param location Unused
 * @param mode The context in which the write is occurring
 * @return the read value
 */
@Inline @Override public final float floatRead(ObjectReference objref,Word offset,Word location,int mode){
  return Magic.getFloatAtOffset(objref.toObject(),offset.toOffset());
}
Program: 149678
Project: 149678
Buggy source:
/** 
 * Place a phase on the phase stack and begin processing.
 * @param scheduledPhase The phase to execute
 * @return True if the phase stack is exhausted.
 */
public static void beginNewPhaseStack(int scheduledPhase){
  int order=((ParallelCollector)VM.activePlan.collector()).rendezvous();
  if (order == 0) {
    pushScheduledPhase(scheduledPhase);
  }
  processPhaseStack(false);
}

Fixed version (ground truth):
/** 
 * Place a phase on the phase stack and begin processing.
 * @param scheduledPhase The phase to execute
 */
public static void beginNewPhaseStack(int scheduledPhase){
  int order=((ParallelCollector)VM.activePlan.collector()).rendezvous();
  if (order == 0) {
    pushScheduledPhase(scheduledPhase);
  }
  processPhaseStack(false);
}
Program: 149679
Project: 149679
Buggy source:
/** 
 * Continue the execution of a phase stack. Used for incremental and concurrent collection.
 * @return True if the phase stack is exhausted.
 */
public static void continuePhaseStack(){
  processPhaseStack(true);
}

Fixed version (ground truth):
/** 
 * Continue the execution of a phase stack. Used for incremental and concurrent collection.
 */
public static void continuePhaseStack(){
  processPhaseStack(true);
}
Program: 149680
Project: 149680
Buggy source:
/** 
 * A number of references are about to be copied from object <code>src</code> to object <code>dst</code> (as in an array copy).  Thus, <code>dst</code> is the mutated object.  Take appropriate write barrier actions.<p> In this case, we remember the mutated source address range and will scan that address range at GC time.
 * @param src The source of the values to be copied
 * @param srcIdx The starting source index
 * @param dst The mutated object, i.e. the destination of the copy.
 * @param srcIdx The starting source index
 * @param len The number of array elements to be copied
 * @return True if the update was performed by the barrier, false ifleft to the caller (always false in this case).
 */
@Inline @Override public final boolean objectReferenceBulkCopy(ObjectReference src,Offset srcOffset,ObjectReference dst,Offset dstOffset,int bytes){
  if (!Gen.inNursery(dst)) {
    Address start=dst.toAddress().plus(dstOffset);
    arrayRemset.insert(start,start.plus(bytes));
  }
  return false;
}

Fixed version (ground truth):
/** 
 * A number of references are about to be copied from object <code>src</code> to object <code>dst</code> (as in an array copy).  Thus, <code>dst</code> is the mutated object.  Take appropriate write barrier actions.<p> In this case, we remember the mutated source address range and will scan that address range at GC time.
 * @param src The source of the values to be copied
 * @param srcOffset The starting source offset
 * @param dst The mutated object, i.e. the destination of the copy.
 * @param dstOffset The starting destination offset
 * @param bytes The number of bytes to copy
 * @return True if the update was performed by the barrier, false ifleft to the caller (always false in this case).
 */
@Inline @Override public final boolean objectReferenceBulkCopy(ObjectReference src,Offset srcOffset,ObjectReference dst,Offset dstOffset,int bytes){
  if (!Gen.inNursery(dst)) {
    Address start=dst.toAddress().plus(dstOffset);
    arrayRemset.insert(start,start.plus(bytes));
  }
  return false;
}
Program: 149681
Project: 149681
Buggy source:
/** 
 * Perform the root write barrier fast path, which may involve remembering a reference if necessary.
 * @param slot The address into which the new reference will bestored.
 * @param tgt The target of the new reference
 * @param mode The mode of the store (eg putfield, putstatic etc)
 */
@Inline private void fastPath(Address slot,ObjectReference tgt){
  if (Gen.GATHER_WRITE_BARRIER_STATS)   Gen.wbFast.inc();
  if (Gen.inNursery(tgt)) {
    if (Gen.GATHER_WRITE_BARRIER_STATS)     Gen.wbSlow.inc();
    remset.insert(slot);
  }
}

Fixed version (ground truth):
/** 
 * Perform the root write barrier fast path, which may involve remembering a reference if necessary.
 * @param slot The address into which the new reference will bestored.
 * @param tgt The target of the new reference
 */
@Inline private void fastPath(Address slot,ObjectReference tgt){
  if (Gen.GATHER_WRITE_BARRIER_STATS)   Gen.wbFast.inc();
  if (Gen.inNursery(tgt)) {
    if (Gen.GATHER_WRITE_BARRIER_STATS)     Gen.wbSlow.inc();
    remset.insert(slot);
  }
}
Program: 149682
Project: 149682
Buggy source:
/** 
 * Advance the cursor either to the next region in the list, or to a new region allocated from the global list.
 * @param m
 */
void advanceToNextForwardableRegion(MarkCompactSpace space){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(get().EQ(getLimit()));
  Address nextRegion=BumpPointer.getNextRegion(region);
  if (nextRegion.isZero()) {
    nextRegion=space.getNextRegion();
    if (nextRegion.isZero()) {
      region=Address.zero();
      return;
    }
    MarkCompactLocal.setNextRegion(region,nextRegion);
    MarkCompactLocal.clearNextRegion(nextRegion);
  }
  init(nextRegion);
  if (VM.VERIFY_ASSERTIONS)   assertCursorInBounds();
}

Fixed version (ground truth):
/** 
 * Advance the cursor either to the next region in the list, or to a new region allocated from the global list.
 * @param space
 */
void advanceToNextForwardableRegion(MarkCompactSpace space){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(get().EQ(getLimit()));
  Address nextRegion=BumpPointer.getNextRegion(region);
  if (nextRegion.isZero()) {
    nextRegion=space.getNextRegion();
    if (nextRegion.isZero()) {
      region=Address.zero();
      return;
    }
    MarkCompactLocal.setNextRegion(region,nextRegion);
    MarkCompactLocal.clearNextRegion(nextRegion);
  }
  init(nextRegion);
  if (VM.VERIFY_ASSERTIONS)   assertCursorInBounds();
}
Program: 149683
Project: 149683
Buggy source:
/** 
 * Advance the cursor to the end of the given object.
 * @return The object reference of the next object.
 */
@Inline void advanceToObjectEnd(ObjectReference current){
  cursor=VM.objectModel.getObjectEndAddress(current);
  if (VM.VERIFY_ASSERTIONS)   assertCursorInBounds();
}

Fixed version (ground truth):
/** 
 * Advance the cursor to the end of the given object.
 */
@Inline void advanceToObjectEnd(ObjectReference current){
  cursor=VM.objectModel.getObjectEndAddress(current);
  if (VM.VERIFY_ASSERTIONS)   assertCursorInBounds();
}
Program: 149684
Project: 149684
Buggy source:
/** 
 * Atomically attempt to set the mark bit of an object.  Return true if successful, false if the mark bit was already set.
 * @param object The object whose mark bit is to be written
 * @param value The value to which the mark bits will be set
 */
@Inline private boolean testAndMark(ObjectReference object){
  byte oldValue, markBits, newValue;
  oldValue=VM.objectModel.readAvailableByte(object);
  markBits=(byte)(oldValue & MARK_COUNT_MASK);
  if (markBits == markState)   return false;
  newValue=(byte)((oldValue & ~MARK_COUNT_MASK) | markState);
  if (HeaderByte.NEEDS_UNLOGGED_BIT)   newValue|=HeaderByte.UNLOGGED_BIT;
  VM.objectModel.writeAvailableByte(object,newValue);
  return true;
}

Fixed version (ground truth):
/** 
 * Atomically attempt to set the mark bit of an object.  Return true if successful, false if the mark bit was already set.
 * @param object The object whose mark bit is to be set
 */
@Inline private boolean testAndMark(ObjectReference object){
  byte oldValue, markBits, newValue;
  oldValue=VM.objectModel.readAvailableByte(object);
  markBits=(byte)(oldValue & MARK_COUNT_MASK);
  if (markBits == markState)   return false;
  newValue=(byte)((oldValue & ~MARK_COUNT_MASK) | markState);
  if (HeaderByte.NEEDS_UNLOGGED_BIT)   newValue|=HeaderByte.UNLOGGED_BIT;
  VM.objectModel.writeAvailableByte(object,newValue);
  return true;
}
Program: 149685
Project: 149685
Buggy source:
/** 
 * Return true if the mark count for an object has the given value.
 * @param object The object whose mark bit is to be tested
 * @param value The value against which the mark bit will be tested
 * @return True if the mark bit for the object has the given value.
 */
@Inline private boolean testMarkState(ObjectReference object){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert((markState & ~MARK_COUNT_MASK) == 0);
  return (VM.objectModel.readAvailableByte(object) & MARK_COUNT_MASK) == markState;
}

Fixed version (ground truth):
/** 
 * Return true if the mark count for an object has the given value.
 * @param object The object whose mark bit is to be tested
 * @return True if the mark bit for the object is set.
 */
@Inline private boolean testMarkState(ObjectReference object){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert((markState & ~MARK_COUNT_MASK) == 0);
  return (VM.objectModel.readAvailableByte(object) & MARK_COUNT_MASK) == markState;
}
Program: 149686
Project: 149686
Buggy source:
/** 
 * Has an object been forwarded or being forwarded?
 * @param object The object to be checked
 * @return True if the object has been forwarded
 */
@Inline public static boolean stateIsForwardedOrBeingForwarded(Word header){
  return (header.toInt() & FORWARDING_MASK) != 0;
}

Fixed version (ground truth):
/** 
 * Has an object been forwarded or being forwarded?
 * @param header The object header to be checked
 * @return True if the object has been forwarded
 */
@Inline public static boolean stateIsForwardedOrBeingForwarded(Word header){
  return (header.toInt() & FORWARDING_MASK) != 0;
}
Program: 149687
Project: 149687
Buggy source:
/** 
 * Has an object been forwarded or being forwarded?
 * @param object The object to be checked
 * @return True if the object has been forwarded
 */
@Inline public static boolean stateIsBeingForwarded(Word header){
  return (header.toInt() & FORWARDING_MASK) == BEING_FORWARDED;
}

Fixed version (ground truth):
/** 
 * Has an object been forwarded or being forwarded?
 * @param header The object header to be checked
 * @return True if the object has been forwarded
 */
@Inline public static boolean stateIsBeingForwarded(Word header){
  return (header.toInt() & FORWARDING_MASK) == BEING_FORWARDED;
}
Program: 149688
Project: 149688
Buggy source:
/** 
 * Perform any required initialization of the GC portion of the header. Called for objects created at boot time.
 * @param ref the object ref to the storage to be initialized
 * @param typeRef the type reference for the instance being created
 * @param size the number of bytes allocated by the GC system forthis object.
 * @param status the initial value of the status word
 * @return The new value of the status word
 */
public static byte setBuildTimeGCByte(Address object,ObjectReference typeRef,int size){
  byte status=0;
  if (NEEDS_UNLOGGED_BIT)   status|=UNLOGGED_BIT;
  return status;
}

Fixed version (ground truth):
/** 
 * Perform any required initialization of the GC portion of the header. Called for objects created at boot time.
 * @param object the Address representing the storage to be initialized
 * @param typeRef the type reference for the instance being created
 * @param size the number of bytes allocated by the GC system forthis object.
 * @return The new value of the status word
 */
public static byte setBuildTimeGCByte(Address object,ObjectReference typeRef,int size){
  byte status=0;
  if (NEEDS_UNLOGGED_BIT)   status|=UNLOGGED_BIT;
  return status;
}
Program: 149689
Project: 149689
Buggy source:
/** 
 * Set the next region in the linked-list of regions
 * @param region The region
 * @param the next region in the list
 */
@Inline public static void setNextRegion(Address region,Address nextRegion){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!region.isZero());
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!nextRegion.EQ(Address.fromIntZeroExtend(0xdeadbeef)));
  region.store(nextRegion,NEXT_REGION_OFFSET);
}

Fixed version (ground truth):
/** 
 * Set the next region in the linked-list of regions
 * @param region The region
 * @param nextRegion the next region in the list
 */
@Inline public static void setNextRegion(Address region,Address nextRegion){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!region.isZero());
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!nextRegion.EQ(Address.fromIntZeroExtend(0xdeadbeef)));
  region.store(nextRegion,NEXT_REGION_OFFSET);
}
Program: 149690
Project: 149690
Buggy source:
/** 
 * Return the end address of the given region.
 * @param region The region.
 * @return the allocation limit of the region.
 */
public static void setRegionLimit(Address region,Address limit){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!region.isZero());
  region.plus(REGION_LIMIT_OFFSET).store(limit);
}

Fixed version (ground truth):
/** 
 * Store the limit value at the end of the region.
 */
public static void setRegionLimit(Address region,Address limit){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!region.isZero());
  region.plus(REGION_LIMIT_OFFSET).store(limit);
}
Program: 149691
Project: 149691
Buggy source:
/** 
 * Remove a request to the space.
 * @param pages The number of pages returned due to the request.
 */
@Inline public final void clearRequest(int reservedPages){
  lock();
  reserved-=reservedPages;
  unlock();
}

Fixed version (ground truth):
/** 
 * Remove a request to the space.
 * @param reservedPages The number of pages returned due to the request.
 */
@Inline public final void clearRequest(int reservedPages){
  lock();
  reserved-=reservedPages;
  unlock();
}
Program: 149692
Project: 149692
Buggy source:
/** 
 * Atomically write a Word field of an object or array and return the old value of the Word field.
 * @param ref The object that has the Word field
 * @param target The value that the slot will be updated to
 * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
 * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
 * @param mode The context in which the write is occurring
 * @return The raw value that was replaced by the write.
 */
public abstract Word wordAtomicWrite(ObjectReference ref,Word rawTarget,Word metaDataA,Word metaDataB,int mode);

Fixed version (ground truth):
/** 
 * Atomically write a Word field of an object or array and return the old value of the Word field.
 * @param ref The object that has the Word field
 * @param rawTarget The value that the slot will be updated to
 * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
 * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
 * @param mode The context in which the write is occurring
 * @return The raw value that was replaced by the write.
 */
public abstract Word wordAtomicWrite(ObjectReference ref,Word rawTarget,Word metaDataA,Word metaDataB,int mode);