nus-yam/ex-repair huggingface dataset:
Program: 4132
Project: 4132
Buggy source:
/** 
 * Creates a new <tt>URL</tt> based on the IP and port in the location The location MUST be a dotted IP address.
 */
private static IpPort createUrlFromMini(final String location,URN urn,boolean tlsCapable) throws IOException {
  int port=location.indexOf(':');
  final String loc=(port == -1 ? location : location.substring(0,port));
  try {
    new IP(loc);
  }
 catch (  IllegalArgumentException iae) {
    throw new IOException("String_Node_Str" + location);
  }
  if (loc.indexOf('/') != -1)   throw new IOException("String_Node_Str" + location);
  if (!NetworkUtils.isValidAddress(loc))   throw new IOException("String_Node_Str" + location);
  if (port == -1)   port=6346;
 else {
    if (location.length() < port + 1)     throw new IOException("String_Node_Str" + location);
    try {
      port=Short.parseShort(location.substring(port + 1));
    }
 catch (    NumberFormatException nfe) {
      throw new IOException("String_Node_Str" + location);
    }
  }
  if (!NetworkUtils.isValidPort(port))   throw new IOException("String_Node_Str" + port);
  return new ConnectableImpl(loc,port,tlsCapable);
}

Fixed version (ground truth):
/** 
 * Creates a new <tt>URL</tt> based on the IP and port in the location The location MUST be a dotted IP address.
 */
private static IpPort createUrlFromMini(final String location,URN urn,boolean tlsCapable) throws IOException {
  int port=location.indexOf(':');
  final String loc=(port == -1 ? location : location.substring(0,port));
  try {
    new IP(loc);
  }
 catch (  IllegalArgumentException iae) {
    throw new IOException("String_Node_Str" + location);
  }
  if (loc.indexOf('/') != -1)   throw new IOException("String_Node_Str" + location);
  if (!NetworkUtils.isValidAddress(loc))   throw new IOException("String_Node_Str" + location);
  if (port == -1)   port=6346;
 else {
    if (location.length() < port + 1)     throw new IOException("String_Node_Str" + location);
    try {
      port=Integer.parseInt(location.substring(port + 1));
    }
 catch (    NumberFormatException nfe) {
      throw new IOException("String_Node_Str" + location);
    }
  }
  if (!NetworkUtils.isValidPort(port))   throw new IOException("String_Node_Str" + port);
  return new ConnectableImpl(loc,port,tlsCapable);
}
Program: 4133
Project: 4133
Buggy source:
/** 
 * @return a list of XOR distances from a provided bigint
 */
private static List<BigInteger> getXorDistances(BigInteger local,List<BigInteger> others){
  List<BigInteger> distances=new ArrayList<BigInteger>(others.size());
  for (  BigInteger bi : others) {
    if (!local.equals(bi))     distances.add(local.xor(bi));
  }
  return distances;
}

Fixed version (ground truth):
/** 
 * @return a list of XOR distances from a provided node
 */
private static List<Double> getXorDistances(Double local,List<Double> others){
  List<Double> distances=new ArrayList<Double>(others.size());
  for (  Double l : others) {
    if (l != local)     distances.add((double)((local.longValue() ^ l.longValue())));
  }
  return distances;
}
Program: 4134
Project: 4134
Buggy source:
public Object getM2(){
  return m2.toByteArray();
}

Fixed version (ground truth):
public Object getM2(){
  return doubleToBytes(m2);
}
Program: 4135
Project: 4135
Buggy source:
public Object getQ3(){
  return q3.toByteArray();
}

Fixed version (ground truth):
public Object getQ3(){
  return doubleToBytes(q3);
}
Program: 4136
Project: 4136
Buggy source:
public Object getM4(){
  return m4.toByteArray();
}

Fixed version (ground truth):
public Object getM4(){
  return doubleToBytes(m4);
}
Program: 4137
Project: 4137
Buggy source:
public Object getM3(){
  return m3.toByteArray();
}

Fixed version (ground truth):
public Object getM3(){
  return doubleToBytes(m3);
}
Program: 4138
Project: 4138
Buggy source:
public Object getQ1(){
  return q1.toByteArray();
}

Fixed version (ground truth):
public Object getQ1(){
  return doubleToBytes(q1);
}
Program: 4139
Project: 4139
Buggy source:
public Object getMin(){
  return min.toByteArray();
}

Fixed version (ground truth):
public Object getMin(){
  return doubleToBytes(min);
}
Program: 4140
Project: 4140
Buggy source:
public Object getAvg(){
  return avg.toByteArray();
}

Fixed version (ground truth):
public Object getAvg(){
  return doubleToBytes(avg);
}
Program: 4141
Project: 4141
Buggy source:
public Object getMode(){
  return mode.toByteArray();
}

Fixed version (ground truth):
public Object getMode(){
  return doubleToBytes(mode);
}
Program: 4142
Project: 4142
Buggy source:
public Object getMed(){
  return med.toByteArray();
}

Fixed version (ground truth):
public Object getMed(){
  return doubleToBytes(med);
}
Program: 4143
Project: 4143
Buggy source:
public Object getMax(){
  return max.toByteArray();
}

Fixed version (ground truth):
public Object getMax(){
  return doubleToBytes(max);
}
Program: 4144
Project: 4144
Buggy source:
/** 
 * Same as <code>getHistogram</code> but operates on <code>BigIntegers</code>.
 */
public static List<Integer> getHistogramBigInt(List<BigInteger> data,int breaks){
  if (data.isEmpty())   return Collections.emptyList();
  List<Integer> ret=new ArrayList<Integer>(breaks);
  for (int i=0; i < breaks; i++)   ret.add(0);
  BigInteger min=Collections.min(data);
  BigInteger max=Collections.max(data);
  BigInteger range=max.subtract(min).add(BigInteger.valueOf(1));
  BigInteger step=range.divide(BigInteger.valueOf(breaks));
  for (  BigInteger point : data) {
    int index=point.subtract(min).divide(step).intValue();
    index=Math.min(index,breaks - 1);
    ret.set(index,ret.get(index) + 1);
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Same as <code>getHistogram</code> but operates on <code>BigIntegers</code>.
 */
public static List<Integer> getHistogramBigInt(List<BigInteger> data,int breaks){
  if (data.isEmpty())   return Collections.emptyList();
  List<Integer> ret=new ArrayList<Integer>(breaks);
  for (int i=0; i < breaks; i++)   ret.add(0);
  BigInteger min=Collections.min(data);
  BigInteger max=Collections.max(data);
  BigInteger range=max.subtract(min).add(BigInteger.valueOf(1));
  BigInteger step=range.divide(BigInteger.valueOf(breaks));
  if (step.equals(BigInteger.ZERO))   return Collections.emptyList();
  for (  BigInteger point : data) {
    int index=point.subtract(min).divide(step).intValue();
    index=Math.min(index,breaks - 1);
    ret.set(index,ret.get(index) + 1);
  }
  return ret;
}
Program: 4145
Project: 4145
Buggy source:
public Object getST(){
  return st.toByteArray();
}

Fixed version (ground truth):
public Object getST(){
  return doubleToBytes(st);
}
Program: 4146
Project: 4146
Buggy source:
/** 
 * Sets the operating system variables.
 */
public static void setOperatingSystems(){
  _isWindows=false;
  _isWindowsNTor2000orXP=false;
  _isWindows2000orXP=false;
  _isWindowsNT=false;
  _isWindowsXP=false;
  _isWindows95=false;
  _isWindows98=false;
  _isWindowsMe=false;
  _isSolaris=false;
  _isLinux=false;
  _isOS2=false;
  _isMacOSX=false;
  String os=System.getProperty("String_Node_Str").toLowerCase(Locale.US);
  _isWindows=os.indexOf("String_Node_Str") != -1;
  if (os.indexOf("String_Node_Str") != -1 || os.indexOf("String_Node_Str") != -1 || os.indexOf("String_Node_Str") != -1)   _isWindowsNTor2000orXP=true;
  if (os.indexOf("String_Node_Str") != -1 || os.indexOf("String_Node_Str") != -1)   _isWindows2000orXP=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsNT=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsXP=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsVista=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindows95=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindows98=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsMe=true;
  _isSolaris=os.indexOf("String_Node_Str") != -1;
  _isLinux=os.indexOf("String_Node_Str") != -1;
  _isOS2=os.indexOf("String_Node_Str") != -1;
  if (_isWindows || _isLinux)   _supportsTray=true;
  if (os.startsWith("String_Node_Str")) {
    if (os.endsWith("String_Node_Str")) {
      _isMacOSX=true;
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the operating system variables.
 */
public static void setOperatingSystems(){
  _isWindows=false;
  _isWindowsVista=false;
  _isWindowsNT=false;
  _isWindowsXP=false;
  _isWindows95=false;
  _isWindows98=false;
  _isWindowsMe=false;
  _isSolaris=false;
  _isLinux=false;
  _isOS2=false;
  _isMacOSX=false;
  String os=System.getProperty("String_Node_Str").toLowerCase(Locale.US);
  _isWindows=os.indexOf("String_Node_Str") != -1;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsNT=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsXP=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsVista=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindows95=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindows98=true;
  if (os.indexOf("String_Node_Str") != -1)   _isWindowsMe=true;
  _isSolaris=os.indexOf("String_Node_Str") != -1;
  _isLinux=os.indexOf("String_Node_Str") != -1;
  _isOS2=os.indexOf("String_Node_Str") != -1;
  if (_isWindows || _isLinux)   _supportsTray=true;
  if (os.startsWith("String_Node_Str")) {
    if (os.endsWith("String_Node_Str")) {
      _isMacOSX=true;
    }
  }
}
Program: 4147
Project: 4147
Buggy source:
/** 
 * Returns true iff <tt>file</tt> is a sensitive directory.
 */
public static boolean isSensitiveDirectory(File folder){
  if (folder == null)   return false;
  String userHome=System.getProperty("String_Node_Str");
  if (folder.equals(new File(userHome)))   return true;
  String[] sensitive;
  if (OSUtils.isWindows()) {
    sensitive=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  }
 else   if (OSUtils.isMacOSX()) {
    sensitive=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  }
 else   if (OSUtils.isPOSIX()) {
    sensitive=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  }
 else {
    sensitive=new String[0];
  }
  String folderName=folder.getName();
  for (  String name : sensitive) {
    if (folderName.equals(name))     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true iff <tt>file</tt> is a sensitive directory.
 */
public static boolean isSensitiveDirectory(File folder){
  if (folder == null)   return false;
  String userHome=System.getProperty("String_Node_Str");
  if (folder.equals(new File(userHome)))   return true;
  String userHomeShortDir=userHome.substring(userHome.lastIndexOf(File.separator) + 1);
  String[] sensitive;
  if (OSUtils.isWindowsVista()) {
    sensitive=new String[]{"String_Node_Str",userHomeShortDir + "String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  }
 else   if (OSUtils.isWindows()) {
    sensitive=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  }
 else   if (OSUtils.isMacOSX()) {
    sensitive=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  }
 else   if (OSUtils.isPOSIX()) {
    sensitive=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  }
 else {
    sensitive=new String[0];
  }
  String folderPath=folder.getPath();
  for (  String name : sensitive) {
    if (folderPath.endsWith(File.separator + name)) {
      return true;
    }
  }
  return false;
}
Program: 4149
Project: 4149
Buggy source:
/** 
 * @return true if continuing is hopeless
 */
public boolean shouldStop(){
  return linkManager.getNumConnections() == 0 && _peers.size() == 0 && state.getLock() != TorrentState.SEEDING;
}

Fixed version (ground truth):
/** 
 * @return true if continuing is hopeless
 */
public boolean shouldStop(){
  return linkManager.getNumConnections() == 0 && _peers.size() == 0 && state.get() != TorrentState.SEEDING;
}
Program: 4150
Project: 4150
Buggy source:
public void startElement(String namespaceUri,String localName,String qualifiedName,Attributes attributes){
  if (_isFirstElement) {
    _isFirstElement=false;
    _result.canonicalKeyPrefix=qualifiedName;
    return;
  }
  if (_result.type == null) {
    _result.type=qualifiedName;
    _result.schemaURI="String_Node_Str" + _result.type + "String_Node_Str";
    _result.canonicalKeyPrefix+="String_Node_Str" + qualifiedName + "String_Node_Str";
  }
  int attributesLength=attributes.getLength();
  if (attributesLength > 0) {
    Map<String,String> attributeMap=new HashMap<String,String>(attributesLength);
    for (int i=0; i < attributesLength; i++) {
      attributeMap.put(_result.canonicalKeyPrefix + attributes.getQName(i) + "String_Node_Str",attributes.getValue(i).trim());
    }
    _result.add(attributeMap);
  }
 else {
    Map<String,String> empty=Collections.emptyMap();
    _result.add(empty);
  }
}

Fixed version (ground truth):
public void startElement(String namespaceUri,String localName,String qualifiedName,Attributes attributes){
  if (_isFirstElement) {
    _isFirstElement=false;
    _result.canonicalKeyPrefix=qualifiedName;
    return;
  }
  if (_result.type == null) {
    _result.type=qualifiedName;
    _result.schemaURI="String_Node_Str" + _result.type + "String_Node_Str";
    _result.canonicalKeyPrefix+="String_Node_Str" + qualifiedName + "String_Node_Str";
  }
  int attributesLength=attributes.getLength();
  _result.canonicalKeyPrefix=_result.canonicalKeyPrefix.toLowerCase(Locale.US);
  if (attributesLength > 0) {
    Map<String,String> attributeMap=new HashMap<String,String>(attributesLength);
    for (int i=0; i < attributesLength; i++) {
      attributeMap.put(_result.canonicalKeyPrefix + attributes.getQName(i) + "String_Node_Str",attributes.getValue(i).trim());
    }
    _result.add(attributeMap);
  }
 else {
    Map<String,String> empty=Collections.emptyMap();
    _result.add(empty);
  }
}
Program: 4151
Project: 4151
Buggy source:
private void sendAndAssertResponse(Response resp,GUID guid,boolean expectedToBeFiltered) throws Exception {
  QueryReply reply=KeywordFilterTest.createReply(resp,guid,testUP[0].getPort(),testUP[0].getInetAddress().getAddress());
  callback.guid=reply.getClientGUID();
  callback.desc=null;
  testUP[0].send(reply);
  testUP[0].flush();
  RemoteFileDesc desc=callback.waitForRFD(1000);
  if (expectedToBeFiltered) {
    assertNull(desc);
  }
 else {
    assertNotNull(desc);
    assertEquals(resp.getName(),desc.getFileName());
  }
}

Fixed version (ground truth):
private void sendAndAssertResponse(Response resp,GUID guid,boolean expectedToBeFiltered) throws Exception {
  QueryReply reply=createReply(resp,guid,testUP[0].getPort(),testUP[0].getInetAddress().getAddress());
  callback.guid=reply.getClientGUID();
  callback.desc=null;
  testUP[0].send(reply);
  testUP[0].flush();
  RemoteFileDesc desc=callback.waitForRFD(1000);
  if (expectedToBeFiltered) {
    assertNull(desc);
  }
 else {
    assertNotNull(desc);
    assertEquals(resp.getName(),desc.getFileName());
  }
}
Program: 4153
Project: 4153
Buggy source:
/** 
 * Overloaded constructor that allows the creation of Responses with meta-data and a <tt>Set</tt> of <tt>URN</tt> instances. This is the primary constructor that establishes all of the class's invariants, does any necessary parameter validation, etc. If extensions is non-null, it is used as the extBytes instead of creating them from the urns and locations.
 * @param index the index of the file referenced in the response
 * @param size the size of the file (in bytes)
 * @param name the name of the file
 * @param urns the <tt>Set</tt> of <tt>URN</tt> instances associatedwith the file
 * @param doc the <tt>LimeXMLDocument</tt> instance associated with thefile
 * @param endpoints a collection of other locations on this network thatwill have this file
 * @param extensions The raw unparsed extension bytes.
 */
private Response createResponse(long index,long size,String name,Set<? extends URN> urns,LimeXMLDocument doc,GGEPContainer ggepData,byte[] extensions){
  if (ggepData == null) {
    if (size <= Integer.MAX_VALUE)     ggepData=GGEPContainer.EMPTY;
 else     ggepData=new GGEPContainer(null,-1L,size);
  }
  if (extensions == null)   extensions=createExtBytes(urns,ggepData);
  return new Response(index,size,name,urns,doc,ggepData.locations,ggepData.createTime,extensions);
}

Fixed version (ground truth):
/** 
 * Overloaded constructor that allows the creation of Responses with meta-data and a <tt>Set</tt> of <tt>URN</tt> instances. This is the primary constructor that establishes all of the class's invariants, does any necessary parameter validation, etc. If extensions is non-null, it is used as the extBytes instead of creating them from the urns and locations.
 * @param index the index of the file referenced in the response
 * @param size the size of the file (in bytes)
 * @param name the name of the file
 * @param incomingNameByteArraySize TODO
 * @param urns the <tt>Set</tt> of <tt>URN</tt> instances associatedwith the file
 * @param doc the <tt>LimeXMLDocument</tt> instance associated with thefile
 * @param extensions The raw unparsed extension bytes.
 * @param endpoints a collection of other locations on this network thatwill have this file
 */
private Response createResponse(long index,long size,String name,int incomingNameByteArraySize,Set<? extends URN> urns,LimeXMLDocument doc,GGEPContainer ggepData,byte[] extensions){
  if (ggepData == null) {
    if (size <= Integer.MAX_VALUE)     ggepData=GGEPContainer.EMPTY;
 else     ggepData=new GGEPContainer(null,-1L,size);
  }
  if (extensions == null)   extensions=createExtBytes(urns,ggepData);
  return new Response(index,size,name,incomingNameByteArraySize,urns,doc,ggepData.locations,ggepData.createTime,extensions);
}
Program: 4154
Project: 4154
Buggy source:
public Response createFromStream(InputStream is) throws IOException {
  long index=ByteOrder.uint2long(ByteOrder.leb2int(is));
  long size=ByteOrder.uint2long(ByteOrder.leb2int(is));
  if ((index & 0xFFFFFFFF00000000L) != 0)   throw new IOException("String_Node_Str" + index);
  if (size < 0)   throw new IOException("String_Node_Str" + size);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  int c;
  while ((c=is.read()) != 0) {
    if (c == -1)     throw new IOException("String_Node_Str");
    baos.write(c);
  }
  String name=new String(baos.toByteArray(),"String_Node_Str");
  checkFilename(name);
  baos.reset();
  while ((c=is.read()) != 0) {
    if (c == -1)     throw new IOException("String_Node_Str");
    baos.write(c);
  }
  byte[] rawMeta=baos.toByteArray();
  if (rawMeta.length == 0) {
    if (is.available() < 16) {
      throw new IOException("String_Node_Str");
    }
    return createResponse(index,size,name);
  }
 else {
    HUGEExtension huge=new HUGEExtension(rawMeta);
    Set<URN> urns=huge.getURNS();
    LimeXMLDocument doc=null;
    for (    String next : huge.getMiscBlocks()) {
      doc=createXmlDocument(name,next);
      if (doc != null)       break;
    }
    GGEPContainer ggep=getGGEP(huge.getGGEP());
    if (ggep.size64 > MAX_FILE_SIZE)     throw new IOException("String_Node_Str" + ggep.size64);
    if (ggep.size64 > Integer.MAX_VALUE)     size=ggep.size64;
    return createResponse(index,size,name,urns,doc,ggep,rawMeta);
  }
}

Fixed version (ground truth):
public Response createFromStream(InputStream is) throws IOException {
  long index=ByteOrder.uint2long(ByteOrder.leb2int(is));
  long size=ByteOrder.uint2long(ByteOrder.leb2int(is));
  int incomingNameByteArraySize;
  if ((index & 0xFFFFFFFF00000000L) != 0)   throw new IOException("String_Node_Str" + index);
  if (size < 0)   throw new IOException("String_Node_Str" + size);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  int c;
  while ((c=is.read()) != 0) {
    if (c == -1)     throw new IOException("String_Node_Str");
    baos.write(c);
  }
  incomingNameByteArraySize=baos.size();
  String name=new String(baos.toByteArray(),"String_Node_Str");
  checkFilename(name);
  baos.reset();
  while ((c=is.read()) != 0) {
    if (c == -1)     throw new IOException("String_Node_Str");
    baos.write(c);
  }
  byte[] rawMeta=baos.toByteArray();
  if (rawMeta.length == 0) {
    if (is.available() < 16) {
      throw new IOException("String_Node_Str");
    }
    return createResponse(index,size,name,incomingNameByteArraySize,null,null,null,null);
  }
 else {
    HUGEExtension huge=new HUGEExtension(rawMeta);
    Set<URN> urns=huge.getURNS();
    LimeXMLDocument doc=null;
    for (    String next : huge.getMiscBlocks()) {
      doc=createXmlDocument(name,next);
      if (doc != null)       break;
    }
    GGEPContainer ggep=getGGEP(huge.getGGEP());
    if (ggep.size64 > MAX_FILE_SIZE)     throw new IOException("String_Node_Str" + ggep.size64);
    if (ggep.size64 > Integer.MAX_VALUE)     size=ggep.size64;
    return createResponse(index,size,name,incomingNameByteArraySize,urns,doc,ggep,rawMeta);
  }
}
Program: 4155
Project: 4155
Buggy source:
protected void createResponseList(QueryReply qr,String response) throws BadPacketException {
  final QueryReply localqr=qr;
  final List<Response> responseList=new Vector<Response>();
  final Response qrResponse;
  long index=0;
  long size=0;
  LimeXMLDocument emptyDoc=null;
  Set<URN> emptyurns=null;
  Set<IpPort> alternateLocations=null;
  long creationTime=0;
  byte[] extensions=null;
  qrResponse=new Response(index,size,response,emptyurns,emptyDoc,alternateLocations,creationTime,extensions);
  responseList.add(qrResponse);
  context.checking(new Expectations(){
{
      one(localqr).getResultsAsList();
      will(returnValue(responseList));
    }
  }
);
}

Fixed version (ground truth):
protected void createResponseList(QueryReply qr,String response) throws BadPacketException {
  final QueryReply localqr=qr;
  final List<Response> responseList=new Vector<Response>();
  final Response qrResponse;
  long index=0;
  long size=0;
  LimeXMLDocument emptyDoc=null;
  Set<URN> emptyurns=null;
  Set<IpPort> alternateLocations=null;
  long creationTime=0;
  byte[] extensions=null;
  qrResponse=new Response(index,size,response,-1,emptyurns,emptyDoc,alternateLocations,creationTime,extensions);
  responseList.add(qrResponse);
  context.checking(new Expectations(){
{
      one(localqr).getResultsAsList();
      will(returnValue(responseList));
    }
  }
);
}
Program: 4157
Project: 4157
Buggy source:
public void run(){
  ByteBufferCache cache=NIODispatcher.instance().getBufferCache();
  if (readIncoming != null)   cache.release(readIncoming);
  if (readOutgoing != null)   cache.release(readOutgoing);
  if (writeOutgoing != null)   cache.release(writeOutgoing);
}

Fixed version (ground truth):
public void run(){
  if (readIncoming != null)   byteBufferCache.release(readIncoming);
  if (readOutgoing != null)   byteBufferCache.release(readOutgoing);
  if (writeOutgoing != null)   byteBufferCache.release(writeOutgoing);
}
Program: 4158
Project: 4158
Buggy source:
public SSLReadWriteChannel(SSLContext context,Executor executor){
  this.executor=executor;
  this.context=context;
}

Fixed version (ground truth):
public SSLReadWriteChannel(SSLContext context,Executor sslBlockingExecutor,ByteBufferCache byteBufferCache,Executor networkExecutor){
  this.sslBlockingExecutor=sslBlockingExecutor;
  this.context=context;
  this.byteBufferCache=byteBufferCache;
  this.networkExecutor=networkExecutor;
}
Program: 4160
Project: 4160
Buggy source:
/** 
 * The engine needs to run some tasks before proceeding... 
 */
private void needTask(){
synchronized (taskLock) {
    taskScheduled=true;
    readSink.interestRead(false);
    writeSink.interestWrite(null,false);
  }
  while (true) {
    final Runnable runner=engine.getDelegatedTask();
    if (runner == null) {
      executor.execute(new Runnable(){
        public void run(){
synchronized (taskLock) {
            taskScheduled=false;
          }
          HandshakeStatus status=engine.getHandshakeStatus();
          if (LOG.isDebugEnabled())           LOG.debug("String_Node_Str" + status);
          processHandshakeResult(false,false,status);
        }
      }
);
      break;
    }
 else {
      executor.execute(runner);
    }
  }
}

Fixed version (ground truth):
/** 
 * The engine needs to run some tasks before proceeding... 
 */
private void needTask(){
synchronized (taskLock) {
    taskScheduled=true;
    readSink.interestRead(false);
    writeSink.interestWrite(null,false);
  }
  while (true) {
    final Runnable runner=engine.getDelegatedTask();
    if (runner == null) {
      sslBlockingExecutor.execute(new Runnable(){
        public void run(){
synchronized (taskLock) {
            taskScheduled=false;
          }
          HandshakeStatus status=engine.getHandshakeStatus();
          if (LOG.isDebugEnabled())           LOG.debug("String_Node_Str" + status);
          processHandshakeResult(false,false,status);
        }
      }
);
      break;
    }
 else {
      sslBlockingExecutor.execute(runner);
    }
  }
}
Program: 4161
Project: 4161
Buggy source:
/** 
 * Processes a single handshake result. If a delegated task is needed, returns false & schedules the task(s). If writing is needed, returns false only if currently reading. If reading is needed, returns false only if currently writing. Otherwise, returns true.
 */
private boolean processHandshakeResult(boolean reading,boolean writing,HandshakeStatus hs){
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + engine + "String_Node_Str"+ hs);
  needsHandshakeWrap=false;
  needsHandshakeUnwrap=false;
switch (hs) {
case NEED_TASK:
    needTask();
  return false;
case NEED_WRAP:
needsHandshakeWrap=true;
readSink.interestRead(false);
writeSink.interestWrite(this,true);
return writing;
case NEED_UNWRAP:
writeSink.interestWrite(null,false);
synchronized (readInterestLock) {
needsHandshakeUnwrap=true;
readSink.interestRead(true);
}
if (readDataLeft && !reading) NIODispatcher.instance().getScheduledExecutorService().execute(new Runnable(){
public void run(){
try {
read(BufferUtils.getEmptyBuffer());
}
 catch (IOException iox) {
FileUtils.close(SSLReadWriteChannel.this);
}
}
}
);
return reading;
case FINISHED:
synchronized (readInterestLock) {
readSink.interestRead(readInterest);
}
writeSink.interestWrite(this,true);
case NOT_HANDSHAKING:
default :
return true;
}
}

Fixed version (ground truth):
/** 
 * Processes a single handshake result. If a delegated task is needed, returns false & schedules the task(s). If writing is needed, returns false only if currently reading. If reading is needed, returns false only if currently writing. Otherwise, returns true.
 */
private boolean processHandshakeResult(boolean reading,boolean writing,HandshakeStatus hs){
  if (LOG.isTraceEnabled())   LOG.trace("String_Node_Str" + engine + "String_Node_Str"+ hs);
  needsHandshakeWrap=false;
  needsHandshakeUnwrap=false;
switch (hs) {
case NEED_TASK:
    needTask();
  return false;
case NEED_WRAP:
needsHandshakeWrap=true;
readSink.interestRead(false);
writeSink.interestWrite(this,true);
return writing;
case NEED_UNWRAP:
writeSink.interestWrite(null,false);
synchronized (readInterestLock) {
needsHandshakeUnwrap=true;
readSink.interestRead(true);
}
if (readDataLeft && !reading) networkExecutor.execute(new Runnable(){
public void run(){
try {
read(BufferUtils.getEmptyBuffer());
}
 catch (IOException iox) {
FileUtils.close(SSLReadWriteChannel.this);
}
}
}
);
return reading;
case FINISHED:
synchronized (readInterestLock) {
readSink.interestRead(readInterest);
}
writeSink.interestWrite(this,true);
case NOT_HANDSHAKING:
default :
return true;
}
}
Program: 4162
Project: 4162
Buggy source:
/** 
 * Initializes this TLSLayer, using the given address and enabling the given cipherSuites. If clientMode is disabled, client authentication can be turned on/off.
 * @param addr
 * @param cipherSuites
 */
void initialize(SocketAddress addr,String[] cipherSuites,boolean clientMode,boolean needClientAuth){
synchronized (initLock) {
    if (shutdown) {
      LOG.debug("String_Node_Str");
      return;
    }
    if (addr != null) {
      if (!(addr instanceof InetSocketAddress))       throw new IllegalArgumentException("String_Node_Str");
      InetSocketAddress iaddr=(InetSocketAddress)addr;
      String host=iaddr.getAddress().getHostAddress();
      int port=iaddr.getPort();
      engine=context.createSSLEngine(host,port);
    }
 else {
      engine=context.createSSLEngine();
    }
    engine.setEnabledCipherSuites(cipherSuites);
    engine.setUseClientMode(clientMode);
    if (!clientMode) {
      engine.setWantClientAuth(needClientAuth);
      engine.setNeedClientAuth(needClientAuth);
    }
    SSLSession session=engine.getSession();
    readIncoming=NIODispatcher.instance().getBufferCache().getHeap(session.getApplicationBufferSize());
    writeOutgoing=NIODispatcher.instance().getBufferCache().getHeap(session.getPacketBufferSize());
    if (LOG.isTraceEnabled())     LOG.trace("String_Node_Str" + engine + "String_Node_Str"+ session);
  }
}

Fixed version (ground truth):
/** 
 * Initializes this TLSLayer, using the given address and enabling the given cipherSuites. If clientMode is disabled, client authentication can be turned on/off.
 * @param addr
 * @param cipherSuites
 */
void initialize(SocketAddress addr,String[] cipherSuites,boolean clientMode,boolean needClientAuth){
synchronized (initLock) {
    if (shutdown) {
      LOG.debug("String_Node_Str");
      return;
    }
    if (addr != null) {
      if (!(addr instanceof InetSocketAddress))       throw new IllegalArgumentException("String_Node_Str");
      InetSocketAddress iaddr=(InetSocketAddress)addr;
      String host=iaddr.getAddress().getHostAddress();
      int port=iaddr.getPort();
      engine=context.createSSLEngine(host,port);
    }
 else {
      engine=context.createSSLEngine();
    }
    engine.setEnabledCipherSuites(cipherSuites);
    engine.setUseClientMode(clientMode);
    if (!clientMode) {
      engine.setWantClientAuth(needClientAuth);
      engine.setNeedClientAuth(needClientAuth);
    }
    SSLSession session=engine.getSession();
    readIncoming=byteBufferCache.getHeap(session.getApplicationBufferSize());
    writeOutgoing=byteBufferCache.getHeap(session.getPacketBufferSize());
    if (LOG.isTraceEnabled())     LOG.trace("String_Node_Str" + engine + "String_Node_Str"+ session);
  }
}
Program: 4163
Project: 4163
Buggy source:
/** 
 * Releases any resources that were acquired by the channel. If the underlying channels are still open, this method only propogates the shutdown call, instead of shutting down this channel, as it can still be used by other channels.
 */
public void shutdown(){
synchronized (initLock) {
    if (shutdown)     return;
    if (!isOpen()) {
      LOG.debug("String_Node_Str");
      shutdown=true;
    }
  }
  if (shutdown) {
    NIODispatcher.instance().getScheduledExecutorService().execute(new Runnable(){
      public void run(){
        ByteBufferCache cache=NIODispatcher.instance().getBufferCache();
        if (readIncoming != null)         cache.release(readIncoming);
        if (readOutgoing != null)         cache.release(readOutgoing);
        if (writeOutgoing != null)         cache.release(writeOutgoing);
      }
    }
);
  }
  Shutdownable observer=writeWanter;
  if (observer != null)   observer.shutdown();
}

Fixed version (ground truth):
/** 
 * Releases any resources that were acquired by the channel. If the underlying channels are still open, this method only propogates the shutdown call, instead of shutting down this channel, as it can still be used by other channels.
 */
public void shutdown(){
synchronized (initLock) {
    if (shutdown)     return;
    if (!isOpen()) {
      LOG.debug("String_Node_Str");
      shutdown=true;
    }
  }
  if (shutdown) {
    networkExecutor.execute(new Runnable(){
      public void run(){
        if (readIncoming != null)         byteBufferCache.release(readIncoming);
        if (readOutgoing != null)         byteBufferCache.release(readOutgoing);
        if (writeOutgoing != null)         byteBufferCache.release(writeOutgoing);
      }
    }
);
  }
  Shutdownable observer=writeWanter;
  if (observer != null)   observer.shutdown();
}
Program: 4164
Project: 4164
Buggy source:
@Override protected void initIncomingSocket(){
  super.initIncomingSocket();
  tlsLayer=new SSLReadWriteChannel(SSLUtils.getTLSContext(),SSLUtils.getExecutor());
  tlsLayer.initialize(getRemoteSocketAddress(),SSLUtils.getTLSCipherSuites(),false,false);
}

Fixed version (ground truth):
@Override protected void initIncomingSocket(){
  super.initIncomingSocket();
  tlsLayer=new SSLReadWriteChannel(SSLUtils.getTLSContext(),SSLUtils.getExecutor(),NIODispatcher.instance().getBufferCache(),NIODispatcher.instance().getScheduledExecutorService());
  tlsLayer.initialize(getRemoteSocketAddress(),SSLUtils.getTLSCipherSuites(),false,false);
}
Program: 4165
Project: 4165
Buggy source:
@Override protected void initOutgoingSocket() throws IOException {
  super.initOutgoingSocket();
  tlsLayer=new SSLReadWriteChannel(SSLUtils.getTLSContext(),SSLUtils.getExecutor());
}

Fixed version (ground truth):
@Override protected void initOutgoingSocket() throws IOException {
  super.initOutgoingSocket();
  tlsLayer=new SSLReadWriteChannel(SSLUtils.getTLSContext(),SSLUtils.getExecutor(),NIODispatcher.instance().getBufferCache(),NIODispatcher.instance().getScheduledExecutorService());
}
Program: 4166
Project: 4166
Buggy source:
public void testClientTLSFails() throws Exception {
  Executor executor=ExecutorsHelper.newProcessingQueue("String_Node_Str");
  SSLContext context=SSLContext.getInstance("String_Node_Str");
  context.init(null,null,null);
  SSLReadWriteChannel channel=new SSLReadWriteChannel(context,executor);
  channel.initialize(null,new String[]{"String_Node_Str"},true,false);
  ReadBufferChannel readSink=new ReadBufferChannel("String_Node_Str".getBytes());
  WriteBufferChannel writeSink=new WriteBufferChannel(300);
  channel.setReadChannel(readSink);
  channel.setWriteChannel(writeSink);
  new WriteBufferChannel("String_Node_Str".getBytes(),channel);
  channel.handleWrite();
  ByteBuffer readTo=ByteBuffer.allocate(200);
  try {
    channel.read(readTo);
    fail("String_Node_Str");
  }
 catch (  SSLException expected) {
  }
  writeSink.close();
  readSink.close();
  channel.shutdown();
}

Fixed version (ground truth):
public void testClientTLSFails() throws Exception {
  Executor executor=ExecutorsHelper.newProcessingQueue("String_Node_Str");
  SSLContext context=SSLContext.getInstance("String_Node_Str");
  context.init(null,null,null);
  SSLReadWriteChannel channel=new SSLReadWriteChannel(context,executor,NIODispatcher.instance().getBufferCache(),NIODispatcher.instance().getScheduledExecutorService());
  channel.initialize(null,new String[]{"String_Node_Str"},true,false);
  ReadBufferChannel readSink=new ReadBufferChannel("String_Node_Str".getBytes());
  WriteBufferChannel writeSink=new WriteBufferChannel(300);
  channel.setReadChannel(readSink);
  channel.setWriteChannel(writeSink);
  new WriteBufferChannel("String_Node_Str".getBytes(),channel);
  channel.handleWrite();
  ByteBuffer readTo=ByteBuffer.allocate(200);
  try {
    channel.read(readTo);
    fail("String_Node_Str");
  }
 catch (  SSLException expected) {
  }
  writeSink.close();
  readSink.close();
  channel.shutdown();
}
Program: 4169
Project: 4169
Buggy source:
public IRWrapper(ReadableByteChannel channel){
  this.channel=channel;
  this.in=null;
}

Fixed version (ground truth):
public IRWrapper(InputStream in,ReadableByteChannel channel,int totalAllowedToRead){
  this.channel=channel;
  this.in=in;
  this.totalAllowedToRead=totalAllowedToRead;
}
Program: 4170
Project: 4170
Buggy source:
public int read(ByteBuffer dst) throws IOException {
  if (in == null || in.available() > 0) {
    int read=channel.read(dst);
    totalRead+=read;
    return read;
  }
 else   return 0;
}

Fixed version (ground truth):
public int read(ByteBuffer dst) throws IOException {
  if (totalRead >= totalAllowedToRead)   return -1;
  if (in == null || in.available() > 0) {
    int oldLimit=dst.limit();
    if (dst.remaining() + totalRead > totalAllowedToRead)     dst.limit(totalAllowedToRead - totalRead + dst.position());
    int read=channel.read(dst);
    dst.limit(oldLimit);
    totalRead+=read;
    return read;
  }
 else   return 0;
}
Program: 4171
Project: 4171
Buggy source:
public void testServerTLSFails() throws Exception {
  Executor executor=ExecutorsHelper.newProcessingQueue("String_Node_Str");
  SSLContext context=SSLContext.getInstance("String_Node_Str");
  context.init(null,null,null);
  SSLReadWriteChannel channel=new SSLReadWriteChannel(context,executor);
  channel.initialize(null,new String[]{"String_Node_Str"},false,false);
  ReadBufferChannel readSink=new ReadBufferChannel("String_Node_Str".getBytes());
  channel.setReadChannel(readSink);
  ByteBuffer readTo=ByteBuffer.allocate(200);
  try {
    channel.read(readTo);
    fail("String_Node_Str");
  }
 catch (  SSLException expected) {
  }
  readSink.close();
  channel.shutdown();
}

Fixed version (ground truth):
public void testServerTLSFails() throws Exception {
  Executor executor=ExecutorsHelper.newProcessingQueue("String_Node_Str");
  SSLContext context=SSLContext.getInstance("String_Node_Str");
  context.init(null,null,null);
  SSLReadWriteChannel channel=new SSLReadWriteChannel(context,executor,NIODispatcher.instance().getBufferCache(),NIODispatcher.instance().getScheduledExecutorService());
  channel.initialize(null,new String[]{"String_Node_Str"},false,false);
  ReadBufferChannel readSink=new ReadBufferChannel("String_Node_Str".getBytes());
  channel.setReadChannel(readSink);
  ByteBuffer readTo=ByteBuffer.allocate(200);
  try {
    channel.read(readTo);
    fail("String_Node_Str");
  }
 catch (  SSLException expected) {
  }
  readSink.close();
  channel.shutdown();
}
Program: 4173
Project: 4173
Buggy source:
public SSLSession call(){
  channel2.initialize(null,new String[]{"String_Node_Str"},true,false);
  return channel2.getSession();
}

Fixed version (ground truth):
public Void call() throws IOException {
  lastClientReadAmount.set(clientChannel.read(clientRead));
  return null;
}
Program: 4177
Project: 4177
Buggy source:
private MutableGUIDFilter(){
  FILTER.disallowAdult();
}

Fixed version (ground truth):
MutableGUIDFilter(){
  this(new KeywordFilter());
  FILTER.disallowAdult();
}
Program: 4178
Project: 4178
Buggy source:
public static void globalSetUp(){
  try {
    URN sha1=URN.createSHA1Urn("String_Node_Str");
    urn=ProviderHacks.getQueryRequestFactory().createRequery(sha1);
    urnFile=ProviderHacks.getQueryRequestFactory().createQuery(sha1,"String_Node_Str");
    noUrn=ProviderHacks.getQueryRequestFactory().createQuery("String_Node_Str");
  }
 catch (  IOException impossible) {
    ErrorService.error(impossible);
  }
  filter=new HashFilter();
}

Fixed version (ground truth):
public static void globalSetUp(){
  context=new Mockery();
  query=context.mock(QueryRequest.class);
  ping=context.mock(PingRequest.class);
  filter=new HashFilter();
}
Program: 4179
Project: 4179
Buggy source:
@Override protected void setUp() throws Exception {
  address=InetAddress.getLocalHost().getAddress();
  context=new Mockery();
  queryRequestMock=context.mock(QueryRequest.class);
  queryReplyMock=context.mock(QueryReply.class);
  pingRequestMock=context.mock(PingRequest.class);
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  context=new Mockery();
  queryRequestMock=context.mock(QueryRequest.class);
  queryReplyMock=context.mock(QueryReply.class);
  pingRequestMock=context.mock(PingRequest.class);
}
Program: 4180
Project: 4180
Buggy source:
/** 
 * Tests if more than one guid can be added by seeing if messages for it are filterted. Also test removal.
 */
public void testAddRemoveGUID(){
  MutableGUIDFilter filter=ProviderHacks.getMutableGUIDFilter();
  GUID guid=new GUID();
  filter.addGUID(guid.bytes());
  QueryReply qr=KeywordFilterTest.createReply(ProviderHacks.getResponseFactory().createResponse(1,2,"String_Node_Str"),guid,777,address);
  QueryReply unrelated=KeywordFilterTest.createReply(ProviderHacks.getResponseFactory().createResponse(1,2,"String_Node_Str"),new GUID(),777,address);
  assertFalse(filter.allow(qr));
  assertTrue(filter.allow(unrelated));
  GUID guid2=new GUID();
  filter.addGUID(guid2.bytes());
  QueryReply qr2=KeywordFilterTest.createReply(ProviderHacks.getResponseFactory().createResponse(1,2,"String_Node_Str"),guid2,777,address);
  assertFalse(filter.allow(qr2));
  assertFalse(filter.allow(qr));
  assertTrue(filter.allow(unrelated));
  filter.removeGUID(guid.bytes());
  assertFalse(filter.allow(qr2));
  assertTrue(filter.allow(qr));
  assertTrue(filter.allow(unrelated));
  filter.removeGUID(guid.bytes());
  assertFalse(filter.allow(qr2));
  assertTrue(filter.allow(qr));
  assertTrue(filter.allow(unrelated));
  filter.removeGUID(guid2.bytes());
  assertTrue(filter.allow(qr));
  assertTrue(filter.allow(qr2));
  assertTrue(filter.allow(unrelated));
}

Fixed version (ground truth):
public void testAddRemoveGUID(){
  final GUID guid=new GUID();
  final GUID guid2=new GUID();
  Message msg=null;
  assertTrue(filter.allow(msg));
  filter.addGUID(guid.bytes());
  context.checking(new Expectations(){
{
      exactly(1).of(queryReplyMock).getGUID();
      will(returnValue(guid.bytes()));
      exactly(1).of(queryReplyMock).getGUID();
      will(returnValue(guid2.bytes()));
    }
  }
);
  assertFalse(filter.allow(queryReplyMock));
  assertTrue(filter.allow(queryReplyMock));
  filter.removeGUID(guid.bytes());
  context.checking(new Expectations(){
{
      exactly(1).of(queryReplyMock).getGUID();
      will(returnValue(guid.bytes()));
      exactly(1).of(queryReplyMock).getGUID();
      will(returnValue(guid2.bytes()));
    }
  }
);
  assertTrue(filter.allow(queryReplyMock));
  assertTrue(filter.allow(queryReplyMock));
  context.assertIsSatisfied();
}
Program: 4181
Project: 4181
Buggy source:
@Override protected void setUp() throws Exception {
  address=InetAddress.getLocalHost().getAddress();
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  context=new Mockery();
  filter=new MutableGUIDFilter(filterKeyword);
  queryReplyMock=context.mock(QueryReply.class);
  queryRequestMock=context.mock(QueryRequest.class);
}
Program: 4182
Project: 4182
Buggy source:
public <T>List<Future<T>> invokeAll(Collection<Callable<T>> tasks,long timeout,TimeUnit unit) throws InterruptedException {
  return null;
}

Fixed version (ground truth):
public <T>List<Future<T>> invokeAll(Collection tasks,long timeout,TimeUnit unit) throws InterruptedException {
  return null;
}
Program: 4183
Project: 4183
Buggy source:
public <T>T invokeAny(Collection<Callable<T>> tasks,long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  return null;
}

Fixed version (ground truth):
public <T>T invokeAny(Collection tasks,long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  return null;
}
Program: 4184
Project: 4184
Buggy source:
public void testReplies() throws Exception {
  assertTrue(allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
  assertTrue(!allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
}

Fixed version (ground truth):
public void testReplies() throws Exception {
  assertTrue(allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
  assertTrue(!allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
  assertTrue(allow("String_Node_Str"));
  context.assertIsSatisfied();
}
Program: 4185
Project: 4185
Buggy source:
private boolean allow(String vendorCode) throws Exception {
  byte[] vendorBytes=vendorCode.getBytes();
  assertEquals(4,vendorBytes.length);
  for (int i=0; i < vendorBytes.length; i++)   _replyBytes[_indexOfVendor + i]=vendorBytes[i];
  QueryReply qr=(QueryReply)ProviderHacks.getMessageFactory().read(new ByteArrayInputStream(_replyBytes));
  return _filter.allow(qr);
}

Fixed version (ground truth):
private boolean allow(final String vendorCode) throws Exception {
  context.checking(new Expectations(){
{
      exactly(1).of(queryReplyMock).getVendor();
      will(returnValue(vendorCode));
    }
  }
);
  return _filter.allow(queryReplyMock);
}
Program: 4186
Project: 4186
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.addTest(FileRequestHandlerTest.suite());
  suite.addTest(PushProxyRequestHandlerTest.suite());
  suite.addTest(HTTPUploadManagerTest.suite());
  suite.addTest(HTTPUploaderTest.suite());
  suite.addTest(UploadSlotManagerTest.suite());
  suite.addTest(UrnHttpRequestTest.suite());
  suite.addTest(HTTPAcceptorTest.suite());
  suite.addTest(UploadQueueingTest.suite());
  suite.addTest(UploadTest.suite());
  suite.addTest(PushUploadTest.suite());
  suite.addTest(AltLocUploadTest.suite());
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.addTest(FileRequestHandlerTest.suite());
  suite.addTest(PushProxyRequestHandlerTest.suite());
  suite.addTest(HTTPUploaderTest.suite());
  suite.addTest(UploadSlotManagerTest.suite());
  suite.addTest(UrnHttpRequestTest.suite());
  suite.addTest(HTTPAcceptorTest.suite());
  suite.addTest(UploadQueueingTest.suite());
  suite.addTest(UploadTest.suite());
  suite.addTest(PushUploadTest.suite());
  suite.addTest(AltLocUploadTest.suite());
  return suite;
}
Program: 4187
Project: 4187
Buggy source:
public void runBare() throws Throwable {
  _currentTestName=getName();
  if (System.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    System.out.println("String_Node_Str" + _currentTestName);
    LogFactory.getLog(this.getClass()).info("String_Node_Str" + _currentTestName);
  }
  assertNotNull(_currentTestName);
  try {
    preSetUp();
    setUp();
    runTest();
  }
  finally {
    try {
      tearDown();
    }
  finally {
      postTearDown();
    }
  }
}

Fixed version (ground truth):
public void runBare() throws Throwable {
  _currentTestName=getName();
  if (System.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    System.out.println("String_Node_Str" + _currentTestName);
  }
  assertNotNull(_currentTestName);
  try {
    preSetUp();
    setUp();
    runTest();
  }
  finally {
    try {
      tearDown();
    }
  finally {
      postTearDown();
    }
  }
}
Program: 4188
Project: 4188
Buggy source:
public void testDisallowAdult() throws Exception {
  KeywordFilter filter=new KeywordFilter();
  QueryReply qr=createReply("String_Node_Str");
  assertTrue(filter.allow(qr));
  qr=createReply("String_Node_Str");
  assertTrue(filter.allow(qr));
  filter.disallowAdult();
  assertFalse(filter.allow(qr));
  qr=createReply("String_Node_Str");
  assertFalse(filter.allow(qr));
  qr=createReply("String_Node_Str");
  assertTrue(filter.allow(qr));
}

Fixed version (ground truth):
public void testDisallowAdult() throws Exception {
  KeywordFilter filter=new KeywordFilter();
  createResponseList(queryReplyMock,"String_Node_Str");
  assertTrue(filter.allow(queryReplyMock));
  createResponseList(queryReplyMock,"String_Node_Str");
  assertTrue(filter.allow(queryReplyMock));
  filter.disallowAdult();
  createResponseList(queryReplyMock,"String_Node_Str");
  assertFalse(filter.allow(queryReplyMock));
  createResponseList(queryReplyMock,"String_Node_Str");
  assertFalse(filter.allow(queryReplyMock));
  createResponseList(queryReplyMock,"String_Node_Str");
  assertTrue(filter.allow(queryReplyMock));
  context.assertIsSatisfied();
}
Program: 4189
Project: 4189
Buggy source:
@Override protected void setUp() throws Exception {
  address=InetAddress.getLocalHost().getAddress();
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  address=InetAddress.getLocalHost().getAddress();
  context=new Mockery();
  queryRequestMock=context.mock(QueryRequest.class);
  queryReplyMock=context.mock(QueryReply.class);
  pingRequestMock=context.mock(PingRequest.class);
}