nus-yam/ex-repair huggingface dataset:
Program: 36753
Project: 36753
Buggy source:
public void stopFullScan(){
  if (!fullScanStarted)   return;
  try {
    beaconManager.stopRangingBeaconsInRegion(FULL_SCAN_REGION);
    fullScanStarted=false;
    Log.d(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void stopFullScan(){
  stopRanging(FULL_SCAN_REGION);
}
Program: 36754
Project: 36754
Buggy source:
public void stopRanging(){
  if (!rangingStarted)   return;
  try {
    beaconManager.stopRangingBeaconsInRegion(persistentState.getSelectedRegion());
    rangingStarted=false;
    Log.d(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void stopRanging(Region region){
  try {
    beaconManager.stopRangingBeaconsInRegion(region);
    Log.d(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 36755
Project: 36755
Buggy source:
public void startRanging(){
  assertServiceReady();
  if (fullScanStarted)   throw new RuntimeException("String_Node_Str");
  if (rangingStarted)   return;
  beaconManager.setRangeNotifier(new RangeNotifier(){
    @Override public void didRangeBeaconsInRegion(    Collection<Beacon> iBeacons,    Region region){
      if (iBeacons.size() == 1) {
        Beacon beacon=iBeacons.iterator().next();
        Log.d(TAG,"String_Node_Str" + beacon);
        postOnMainThread(new BeaconScanCompleteEvent(Calendar.getInstance(),beacon));
      }
    }
  }
);
  try {
    Region selectedRegion=persistentState.getSelectedRegion();
    if (selectedRegion == null)     return;
    beaconManager.startRangingBeaconsInRegion(persistentState.getSelectedRegion());
    rangingStarted=true;
    Log.i(TAG,"String_Node_Str");
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void startRanging(Region region){
  assertServiceReady();
  if (beaconManager.getRangedRegions().contains(region))   return;
  for (  Region r : beaconManager.getRangedRegions()) {
    stopRanging(r);
  }
  beaconManager.setRangeNotifier(new RangeNotifier(){
    @Override public void didRangeBeaconsInRegion(    Collection<Beacon> beacons,    Region region){
      if (beacons.size() > 0) {
        postOnMainThread(new RangeScanCompleteEvent(Calendar.getInstance(),beacons));
      }
    }
  }
);
  try {
    if (region != null) {
      beaconManager.startRangingBeaconsInRegion(region);
      Log.i(TAG,"String_Node_Str");
    }
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 36756
Project: 36756
Buggy source:
public void updateImage(){
  System.out.println("String_Node_Str");
  Bitmap bitmap;
  bitmap=Bitmap.createBitmap(1024,768,Bitmap.Config.RGB_565);
  try {
    Frame.frameBuffer.position(0);
    bitmap.copyPixelsFromBuffer(Frame.frameBuffer);
    remoteScreen.setImageBitmap(bitmap);
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public void updateImage(){
  System.out.println("String_Node_Str");
  try {
    Frame.frameBuffer.position(0);
    bitmap.copyPixelsFromBuffer(Frame.frameBuffer);
    remoteScreen.setImageBitmap(bitmap);
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.out.println("String_Node_Str");
  }
}
Program: 36757
Project: 36757
Buggy source:
/** 
 * @param rleData RLE encoded in byte[].
 * @param offset Data offset in rleData from where RLE data starts
 * @param length Length of RLE data in rleData
 * @return decode plain data in byte[]<br/> <p> Decodes RLE encoded data into plain form. Depending on the the length and contents of the input data, this might take some time to evaluate. </p> <br/> <p> It is assumed that the encoding scheme followed takes 2 bytes as basic block and uses special char 'rr' when there is a repetition of data. More details about the encoding scheme can be found at, https://github.com/praveendath92/udlfb </p>
 */
public byte[] decode(byte[] rleData,int offset,int length){
  int pos=offset;
  int count=0;
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  int bytesRead=0;
  while (pos < length) {
    if (rleData[pos] == 'r' && rleData[pos + 1] == 'r') {
      pos=pos + 2;
      count=rleData[pos] & 0x000000ff;
      pos++;
      while (count != 0) {
        count--;
        bytesRead=bytesRead + 2;
      }
    }
 else {
      out.write(rleData,pos,2);
      bytesRead=bytesRead + 2;
    }
    pos=pos + 2;
  }
  System.out.println("String_Node_Str" + bytesRead);
  outData=out.toByteArray();
  return outData;
}

Fixed version (ground truth):
/** 
 * @param rleData RLE encoded in byte[].
 * @param offset Data offset in rleData from where RLE data starts
 * @param length Length of RLE data in rleData
 * @return decode plain data in byte[]<br/> <p> Decodes RLE encoded data into plain form. Depending on the the length and contents of the input data, this might take some time to evaluate. </p> <br/> <p> It is assumed that the encoding scheme followed takes 2 bytes as basic block and uses special char 'rr' when there is a repetition of data. More details about the encoding scheme can be found at, https://github.com/praveendath92/udlfb </p>
 */
public byte[] decode(byte[] rleData,int offset,int length){
  int pos=offset;
  int count=0;
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  int bytesRead=0;
  while (pos < length) {
    if (rleData[pos] == 'r' && rleData[pos + 1] == 'r') {
      pos=pos + 2;
      count=rleData[pos] & 0x000000ff;
      pos++;
      while (count != 0) {
        count--;
        out.write(rleData,pos,2);
        bytesRead=bytesRead + 2;
      }
    }
 else {
      out.write(rleData,pos,2);
      bytesRead=bytesRead + 2;
    }
    pos=pos + 2;
  }
  System.out.println("String_Node_Str" + bytesRead);
  outData=out.toByteArray();
  return outData;
}
Program: 36758
Project: 36758
Buggy source:
public void setupImage(ByteBuffer buffer){
  System.out.println("String_Node_Str");
  Bitmap bitmap;
  bitmap=Bitmap.createBitmap(1024,768,Bitmap.Config.RGB_565);
  bitmap.copyPixelsFromBuffer(buffer);
  buffer.rewind();
  sampleImage.setImageBitmap(bitmap);
}

Fixed version (ground truth):
public void setupImage(ByteBuffer buffer){
  System.out.println("String_Node_Str");
  Bitmap bitmap;
  buffer.position(0);
  bitmap=Bitmap.createBitmap(1024,768,Bitmap.Config.RGB_565);
  bitmap.copyPixelsFromBuffer(buffer);
  buffer.rewind();
  sampleImage.setImageBitmap(bitmap);
}
Program: 36759
Project: 36759
Buggy source:
public void setupImage(ByteBuffer buffer){
  System.out.println("String_Node_Str");
  Bitmap bitmap;
  bitmap=Bitmap.createBitmap(1024,668,Bitmap.Config.RGB_565);
  bitmap.copyPixelsFromBuffer(buffer);
  buffer.rewind();
  sampleImage.setImageBitmap(bitmap);
}

Fixed version (ground truth):
public void setupImage(ByteBuffer buffer){
  System.out.println("String_Node_Str");
  Bitmap bitmap;
  bitmap=Bitmap.createBitmap(1024,320,Bitmap.Config.RGB_565);
  bitmap.copyPixelsFromBuffer(buffer);
  buffer.rewind();
  sampleImage.setImageBitmap(bitmap);
}
Program: 36760
Project: 36760
Buggy source:
private void initAccessory(UsbAccessory accessory){
  FileDescriptor fd=null;
  try {
    fd=UsbManager.getInstance(this).openAccessory(accessory).getFileDescriptor();
  }
 catch (  IllegalArgumentException e) {
    e.printStackTrace();
    finish();
  }
catch (  NullPointerException e) {
    e.printStackTrace();
    finish();
  }
  mFout=new FileOutputStream(fd);
  mFin=new FileInputStream(fd);
  mADKReader=new ADKReader(mFin,new UIUpdater());
  mADKWriter=new ADKWriter(mFout);
  widgetsAvailable(true);
  mADKReader.start();
}

Fixed version (ground truth):
private void initAccessory(UsbAccessory accessory){
  FileDescriptor fd=null;
  try {
    fd=UsbManager.getInstance(this).openAccessory(accessory).getFileDescriptor();
  }
 catch (  IllegalArgumentException e) {
    e.printStackTrace();
    finish();
  }
catch (  NullPointerException e) {
    e.printStackTrace();
    finish();
  }
  mFout=new FileOutputStream(fd);
  mFin=new FileInputStream(fd);
  mADKReader=new ADKReader(mFin,new UIUpdater(),this,accessory);
  mADKWriter=new ADKWriter(mFout);
  widgetsAvailable(true);
  mADKReader.start();
}
Program: 36761
Project: 36761
Buggy source:
public ADKReader(FileInputStream mFin,UIUpdater uu){
  this.mFin=mFin;
  this.uu=uu;
}

Fixed version (ground truth):
public ADKReader(FileInputStream mFin,UIUpdater uu,Context context,UsbAccessory mAccessory){
  this.mFin=mFin;
  this.uu=uu;
  this.context=context;
  this.mAccessory=mAccessory;
}
Program: 36762
Project: 36762
Buggy source:
@Override protected Long doInBackground(Integer... params){
  int ret=0;
  int i;
  Log.d(DEBUG_TAG,"String_Node_Str");
  while (true) {
    try {
      ret=mFin.read(buffer);
    }
 catch (    IOException e) {
      Log.d(DEBUG_TAG,"String_Node_Str");
      e.printStackTrace();
      break;
    }
    i=0;
    read="String_Node_Str";
    while (i < ret) {
      int len=ret - i;
      if (len >= 1) {
        read=read + buffer[i] + "String_Node_Str";
      }
      i+=1;
      if (i == ret) {
        Log.d(DEBUG_TAG,"String_Node_Str" + i);
        publishProgress(len);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Long doInBackground(Integer... params){
  int ret=0;
  int i;
  Log.d(DEBUG_TAG,"String_Node_Str");
  while (true) {
    byte[] buffer=new byte[16384];
    try {
      Log.d(DEBUG_TAG,"String_Node_Str");
      ret=mFin.read(buffer);
      Log.d(DEBUG_TAG,"String_Node_Str");
    }
 catch (    IOException e) {
      Log.d(DEBUG_TAG,"String_Node_Str");
      e.printStackTrace();
      break;
    }
catch (    Exception e) {
      Log.d(DEBUG_TAG,"String_Node_Str");
      e.printStackTrace();
    }
    read=buffer.toString();
    publishProgress(0);
  }
  return null;
}
Program: 36763
Project: 36763
Buggy source:
private boolean removeEntry(ViewEntry entry){
  boolean res=entries.remove(entry);
  Iterator<VodAddress> i=d2e.keySet().iterator();
  while (i.hasNext()) {
    if (entry.getDescriptor().getVodAddress().getPeerAddress().equals(i.next().getPeerAddress())) {
      i.remove();
      break;
    }
  }
  checkSize();
  return res;
}

Fixed version (ground truth):
private boolean removeEntry(ViewEntry entry){
  boolean res=entries.remove(entry);
  if (d2e.remove(entry.getDescriptor().getVodAddress()) == null && res == true) {
    System.err.println("String_Node_Str");
  }
  checkSize();
  return res;
}
Program: 36764
Project: 36764
Buggy source:
private boolean removeEntry(ViewEntry entry){
  boolean res=entries.remove(entry);
  if (d2e.remove(entry.getDescriptor().getVodAddress()) == null && res == true) {
    System.err.println("String_Node_Str");
  }
  checkSize();
  return res;
}

Fixed version (ground truth):
private boolean removeEntry(ViewEntry entry){
  boolean res=entries.remove(entry);
  Iterator<VodAddress> i=d2e.keySet().iterator();
  while (i.hasNext()) {
    if (entry.getDescriptor().getVodAddress().getPeerAddress().equals(i.next().getPeerAddress())) {
      i.remove();
      break;
    }
  }
  checkSize();
  return res;
}
Program: 36765
Project: 36765
Buggy source:
public NatTraverser(NatTraverserInit init){
  super();
  subscribe(handleStart,control);
  subscribe(handleStop,control);
  subscribe(handleDisconnectNeighbour,natTraverserPort);
  subscribe(handleStartServices,natTraverserPort);
  subscribe(handleConnectionEstablishmentTimeout,timer);
  subscribe(handleUpperDirectMsgNettyRequest,upperNet);
  subscribe(handleUpperDirectMsgNettyResponse,upperNet);
  subscribe(handleUpperDirectMsgNettyOneway,upperNet);
  subscribe(handleRelayRequestDown,upperNet);
  subscribe(handleRelayOnewayDown,upperNet);
  subscribe(handleRelayResponseDown,upperNet);
  subscribe(handleEchoChangePortResponse,network);
  subscribe(handleLowerDirectMsgRequest,network);
  subscribe(handleLowerDirectMsgResponse,network);
  subscribe(handleLowerDirectMsgOneway,network);
  subscribe(handleRelayRequestUp,network);
  subscribe(handleRelayOnewayUp,network);
  subscribe(handleRelayResponseUp,network);
  subscribe(handleGarbageCleanupTimeout,timer);
  subscribe(handleStunRetryTimeout,timer);
  subscribe(handleServersInitTimeout,timer);
  subscribe(handleCroupierSample,globalCroupierPort);
}

Fixed version (ground truth):
public NatTraverser(NatTraverserInit init){
  super();
  doInit(init);
  subscribe(handleStart,control);
  subscribe(handleStop,control);
  subscribe(handleDisconnectNeighbour,natTraverserPort);
  subscribe(handleStartServices,natTraverserPort);
  subscribe(handleConnectionEstablishmentTimeout,timer);
  subscribe(handleUpperDirectMsgNettyRequest,upperNet);
  subscribe(handleUpperDirectMsgNettyResponse,upperNet);
  subscribe(handleUpperDirectMsgNettyOneway,upperNet);
  subscribe(handleRelayRequestDown,upperNet);
  subscribe(handleRelayOnewayDown,upperNet);
  subscribe(handleRelayResponseDown,upperNet);
  subscribe(handleEchoChangePortResponse,network);
  subscribe(handleLowerDirectMsgRequest,network);
  subscribe(handleLowerDirectMsgResponse,network);
  subscribe(handleLowerDirectMsgOneway,network);
  subscribe(handleRelayRequestUp,network);
  subscribe(handleRelayOnewayUp,network);
  subscribe(handleRelayResponseUp,network);
  subscribe(handleGarbageCleanupTimeout,timer);
  subscribe(handleStunRetryTimeout,timer);
  subscribe(handleServersInitTimeout,timer);
  subscribe(handleCroupierSample,globalCroupierPort);
}
Program: 36766
Project: 36766
Buggy source:
public File store() throws IOException {
  Properties p=new Properties();
  p.setProperty("String_Node_Str","String_Node_Str" + seed);
  for (  Field f : getClass().getDeclaredFields()) {
    try {
      p.setProperty(f.getName(),"String_Node_Str" + f.get(this));
    }
 catch (    IllegalAccessException ex) {
      Logger.getLogger(AbstractConfiguration.class.getName()).log(Level.SEVERE,null,ex);
      throw new IOException("String_Node_Str" + ex.getMessage());
    }
  }
  File file=File.createTempFile(getClass().getCanonicalName(),"String_Node_Str");
  Writer writer=new FileWriter(file);
  p.store(writer,getClass().getCanonicalName());
  System.setProperty(getClass().getCanonicalName(),file.getCanonicalPath());
  return file;
}

Fixed version (ground truth):
public File store() throws IOException {
  Properties p=new Properties();
  p.setProperty("String_Node_Str","String_Node_Str" + seed);
  for (  Field f : getClass().getDeclaredFields()) {
    try {
      f.setAccessible(true);
      p.setProperty(f.getName(),"String_Node_Str" + f.get(this));
    }
 catch (    IllegalAccessException ex) {
      Logger.getLogger(AbstractConfiguration.class.getName()).log(Level.SEVERE,null,ex);
      throw new IOException("String_Node_Str" + ex.getMessage());
    }
  }
  File file=File.createTempFile(getClass().getCanonicalName(),"String_Node_Str");
  Writer writer=new FileWriter(file);
  p.store(writer,getClass().getCanonicalName());
  System.setProperty(getClass().getCanonicalName(),file.getCanonicalPath());
  return file;
}
Program: 36769
Project: 36769
Buggy source:
@Override public void handle(NatPortBindResponse event){
  int portToMap=event.getPort();
  BindingSession session=event.getSession();
  Address v=session.getV();
  InetAddress publicEndPoint=session.getPublicEndPoint();
  int dstPort=session.getDstPort();
  RewriteableMsg msg=session.getMsg();
  if (event.getStatus() != NatPortBindResponse.Status.SUCCESS) {
    int rtoRetries=event.getRtoRetries();
    if (rtoRetries < 3) {
      mapPort(msg,v,publicEndPoint,dstPort,natPublicAddress,dstPort,rtoRetries + 1);
    }
 else {
      Address privateAddr=pubPortToPrivateAddr.remove(portToMap);
      if (privateAddr != null) {
        logger.warn(compName + "String_Node_Str",portToMap,privateAddr);
        Map<InetAddress,Map<Integer,Integer>> mapping=privateEndPointToDestinationTable.remove(privateAddr);
        if (mapping != null) {
          mapping.remove(publicEndPoint);
        }
 else {
          logger.warn(compName + "String_Node_Str" + mapping);
        }
      }
 else {
        logger.warn(compName + "String_Node_Str" + portToMap);
      }
      if (event.getStatus() == NatPortBindResponse.Status.PORT_ALREADY_BOUND) {
        delegator.doTrigger(new Fault(new IllegalStateException("String_Node_Str" + portToMap + "String_Node_Str")),control);
      }
    }
    return;
  }
  timers.put(portToMap,System.currentTimeMillis());
  Address newSourceAddress=new Address(natPublicAddress,portToMap,msg.getSource().getId());
  msg.rewritePublicSource(newSourceAddress);
  delegator.doTrigger(msg,network);
  logger.debug(compName + "String_Node_Str" + "String_Node_Str"+ msg.getSource()+ "String_Node_Str"+ msg.getDestination()+ "String_Node_Str"+ msg.getTimeoutId()+ "String_Node_Str"+ msg.getClass().toString());
}

Fixed version (ground truth):
@Override public void handle(Stop event){
  logger.debug(compName + "String_Node_Str");
}
Program: 36770
Project: 36770
Buggy source:
public DistributedNatGatewayEmulator(RetryComponentDelegator delegator){
  super(delegator);
  this.delegator.doSubscribe(handleStart,control);
  this.delegator.doSubscribe(handleStop,control);
  this.delegator.doSubscribe(handleUpperMessage,upperNet);
  this.delegator.doSubscribe(handleLowerMessage,network);
  this.delegator.doSubscribe(handleInit,control);
  this.delegator.doSubscribe(handleUpnpGetPublicIpRequest,upnpPort);
  this.delegator.doSubscribe(handleMapPortsRequest,upnpPort);
  this.delegator.doSubscribe(handleUnmapPortRequest,upnpPort);
  this.delegator.doSubscribe(handleShutdownUpnp,upnpPort);
  this.delegator.doSubscribe(handleNatPortBindResponse,lowerNetControl);
  this.delegator.doSubscribe(handlePortBindRequest,upperNetControl);
  this.delegator.doSubscribe(handlePortAllocRequest,upperNetControl);
  this.delegator.doSubscribe(handlePortDeleteRequest,upperNetControl);
  this.delegator.doSubscribe(handleRTO,timer);
}

Fixed version (ground truth):
public DistributedNatGatewayEmulator(){
  subscribe(handleStart,control);
  subscribe(handleStop,control);
  subscribe(handleUpperMessage,upperNet);
  subscribe(handleLowerMessage,network);
  subscribe(handleInit,control);
  subscribe(handleUpnpGetPublicIpRequest,upnpPort);
  subscribe(handleMapPortsRequest,upnpPort);
  subscribe(handleUnmapPortRequest,upnpPort);
  subscribe(handleShutdownUpnp,upnpPort);
  subscribe(handleNatPortBindResponse,lowerNetControl);
  subscribe(handlePortBindRequest,upperNetControl);
  subscribe(handlePortBindResponse,lowerNetControl);
  subscribe(handlePortAllocRequest,upperNetControl);
  subscribe(handlePortAllocResponse,lowerNetControl);
  subscribe(handlePortDeleteRequest,upperNetControl);
  subscribe(handlePortDeleteResponse,lowerNetControl);
}
Program: 36771
Project: 36771
Buggy source:
private void addOpenedConnection(VodAddress openedHole,HpSession session){
  OpenedConnection openedConnection;
  int natBindingTimeout=(int)Math.min(self.getNat().getBindingTimeout(),openedHole.getNatBindingTimeout());
  if (session.isHeartbeatConnection()) {
    ScheduleTimeout st=new ScheduleTimeout(natBindingTimeout - 5);
    SendHeartbeatTimeout sht=new SendHeartbeatTimeout(st,openedHole.getId());
    st.setTimeoutEvent(sht);
    trigger(st,timer);
  }
 else {
    nonPingedConnections.incrementAndGet();
  }
  openedConnection=new OpenedConnection(session.getPortInUse(),openedHole.getPeerAddress(),natBindingTimeout,session.isHeartbeatConnection());
  openedConnections.put(openedHole.getId(),openedConnection);
  hpSessions.remove(session.getRemoteClientId());
}

Fixed version (ground truth):
private void addOpenedConnection(VodAddress openedHole,HpSession session){
  OpenedConnection openedConnection;
  int natBindingTimeout=(int)Math.min(self.getNat().getBindingTimeout(),openedHole.getNatBindingTimeout());
  if (session.isHeartbeatConnection()) {
    scheduleHeartbeat(openedHole.getId());
  }
 else {
    nonPingedConnections.incrementAndGet();
  }
  openedConnection=new OpenedConnection(session.getPortInUse(),openedHole.getPeerAddress(),natBindingTimeout,session.isHeartbeatConnection());
  openedConnections.put(openedHole.getId(),openedConnection);
  hpSessions.remove(session.getRemoteClientId());
}
Program: 36772
Project: 36772
Buggy source:
private void sendHeartbeat(OpenedConnection oc){
  VodAddress openedHole=ToVodAddr.hpServer(oc.getHoleOpened());
  VodAddress src=new VodAddress(new Address(self.getIp(),oc.getPortInUse(),self.getId()),self.getOverlayId(),self.getNat());
  HpKeepAliveMsg.Ping pingMsg=new HpKeepAliveMsg.Ping(src,openedHole);
  ScheduleRetryTimeout srt=new ScheduleRetryTimeout(2000,3,0.5);
  HeartbeatTimeout hbt=new HeartbeatTimeout(srt,pingMsg);
  delegator.doRetry(hbt);
  logger.trace(compName + "String_Node_Str" + self.getAddress()+ "String_Node_Str"+ src.getPort()+ "String_Node_Str"+ 2000,openedHole);
  startTimers.put(openedHole.getId(),System.currentTimeMillis());
}

Fixed version (ground truth):
private void sendHeartbeat(OpenedConnection oc){
  VodAddress openedHole=ToVodAddr.hpServer(oc.getHoleOpened());
  VodAddress src=new VodAddress(new Address(self.getIp(),oc.getPortInUse(),self.getId()),self.getOverlayId(),self.getNat());
  HpKeepAliveMsg.Ping pingMsg=new HpKeepAliveMsg.Ping(src,openedHole);
  ScheduleRetryTimeout srt=new ScheduleRetryTimeout(2000,3,0.5);
  HpKeepAliveMsg.PingTimeout hbt=new HpKeepAliveMsg.PingTimeout(srt,pingMsg);
  delegator.doRetry(hbt);
  logger.trace(compName + "String_Node_Str" + self.getAddress()+ "String_Node_Str"+ src.getPort()+ "String_Node_Str"+ 2000,openedHole);
  startTimers.put(openedHole.getId(),System.currentTimeMillis());
}
Program: 36773
Project: 36773
Buggy source:
@Override public <P extends PortType>void doTrigger(Event event,Port<P> port){
  if (event == null || port == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (event instanceof DirectMsgNetty.Request || event instanceof RelayMsgNetty.Request) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  trigger(event,port);
}

Fixed version (ground truth):
@Override public <P extends PortType>void doTrigger(Event event,Port<P> port){
  if (event == null || port == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (event instanceof DirectMsgNetty.Request || event instanceof RelayMsgNetty.Request) {
    logger.error("String_Node_Str" + event.getClass());
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  trigger(event,port);
}
Program: 36774
Project: 36774
Buggy source:
private void sendGetNatTypeResponse(List<Address> stunServers){
  stunTypeDetermined=true;
  failedStunServers.clear();
  if (self.getNat().isOpen()) {
    retryStartServerComponents();
  }
 else   if (self.isUpnp()) {
    logger.info("String_Node_Str");
    if (parentMaker != null) {
      trigger(new Stop(),parentMaker.getControl());
    }
  }
 else {
    parentMaker=create(ParentMaker.class);
    connect(parentMaker.getNegative(Timer.class),timer);
    connect(parentMaker.getNegative(VodNetwork.class),network,new MsgDestFilterOverlayId(VodConfig.SYSTEM_OVERLAY_ID));
    connect(parentMaker.getNegative(NatNetworkControl.class),lowerNetControl);
    delegator.doTrigger(new ParentMakerInit(self.clone(VodConfig.SYSTEM_OVERLAY_ID),parentMakerConfig),parentMaker.control());
    List<VodAddress> bootstrappers=new ArrayList<VodAddress>();
    for (    Address va : stunServers) {
      bootstrappers.add(ToVodAddr.hpServer(va));
    }
    delegator.doTrigger(new Join(bootstrappers),parentMaker.getPositive(ParentMakerPort.class));
  }
  cacheStunResults();
}

Fixed version (ground truth):
private void sendGetNatTypeResponse(List<Address> stunServers){
  stunTypeDetermined=true;
  failedStunServers.clear();
  if (self.getNat().isOpen()) {
    retryStartServerComponents();
  }
 else   if (self.isUpnp()) {
    logger.info("String_Node_Str");
    if (parentMaker != null) {
      trigger(new Stop(),parentMaker.getControl());
    }
  }
 else {
    parentMaker=create(ParentMaker.class);
    connect(parentMaker.getNegative(Timer.class),timer);
    connect(parentMaker.getNegative(VodNetwork.class),network,new MsgDestFilterOverlayId(VodConfig.SYSTEM_OVERLAY_ID));
    connect(parentMaker.getNegative(NatNetworkControl.class),lowerNetControl);
    delegator.doTrigger(new ParentMakerInit(self.clone(VodConfig.SYSTEM_OVERLAY_ID),parentMakerConfig),parentMaker.control());
    List<VodAddress> bootstrappers=new ArrayList<VodAddress>();
    for (    Address va : stunServers) {
      bootstrappers.add(ToVodAddr.hpServer(va));
    }
    delegator.doTrigger(new Join(bootstrappers),parentMaker.getPositive(ParentMakerPort.class));
  }
}
Program: 36775
Project: 36775
Buggy source:
private void publishSample(){
  List<VodDescriptor> nodes=getAll();
  nodes.remove(new VodDescriptor(self.getAddress()));
  if (!nodes.isEmpty()) {
    delegator.doTrigger(new CroupierSample(nodes),peerSamplePort);
  }
}

Fixed version (ground truth):
private void publishSample(){
  List<VodDescriptor> nodes=getAll();
  nodes.remove(new VodDescriptor(self.getAddress()));
  if (!nodes.isEmpty()) {
    delegator.doTrigger(new CroupierSample(nodes),peerSamplePort);
  }
  StringBuilder sb=new StringBuilder("String_Node_Str");
  for (  VodDescriptor d : nodes) {
    sb.append(d.getVodAddress().getId()).append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  logger.trace(compName + sb);
}
Program: 36776
Project: 36776
Buggy source:
private boolean removeEntry(ViewEntry entry){
  boolean res=entries.remove(entry);
  d2e.remove(entry.getDescriptor().getVodAddress());
  checkSize();
  return res;
}

Fixed version (ground truth):
private boolean removeEntry(ViewEntry entry){
  boolean res=entries.remove(entry);
  d2e.remove(entry.getDescriptor().getVodAddress().getId());
  checkSize();
  return res;
}
Program: 36777
Project: 36777
Buggy source:
public View(Self self,int size,long seed){
  super();
  this.self=self;
  this.size=size;
  this.entries=new ArrayList<ViewEntry>();
  this.d2e=new HashMap<VodAddress,ViewEntry>();
  this.random=new Random(seed);
}

Fixed version (ground truth):
public View(Self self,int size,long seed){
  super();
  this.self=self;
  this.size=size;
  this.entries=new ArrayList<ViewEntry>();
  this.d2e=new HashMap<Integer,ViewEntry>();
  this.random=new Random(seed);
}
Program: 36778
Project: 36778
Buggy source:
private void addEntry(ViewEntry entry){
  if (entry.getDescriptor().getVodAddress().getPort() == VodConfig.DEFAULT_STUN_PORT || entry.getDescriptor().getVodAddress().getPort() == VodConfig.DEFAULT_STUN_PORT_2) {
    entry.getDescriptor().getVodAddress().getPeerAddress().setPort(VodConfig.DEFAULT_PORT);
  }
  if (!entries.contains(entry)) {
    entries.add(entry);
    d2e.put(entry.getDescriptor().getVodAddress(),entry);
    checkSize();
  }
 else {
    removeEntry(entry);
    addEntry(entry);
  }
}

Fixed version (ground truth):
private void addEntry(ViewEntry entry){
  if (entry.getDescriptor().getVodAddress().getPort() == VodConfig.DEFAULT_STUN_PORT || entry.getDescriptor().getVodAddress().getPort() == VodConfig.DEFAULT_STUN_PORT_2) {
    entry.getDescriptor().getVodAddress().getPeerAddress().setPort(VodConfig.DEFAULT_PORT);
  }
  if (!entries.contains(entry)) {
    entries.add(entry);
    d2e.put(entry.getDescriptor().getVodAddress().getId(),entry);
    checkSize();
  }
 else {
    removeEntry(entry);
    addEntry(entry);
  }
}
Program: 36779
Project: 36779
Buggy source:
public boolean timedOutForShuffle(VodAddress node){
  ViewEntry entry=d2e.get(node);
  if (entry == null) {
    return false;
  }
  return removeEntry(entry);
}

Fixed version (ground truth):
public boolean timedOutForShuffle(VodAddress node){
  ViewEntry entry=d2e.get(node.getId());
  if (entry == null) {
    return false;
  }
  return removeEntry(entry);
}
Program: 36780
Project: 36780
Buggy source:
public void selectToKeep(VodAddress from,List<VodDescriptor> descriptors){
  if (from.equals(self.getAddress())) {
    return;
  }
  LinkedList<ViewEntry> entriesSentToThisPeer=new LinkedList<ViewEntry>();
  ViewEntry fromEntry=d2e.get(from);
  if (fromEntry != null) {
    entriesSentToThisPeer.add(fromEntry);
  }
  for (  ViewEntry cacheEntry : entries) {
    if (cacheEntry.wasSentTo(from)) {
      entriesSentToThisPeer.add(cacheEntry);
    }
  }
  for (  VodDescriptor descriptor : descriptors) {
    if (self.getDescriptor().equals(descriptor)) {
      continue;
    }
    if (d2e.containsKey(descriptor.getVodAddress())) {
      ViewEntry entry=d2e.get(descriptor.getVodAddress());
      if (entry.getDescriptor().getAge() > descriptor.getAge()) {
        removeEntry(entry);
        addEntry(new ViewEntry(descriptor));
        continue;
      }
 else {
        continue;
      }
    }
    if (entries.size() < size) {
      addEntry(new ViewEntry(descriptor));
      continue;
    }
    ViewEntry sentEntry=entriesSentToThisPeer.poll();
    if (sentEntry != null) {
      removeEntry(sentEntry);
      addEntry(new ViewEntry(descriptor));
    }
  }
}

Fixed version (ground truth):
public void selectToKeep(VodAddress from,List<VodDescriptor> descriptors){
  if (from.equals(self.getAddress())) {
    return;
  }
  LinkedList<ViewEntry> entriesSentToThisPeer=new LinkedList<ViewEntry>();
  ViewEntry fromEntry=d2e.get(from.getId());
  if (fromEntry != null) {
    entriesSentToThisPeer.add(fromEntry);
  }
  for (  ViewEntry cacheEntry : entries) {
    if (cacheEntry.wasSentTo(from)) {
      entriesSentToThisPeer.add(cacheEntry);
    }
  }
  for (  VodDescriptor descriptor : descriptors) {
    if (self.getDescriptor().getVodAddress().getId() == descriptor.getVodAddress().getId()) {
      continue;
    }
    int id=descriptor.getVodAddress().getId();
    if (d2e.containsKey(id)) {
      ViewEntry entry=d2e.get(id);
      if (entry.getDescriptor().getAge() > descriptor.getAge()) {
        removeEntry(entry);
        addEntry(new ViewEntry(descriptor));
        continue;
      }
 else {
        continue;
      }
    }
    if (entries.size() < size) {
      addEntry(new ViewEntry(descriptor));
      continue;
    }
    ViewEntry sentEntry=entriesSentToThisPeer.poll();
    if (sentEntry != null) {
      removeEntry(sentEntry);
      addEntry(new ViewEntry(descriptor));
    }
  }
}
Program: 36781
Project: 36781
Buggy source:
@Override public RewriteableMsg copy(){
  GoMsg.Request copy=new GoMsg.Request(vodSrc,vodDest,openedHole,holePunchingMechanism,holePunchingRole,rtoRetries,PRP_PRP_interleavedPort,bindPort,msgTimeoutId);
  copy.setTimeoutId(timeoutId);
  return copy;
}

Fixed version (ground truth):
@Override public RewriteableMsg copy(){
  GoMsg.Request copy=new GoMsg.Request(vodSrc,vodDest,openedHole,holePunchingMechanism,holePunchingRole,rtoRetries,PRP_PRP_interleavedPort,bindPort,msgTimeoutId);
  return copy;
}
Program: 36782
Project: 36782
Buggy source:
private boolean bindPort(InetAddress addr,int port,InetAddress upnpIp,int upnpPort){
  if (portsToSockets.containsKey(port)) {
    return true;
  }
  NettyHandler handler=new NettyHandler(component,addr,port);
  EventLoopGroup group=new NioEventLoopGroup();
  Bootstrap bootstrap=new Bootstrap();
  bootstrap.group(group).channel(NioDatagramChannel.class).option(ChannelOption.SO_BROADCAST,true).handler(new NettyClientInitializer(handler,msgDecoderClass));
  bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR,new FixedRecvByteBufAllocator(1500));
  bootstrap.option(ChannelOption.SO_RCVBUF,RECV_BUFFER_SIZE);
  bootstrap.option(ChannelOption.SO_SNDBUF,SEND_BUFFER_SIZE);
  bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,CONNECT_TIMEOUT_MS);
  bootstrap.option(ChannelOption.SO_REUSEADDR,true);
  try {
    DatagramChannel c;
    if (bindAllNetworkIfs) {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(port)).sync().channel();
    }
 else {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(addr,port)).sync().channel();
    }
    c.closeFuture().await();
    addLocalSocket(c,new InetSocketAddress(addr,port));
    upnpLocalSocket.put(new InetSocketAddress(upnpIp,upnpPort),new InetSocketAddress(addr,port));
    logger.info("String_Node_Str",addr,port);
  }
 catch (  InterruptedException e) {
    logger.warn("String_Node_Str",addr.getHostAddress(),port);
    trigger(new Fault(e.getCause()),control);
    return false;
  }
  bootstraps.add(bootstrap);
  socketsToBootstraps.put(new InetSocketAddress(addr,port),bootstrap);
  return true;
}

Fixed version (ground truth):
private boolean bindPort(InetAddress addr,int port,InetAddress upnpIp,int upnpPort){
  if (portsToSockets.containsKey(port)) {
    return true;
  }
  NettyHandler handler=new NettyHandler(component,addr,port);
  EventLoopGroup group=new NioEventLoopGroup();
  Bootstrap bootstrap=new Bootstrap();
  bootstrap.group(group).channel(NioDatagramChannel.class).handler(new NettyClientInitializer(handler,msgDecoderClass));
  bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR,new FixedRecvByteBufAllocator(1500));
  bootstrap.option(ChannelOption.SO_RCVBUF,RECV_BUFFER_SIZE);
  bootstrap.option(ChannelOption.SO_SNDBUF,SEND_BUFFER_SIZE);
  bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,CONNECT_TIMEOUT_MS);
  bootstrap.option(ChannelOption.SO_REUSEADDR,true);
  try {
    DatagramChannel c;
    if (bindAllNetworkIfs) {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(port)).sync().channel();
    }
 else {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(addr,port)).sync().channel();
    }
    addLocalSocket(c,new InetSocketAddress(addr,port));
    upnpLocalSocket.put(new InetSocketAddress(upnpIp,upnpPort),new InetSocketAddress(addr,port));
    logger.info("String_Node_Str",addr,port);
  }
 catch (  InterruptedException e) {
    logger.warn("String_Node_Str",addr.getHostAddress(),port);
    trigger(new Fault(e.getCause()),control);
    return false;
  }
  bootstraps.add(bootstrap);
  socketsToBootstraps.put(new InetSocketAddress(addr,port),bootstrap);
  return true;
}
Program: 36784
Project: 36784
Buggy source:
private boolean bindPort(InetAddress addr,int port,InetAddress upnpIp,int upnpPort){
  if (portsToSockets.containsKey(port)) {
    return true;
  }
  NettyHandler handler=new NettyHandler(component,addr,port);
  EventLoopGroup group=new NioEventLoopGroup();
  Bootstrap bootstrap=new Bootstrap();
  bootstrap.group(group).channel(NioDatagramChannel.class).option(ChannelOption.SO_BROADCAST,true).handler(new NettyClientInitializer(handler,msgDecoderClass));
  bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR,new FixedRecvByteBufAllocator(1500));
  bootstrap.option(ChannelOption.SO_RCVBUF,RECV_BUFFER_SIZE);
  bootstrap.option(ChannelOption.SO_SNDBUF,SEND_BUFFER_SIZE);
  bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,CONNECT_TIMEOUT_MS);
  bootstrap.option(ChannelOption.SO_REUSEADDR,true);
  try {
    DatagramChannel c;
    if (bindAllNetworkIfs) {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(port)).sync().channel();
    }
 else {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(addr,port)).sync().channel();
    }
    c.closeFuture().await();
    addLocalSocket(c,new InetSocketAddress(addr,port));
    upnpLocalSocket.put(new InetSocketAddress(upnpIp,upnpPort),new InetSocketAddress(addr,port));
    logger.info("String_Node_Str",addr,port);
  }
 catch (  InterruptedException e) {
    logger.warn("String_Node_Str",addr.getHostAddress(),port);
    trigger(new Fault(e.getCause()),control);
    return false;
  }
  bootstraps.add(bootstrap);
  socketsToBootstraps.put(new InetSocketAddress(addr,port),bootstrap);
  return true;
}

Fixed version (ground truth):
private boolean bindPort(InetAddress addr,int port,InetAddress upnpIp,int upnpPort){
  if (portsToSockets.containsKey(port)) {
    return true;
  }
  NettyHandler handler=new NettyHandler(component,addr,port);
  EventLoopGroup group=new NioEventLoopGroup();
  Bootstrap bootstrap=new Bootstrap();
  bootstrap.group(group).channel(NioDatagramChannel.class).handler(new NettyClientInitializer(handler,msgDecoderClass));
  bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR,new FixedRecvByteBufAllocator(1500));
  bootstrap.option(ChannelOption.SO_RCVBUF,RECV_BUFFER_SIZE);
  bootstrap.option(ChannelOption.SO_SNDBUF,SEND_BUFFER_SIZE);
  bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,CONNECT_TIMEOUT_MS);
  bootstrap.option(ChannelOption.SO_REUSEADDR,true);
  try {
    DatagramChannel c;
    if (bindAllNetworkIfs) {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(port)).sync().channel();
    }
 else {
      c=(DatagramChannel)bootstrap.bind(new InetSocketAddress(addr,port)).sync().channel();
    }
    addLocalSocket(c,new InetSocketAddress(addr,port));
    upnpLocalSocket.put(new InetSocketAddress(upnpIp,upnpPort),new InetSocketAddress(addr,port));
    logger.info("String_Node_Str",addr,port);
  }
 catch (  InterruptedException e) {
    logger.warn("String_Node_Str",addr.getHostAddress(),port);
    trigger(new Fault(e.getCause()),control);
    return false;
  }
  bootstraps.add(bootstrap);
  socketsToBootstraps.put(new InetSocketAddress(addr,port),bootstrap);
  return true;
}
Program: 36786
Project: 36786
Buggy source:
@Test public void RelayRequestMsg(){
  ParentKeepAliveMsg.Pong req=new ParentKeepAliveMsg.Pong(gSrc,gDest,UUID.nextUUID());
  RelayRequestMsg.ClientToServer msg=new RelayRequestMsg.ClientToServer(gSrc,gDest,remoteClientId,req);
  msg.setTimeoutId(UUID.nextUUID());
  try {
    ChannelBuffer buffer=msg.toByteArray();
    opCodeCorrect(buffer,msg);
    RelayRequestMsg.ClientToServer res=RelayRequestMsgFactory.Request.fromBuffer(buffer);
  }
 catch (  MessageDecodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
catch (  MessageEncodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
  ParentKeepAliveMsg.Pong msg2=new ParentKeepAliveMsg.Pong(gSrc,gDest,UUID.nextUUID());
  msg2.setTimeoutId(UUID.nextUUID());
  try {
    ChannelBuffer buffer=msg2.toByteArray();
    opCodeCorrect(buffer,msg2);
    RelayRequestMsg.ServerToClient res=RelayRequestMsgFactory.Response.fromBuffer(buffer);
  }
 catch (  MessageDecodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
catch (  MessageEncodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
}

Fixed version (ground truth):
@Test public void RelayRequestMsg(){
  ConnectMsg.Request req=new ConnectMsg.Request(gSrc,gSrc,utility,true,age);
  RelayRequestMsg.ClientToServer msg=new RelayRequestMsg.ClientToServer(gSrc,gDest,remoteClientId,req);
  msg.setTimeoutId(UUID.nextUUID());
  try {
    ChannelBuffer buffer=msg.toByteArray();
    opCodeCorrect(buffer,msg);
    RelayRequestMsg.ClientToServer res=RelayRequestMsgFactory.Request.fromBuffer(buffer);
  }
 catch (  MessageDecodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
catch (  MessageEncodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
  RelayRequestMsg.ServerToClient msg2=new RelayRequestMsg.ServerToClient(gSrc,gDest,remoteClientId,req);
  msg2.setTimeoutId(UUID.nextUUID());
  try {
    ChannelBuffer buffer=msg2.toByteArray();
    opCodeCorrect(buffer,msg2);
    RelayRequestMsg.ServerToClient res=RelayRequestMsgFactory.Response.fromBuffer(buffer);
  }
 catch (  MessageDecodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
catch (  MessageEncodingException ex) {
    Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE,null,ex);
    assert(false);
  }
}
Program: 36787
Project: 36787
Buggy source:
@Override public void onPacketReceiving(PacketEvent event){
  if (event.getPacketType() == WrapperPlayClientUseEntity.TYPE) {
    int entID=new WrapperPlayClientUseEntity(event.getPacket()).getTarget();
    if (running.containsKey(event.getPlayer().getUniqueId())) {
      running.get(event.getPlayer().getUniqueId()).markAsKilled(entID);
    }
  }
}

Fixed version (ground truth):
@Override public void onPacketReceiving(PacketEvent event){
  if (event.getPacketType() == WrapperPlayClientUseEntity.TYPE) {
    WrapperPlayClientUseEntity packet=new WrapperPlayClientUseEntity(event.getPacket());
    int entID=packet.getTarget();
    if (running.containsKey(event.getPlayer().getUniqueId()) && packet.getType().equals(EntityUseAction.ATTACK)) {
      running.get(event.getPlayer().getUniqueId()).markAsKilled(entID);
    }
  }
}
Program: 36788
Project: 36788
Buggy source:
public void register(){
  ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this,WrapperPlayClientUseEntity.TYPE){
    @Override public void onPacketReceiving(    PacketEvent event){
      if (event.getPacketType() == WrapperPlayClientUseEntity.TYPE) {
        int entID=new WrapperPlayClientUseEntity(event.getPacket()).getTarget();
        if (running.containsKey(event.getPlayer().getUniqueId())) {
          running.get(event.getPlayer().getUniqueId()).markAsKilled(entID);
        }
      }
    }
  }
);
  this.isRegistered=true;
}

Fixed version (ground truth):
public void register(){
  ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this,WrapperPlayClientUseEntity.TYPE){
    @Override public void onPacketReceiving(    PacketEvent event){
      if (event.getPacketType() == WrapperPlayClientUseEntity.TYPE) {
        WrapperPlayClientUseEntity packet=new WrapperPlayClientUseEntity(event.getPacket());
        int entID=packet.getTarget();
        if (running.containsKey(event.getPlayer().getUniqueId()) && packet.getType().equals(EntityUseAction.ATTACK)) {
          running.get(event.getPlayer().getUniqueId()).markAsKilled(entID);
        }
      }
    }
  }
);
  this.isRegistered=true;
}
Program: 36789
Project: 36789
Buggy source:
public static WrapperPlayServerNamedEntitySpawn getSpawnWrapper(Vector loc,AntiAura plugin){
  WrapperPlayServerNamedEntitySpawn wrapper=new WrapperPlayServerNamedEntitySpawn();
  wrapper.setEntityId(AntiAura.RANDOM.nextInt(20000));
  wrapper.setPosition(loc);
  wrapper.setPlayerUuid(UUID.randomUUID());
  wrapper.setYaw(0.0F);
  wrapper.setPitch(-45.0F);
  WrappedDataWatcher watcher=new WrappedDataWatcher();
  watcher.setObject(0,Byte.valueOf((byte)(plugin.getConfig().getBoolean("String_Node_Str",false) ? Byte.valueOf((byte)32).byteValue() : 0)));
  watcher.setObject(6,Float.valueOf(0.5F));
  watcher.setObject(11,Byte.valueOf((byte)1));
  wrapper.setMetadata(watcher);
  return wrapper;
}

Fixed version (ground truth):
public static WrapperPlayServerNamedEntitySpawn getSpawnWrapper(Vector loc,AntiAura plugin){
  WrapperPlayServerNamedEntitySpawn wrapper=new WrapperPlayServerNamedEntitySpawn();
  wrapper.setEntityId(AntiAura.RANDOM.nextInt(20000));
  wrapper.setPosition(loc);
  wrapper.setPlayerUuid(UUID.randomUUID());
  wrapper.setYaw(0.0F);
  wrapper.setPitch(-45.0F);
  WrappedDataWatcher watcher=new WrappedDataWatcher();
  watcher.setObject(0,plugin.getConfig().getBoolean("String_Node_Str",false) ? (Byte)(byte)0x20 : (byte)0);
  watcher.setObject(6,(Float)(float)0.5);
  watcher.setObject(11,(Byte)(byte)1);
  wrapper.setMetadata(watcher);
  return wrapper;
}
Program: 36790
Project: 36790
Buggy source:
private static String getRandomLetter(){
  Random rand=new Random();
  return ((Alphabet)letters.get(rand.nextInt(letters.size()))).name();
}

Fixed version (ground truth):
private static String getRandomLetter(){
  return ((Alphabet)letters.get(rand.nextInt(letters.size()))).name();
}
Program: 36791
Project: 36791
Buggy source:
public static String newName(){
  Random rand=new Random();
  int size=3 + rand.nextInt(4);
  StringBuilder stringBuilder=new StringBuilder();
  while (size > 0) {
    size--;
    stringBuilder.append(getRandomLetter());
  }
  stringBuilder.append(rand.nextInt(999999));
  return stringBuilder.toString();
}

Fixed version (ground truth):
public static String newName(){
  int size=3 + rand.nextInt(4);
  StringBuilder stringBuilder=new StringBuilder();
  while (size > 0) {
    size--;
    stringBuilder.append(getRandomLetter());
  }
  stringBuilder.append(rand.nextInt(999999));
  return stringBuilder.toString();
}
Program: 36792
Project: 36792
Buggy source:
public List<GitTag> findTags() throws IOException {
  Repository repository=getRepository();
  List<GitTag> result=new LinkedList<>();
  try (Git git=new Git(repository)){
    List<Ref> tags=git.tagList().call();
    for (    Ref tagRef : tags) {
      String label=tagRef.getName();
      String objectId=ObjectId.toString(tagRef.getObjectId());
      if (tagRef.isSymbolic()) {
        String newObjectId=ObjectId.toString(tagRef.getLeaf().getObjectId());
        logger.debug("String_Node_Str",label,newObjectId,objectId);
        objectId=newObjectId;
      }
 else {
        logger.debug("String_Node_Str",label,objectId);
      }
      if (tagRef.isPeeled()) {
        logger.debug("String_Node_Str",label,ObjectId.toString(tagRef.getPeeledObjectId()));
      }
      GitTag newTag=new GitTag(label,objectId);
      result.add(newTag);
    }
  }
 catch (  GitAPIException e) {
    throw new IllegalStateException("String_Node_Str" + path + "String_Node_Str",e);
  }
 finally {
    repository.close();
  }
  return result;
}

Fixed version (ground truth):
public List<GitTag> findTags() throws IOException {
  Repository repository=getRepository();
  List<GitTag> result=new LinkedList<>();
  try (Git git=new Git(repository)){
    List<Ref> tags=git.tagList().call();
    for (    Ref tagRef : tags) {
      String label=tagRef.getName();
      RevCommit firstCommit=resolveFirstCommitForTag(git,tagRef);
      String objectId=ObjectId.toString(firstCommit);
      logger.debug("String_Node_Str",tagRef,label,objectId);
      GitTag newTag=new GitTag(label,objectId);
      result.add(newTag);
    }
  }
 catch (  GitAPIException e) {
    throw new IllegalStateException("String_Node_Str" + path + "String_Node_Str",e);
  }
 finally {
    repository.close();
  }
  return result;
}
Program: 36793
Project: 36793
Buggy source:
private SourceLineDescriptor createSourceLineDescriptor(final Store store,final SourceLineType bugInstanceTypeSourceLine){
  final SourceLineDescriptor sourceLineDescriptor=store.create(SourceLineDescriptor.class);
  sourceLineDescriptor.setClassname(bugInstanceTypeSourceLine.getClassname());
  sourceLineDescriptor.setStart(bugInstanceTypeSourceLine.getStart());
  sourceLineDescriptor.setEnd(bugInstanceTypeSourceLine.getEnd());
  sourceLineDescriptor.setSourcefile(bugInstanceTypeSourceLine.getSourcefile());
  sourceLineDescriptor.setSourcepath(bugInstanceTypeSourceLine.getSourcepath());
  return sourceLineDescriptor;
}

Fixed version (ground truth):
private SourceLineDescriptor createSourceLineDescriptor(final Store store,final SourceLineType bugInstanceTypeSourceLine){
  final SourceLineDescriptor sourceLineDescriptor=store.create(SourceLineDescriptor.class);
  if (bugInstanceTypeSourceLine != null) {
    sourceLineDescriptor.setClassname(bugInstanceTypeSourceLine.getClassname());
    sourceLineDescriptor.setStart(bugInstanceTypeSourceLine.getStart());
    sourceLineDescriptor.setEnd(bugInstanceTypeSourceLine.getEnd());
    sourceLineDescriptor.setSourcefile(bugInstanceTypeSourceLine.getSourcefile());
    sourceLineDescriptor.setSourcepath(bugInstanceTypeSourceLine.getSourcepath());
  }
  return sourceLineDescriptor;
}