nus-yam/ex-repair huggingface dataset:
Program: 12937
Project: 12937
Buggy source:
public static boolean createNewCharacter(DatabaseConnectionProvider connectionProvider,int accountId,String name,byte[] appearance){
  try {
    Connection connection=connectionProvider.getConnection();
    PreparedStatement ps=connection.prepareStatement("String_Node_Str");
    ps.setInt(1,accountId);
    ps.setString(2,name);
    ps.setBytes(3,appearance);
    int rows=ps.executeUpdate();
    ps.close();
    connection.close();
    return rows == 1;
  }
 catch (  SQLException ex) {
    LOGGER.error("String_Node_Str");
  }
  return false;
}

Fixed version (ground truth):
public static boolean createNewCharacter(DatabaseConnectionProvider connectionProvider,int accountId,String characterName,byte sex,byte height,byte skin,byte haircolor,byte face,byte primaryProfession,byte hairstyle,byte campaign){
  try {
    Connection connection=connectionProvider.getConnection();
    PreparedStatement ps=connection.prepareStatement("String_Node_Str");
    ps.setInt(1,accountId);
    ps.setString(2,characterName);
    ps.setByte(3,sex);
    ps.setByte(4,height);
    ps.setByte(5,skin);
    ps.setByte(6,haircolor);
    ps.setByte(7,face);
    ps.setByte(8,primaryProfession);
    ps.setByte(9,hairstyle);
    ps.setByte(10,campaign);
    int rows=ps.executeUpdate();
    ps.close();
    connection.close();
    return rows == 1;
  }
 catch (  SQLException ex) {
    LOGGER.error("String_Node_Str");
  }
  return false;
}
Program: 12938
Project: 12938
Buggy source:
public void addCharacter(Session session,DBCharacter character){
  LOGGER.debug("String_Node_Str");
  P007_UnknownAction characterInfo=new P007_UnknownAction();
  characterInfo.init(session);
  characterInfo.setUnknown1(SessionAttachment.getLoginCount(session));
  characterInfo.setUnknown2(new byte[16]);
  characterInfo.setUnknown3(0);
  characterInfo.setUnknown4(character.getName().toCharArray());
  ByteBuffer buffer=ByteBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN);
  buffer.putShort((short)6);
  buffer.putShort((short)248);
  buffer.put(new byte[]{0x33,0x36,0x31,0x30});
  buffer.put(character.getAppearance());
  buffer.put(new byte[16]);
  buffer.put(new byte[]{0,-1,-0x23,-0x23,0,-0x23,-0x23,-0x23,-0x23});
  byte[] a=new byte[buffer.position()];
  buffer.position(0);
  buffer.get(a);
  characterInfo.setUnknown5(a);
  shardletContext.sendAction(characterInfo);
}

Fixed version (ground truth):
public void addCharacter(Session session,DBCharacter character){
  LOGGER.debug("String_Node_Str");
  P007_UnknownAction characterInfo=new P007_UnknownAction();
  characterInfo.init(session);
  characterInfo.setUnknown1(SessionAttachment.getLoginCount(session));
  characterInfo.setUnknown2(new byte[16]);
  characterInfo.setUnknown3(0);
  characterInfo.setUnknown4(character.getName().toCharArray());
  ByteBuffer buffer=ByteBuffer.allocate(100).order(ByteOrder.LITTLE_ENDIAN);
  buffer.putShort((short)6);
  buffer.putShort((short)248);
  buffer.put(new byte[]{0x33,0x36,0x31,0x30});
  buffer.put((byte)((character.getSkin() << 5) | (character.getHeight() << 1) | character.getSex()));
  buffer.put((byte)((character.getFace() << 7) | (character.getSkin() >> 3)));
  buffer.put((byte)((character.getPrimaryProfession() << 4) | (character.getFace() >> 1)));
  buffer.put((byte)((character.getCampaign() << 6) | character.getHairstyle()));
  buffer.put(new byte[16]);
  byte level=0;
  buffer.put((byte)((level << 4) | character.getCampaign()));
  buffer.put(new byte[]{-1,-0x23,-0x23,0,-0x23,-0x23,-0x23,-0x23});
  byte[] a=new byte[buffer.position()];
  buffer.position(0);
  buffer.get(a);
  characterInfo.setUnknown5(a);
  shardletContext.sendAction(characterInfo);
}
Program: 12940
Project: 12940
Buggy source:
/** 
 * This handler will be triggered by the R:S server when the game-app has been initialized completely.
 * @param event                   The event carrying the context information.
 */
@EventHandler public void gameAppCreatedEventHandler(GameAppCreatedEvent event){
  LoginShardView.SetLoginShardContext(event.getParent());
  DatabaseConnectionProvider connectionProvider=new DatabaseConnectionProvider(this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"));
  EntitySystemFacade entitySystem=new EntitySystemFacade();
  ClientLookupTable lookupTable=new ClientLookupTable();
  MapShardStartupEvent ev=new MapShardStartupEvent(connectionProvider,entitySystem,lookupTable);
  publishEvent(ev);
}

Fixed version (ground truth):
/** 
 * This handler will be triggered by the R:S server when the game-app has been initialized completely.
 * @param event                   The event carrying the context information.
 */
@EventHandler public void gameAppCreatedEventHandler(GameAppCreatedEvent event){
  LoginShardView.SetLoginShardContext(event.getParent());
  DatabaseConnectionProvider connectionProvider=new DatabaseConnectionProvider(this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"),this.getInitParameter("String_Node_Str"));
  ClientLookupTable lookupTable=new ClientLookupTable();
  MapShardStartupEvent ev=new MapShardStartupEvent(connectionProvider,null,lookupTable);
  publishEvent(ev);
}
Program: 12941
Project: 12941
Buggy source:
/** 
 * Constructor
 * @param opts parsed argument list
 * @throws IOException error parsing options
 */
private Match(ArgList opts) throws IOException {
  this(JenaConnect.parseConfig(opts.get("String_Node_Str"),opts.getValueMap("String_Node_Str")),JenaConnect.parseConfig(opts.get("String_Node_Str"),opts.getValueMap("String_Node_Str")),JenaConnect.parseConfig(opts.get("String_Node_Str"),opts.getValueMap("String_Node_Str")),opts.has("String_Node_Str"),Float.parseFloat(opts.get("String_Node_Str")),opts.getValueMap("String_Node_Str"),opts.has("String_Node_Str"),Integer.parseInt(opts.get("String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param opts parsed argument list
 * @throws IOException error parsing options
 */
private Match(ArgList opts) throws IOException {
  this(JenaConnect.parseConfig(opts.get("String_Node_Str"),opts.getValueMap("String_Node_Str")),JenaConnect.parseConfig(opts.get("String_Node_Str"),opts.getValueMap("String_Node_Str")),JenaConnect.parseConfig(opts.get("String_Node_Str"),opts.getValueMap("String_Node_Str")),Boolean.parseBoolean(opts.get("String_Node_Str")),Float.parseFloat(opts.get("String_Node_Str")),opts.getValueMap("String_Node_Str"),Boolean.parseBoolean(opts.get("String_Node_Str")),Integer.parseInt(opts.get("String_Node_Str")));
}
Program: 12943
Project: 12943
Buggy source:
/** 
 * This function get the XML tag values  for example : for Tag "DateUpdated" it will give you the updatedate, for Image Tag it will give  you the encoded Image String
 * @param base64String text encoded Image ,path Path to store the Image,This process repeats for every received message
 * @throwsI OException
 */
public static String getCharacterDataFromElement(Element e){
  Node child=e.getFirstChild();
  if (child instanceof CharacterData) {
    CharacterData cd=(CharacterData)child;
    return cd.getData();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * TODO: Fix this documentation to match actual method. This function get the XML tag values  for example : for Tag "DateUpdated" it will give you the updatedate, for Image Tag it will give  you the encoded Image String
 * @param base64String text encoded Image ,path Path to store the Image,This process repeats for every received message
 * @throwsI OException
 */
public static String getCharacterDataFromElement(Element e){
  Node child=e.getFirstChild();
  if (child instanceof CharacterData) {
    CharacterData cd=(CharacterData)child;
    return cd.getData();
  }
  return "String_Node_Str";
}
Program: 12944
Project: 12944
Buggy source:
/** 
 * This fucntion parsed the XML image 
 * @param Content of the ImageChange TAG to process
 */
public static void getUfidsAndImages(String xmlText){
  try {
    DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
    DocumentBuilder db=dbf.newDocumentBuilder();
    InputSource is=new InputSource();
    is.setCharacterStream(new StringReader(xmlText));
    Document doc=db.parse(is);
    NodeList DateUpdated=doc.getElementsByTagName("String_Node_Str");
    Element line1=(Element)DateUpdated.item(0);
    String date=getCharacterDataFromElement(line1);
    NodeList Image=doc.getElementsByTagName("String_Node_Str");
    Element line2=(Element)Image.item(0);
    String Image_base_64=getCharacterDataFromElement(line2);
    NodeList Ufid=doc.getElementsByTagName("String_Node_Str");
    Element line3=(Element)Ufid.item(0);
    String id=getCharacterDataFromElement(line3);
    log.info("String_Node_Str" + id + "String_Node_Str"+ imagedir);
    WriteImageFromBase64(getCharacterDataFromElement(line2),imagedir + id);
    log.info("String_Node_Str" + id + "String_Node_Str"+ date);
  }
 catch (  Exception e) {
    log.info(e.toString());
  }
}

Fixed version (ground truth):
/** 
 * This fucntion parsed the XML image 
 * @param Content of the ImageChange TAG to process
 */
public static void getUfidsAndImages(String xmlText){
  try {
    DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
    DocumentBuilder db=dbf.newDocumentBuilder();
    InputSource is=new InputSource();
    is.setCharacterStream(new StringReader(xmlText));
    Document doc=db.parse(is);
    NodeList DateUpdated=doc.getElementsByTagName("String_Node_Str");
    Element line1=(Element)DateUpdated.item(0);
    String date=getCharacterDataFromElement(line1);
    NodeList Image=doc.getElementsByTagName("String_Node_Str");
    Element line2=(Element)Image.item(0);
    String Image_base_64=getCharacterDataFromElement(line2);
    NodeList Ufid=doc.getElementsByTagName("String_Node_Str");
    Element line3=(Element)Ufid.item(0);
    String id=getCharacterDataFromElement(line3);
    log.info("String_Node_Str" + id + "String_Node_Str"+ imagedir);
    WriteImageFromBase64(Image_base_64,imagedir + id);
    log.info("String_Node_Str" + id + "String_Node_Str"+ date);
  }
 catch (  Exception e) {
    log.info(e.toString());
  }
}
Program: 12945
Project: 12945
Buggy source:
/** 
 * Consume all Message from the ActiveMQ queue
 * @throws JMSException 
 */
public static void getUpdatesFromQueue() throws JMSException {
  int failcount=0;
  Message message=null;
  if (maxnum == 0) {
    log.info("String_Node_Str");
    return;
  }
  if (maxnum > browsecount) {
    log.info("String_Node_Str");
    log.info("String_Node_Str" + browsecount);
    ;
    maxnum=browsecount;
  }
  for (int i=1; (i <= maxnum); i++) {
    if ((message=consumer.receive(30000)) == null) {
      failcount++;
      continue;
    }
    processMessage(message);
  }
  log.info("String_Node_Str" + failcount);
}

Fixed version (ground truth):
/** 
 * Consume all Message from the ActiveMQ queue
 * @throws JMSException 
 */
public static void getUpdatesFromQueue() throws JMSException {
  int failcount=0;
  Message message=null;
  if (maxnum == 0) {
    log.info("String_Node_Str");
    return;
  }
  if (maxnum > browsecount) {
    log.info("String_Node_Str");
    log.info("String_Node_Str" + browsecount);
    maxnum=browsecount;
  }
  for (int i=1; (i <= maxnum); i++) {
    if ((message=consumer.receive(30000)) == null) {
      failcount++;
      continue;
    }
    processMessage(message);
  }
  log.info("String_Node_Str" + failcount);
}
Program: 12946
Project: 12946
Buggy source:
/** 
 * Main method
 * @param args commandline arguments
 */
public static void main(String... args){
  Exception error=null;
  try {
    InitLog.initLogger(args,getParser());
    log.info("String_Node_Str");
    new ImagePreservationDuringPrivacy(args).execute();
  }
 catch (  IllegalArgumentException e) {
    log.error(e.getMessage());
    log.debug("String_Node_Str",e);
    System.out.println(getParser("String_Node_Str",database).getUsage());
    error=e;
  }
catch (  UsageException e) {
    log.info("String_Node_Str");
    System.out.println(getParser("String_Node_Str",database).getUsage());
    error=e;
  }
catch (  Exception e) {
    log.error(e.getMessage());
    log.debug("String_Node_Str",e);
    error=e;
  }
 finally {
    log.info("String_Node_Str");
    if (error != null) {
      System.exit(1);
    }
  }
}

Fixed version (ground truth):
/** 
 * Main method
 * @param args commandline arguments
 */
public static void main(String... args){
  Exception error=null;
  try {
    InitLog.initLogger(args,getParser());
    log.info("String_Node_Str");
    new ImagePreservationDuringPrivacy(args).execute();
  }
 catch (  IllegalArgumentException e) {
    log.error(e.getMessage());
    log.debug("String_Node_Str",e);
    System.out.println(getParser().getUsage());
    error=e;
  }
catch (  UsageException e) {
    log.info("String_Node_Str");
    System.out.println(getParser().getUsage());
    error=e;
  }
catch (  Exception e) {
    log.error(e.getMessage());
    log.debug("String_Node_Str",e);
    error=e;
  }
 finally {
    log.info("String_Node_Str");
    if (error != null) {
      System.exit(1);
    }
  }
}
Program: 12947
Project: 12947
Buggy source:
public void execute(){
}

Fixed version (ground truth):
/** 
 */
public void execute(){
}
Program: 12948
Project: 12948
Buggy source:
/** 
 * Consume all Message from the ActiveMQ queue
 * @throws JMSException 
 */
public static void getUpdatesFromQueue() throws JMSException {
  for (int i=0; i < 5; i++) {
    Message message=null;
    message=consumer.receiveNoWait();
    if (message == null)     System.out.println("String_Node_Str");
    processMessage(message);
  }
}

Fixed version (ground truth):
/** 
 * Consume all Message from the ActiveMQ queue
 * @throws JMSException 
 */
public static void getUpdatesFromQueue() throws JMSException {
  for (int i=0; i < 5; i++) {
    Message message=null;
    message=consumer.receiveNoWait();
    if (message == null)     System.out.println("String_Node_Str");
 else     processMessage(message);
  }
}
Program: 12949
Project: 12949
Buggy source:
@Override public String[] runESearch(String term,boolean logMessage) throws IOException {
  String[] env=new String[4];
  try {
    StringBuilder urlSb=new StringBuilder();
    urlSb.append("String_Node_Str");
    urlSb.append("String_Node_Str");
    urlSb.append(database);
    urlSb.append("String_Node_Str");
    urlSb.append(getToolName());
    urlSb.append("String_Node_Str");
    urlSb.append(getEmailAddress());
    urlSb.append("String_Node_Str");
    urlSb.append("String_Node_Str");
    urlSb.append("String_Node_Str");
    urlSb.append(term);
    if (logMessage) {
    }
    DocumentBuilderFactory docBuildFactory=DocumentBuilderFactory.newInstance();
    docBuildFactory.setIgnoringComments(true);
    Document doc=docBuildFactory.newDocumentBuilder().parse(new InputSource(new ByteArrayInputStream(WebAide.getURLContents(urlSb.toString()).getBytes())));
    env[0]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    env[1]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    env[2]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    env[3]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    if (logMessage) {
      log.info("String_Node_Str" + env[2] + "String_Node_Str");
    }
  }
 catch (  MalformedURLException e) {
    throw new IOException(e);
  }
catch (  SAXException e) {
    throw new IOException(e);
  }
catch (  ParserConfigurationException e) {
    throw new IOException(e);
  }
  return env;
}

Fixed version (ground truth):
@Override public String[] runESearch(String term,boolean logMessage) throws IOException {
  String[] env=new String[4];
  try {
    StringBuilder urlSb=new StringBuilder();
    urlSb.append("String_Node_Str");
    urlSb.append("String_Node_Str");
    urlSb.append(database);
    urlSb.append("String_Node_Str");
    urlSb.append(getToolName());
    urlSb.append("String_Node_Str");
    urlSb.append(getEmailAddress());
    urlSb.append("String_Node_Str");
    urlSb.append("String_Node_Str");
    urlSb.append("String_Node_Str");
    urlSb.append(term);
    if (logMessage) {
    }
    DocumentBuilderFactory docBuildFactory=DocumentBuilderFactory.newInstance();
    docBuildFactory.setIgnoringComments(true);
    Document doc=docBuildFactory.newDocumentBuilder().parse(new InputSource(new ByteArrayInputStream(WebAide.getURLContents(urlSb.toString()).getBytes("String_Node_Str"))));
    env[0]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    env[1]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    env[2]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    env[3]=doc.getElementsByTagName("String_Node_Str").item(0).getTextContent();
    if (logMessage) {
      log.info("String_Node_Str" + env[2] + "String_Node_Str");
    }
  }
 catch (  MalformedURLException e) {
    throw new IOException(e);
  }
catch (  SAXException e) {
    throw new IOException(e);
  }
catch (  ParserConfigurationException e) {
    throw new IOException(e);
  }
  return env;
}
Program: 12950
Project: 12950
Buggy source:
/** 
 * Test method for  {@link org.vivoweb.harvester.fetch.nih.PubmedFetch#PubmedFetch(java.lang.String,java.lang.String,java.lang.String,java.lang.String,org.vivoweb.harvester.util.repo.RecordHandler) PubmedFetch(String emailAddress, String searchTerm, String maxRecords, String batchSize, RecordHandler rh)}.
 * @throws IOException error
 * @throws ParserConfigurationException error
 * @throws SAXException error
 */
public final void testPubmedFetchOneRecord() throws IOException, ParserConfigurationException, SAXException {
  log.info("String_Node_Str");
  new PubmedFetch("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.rh).execute();
  assertTrue(this.rh.iterator().hasNext());
  DocumentBuilder docB=DocumentBuilderFactory.newInstance().newDocumentBuilder();
  int count=0;
  for (  Record r : this.rh) {
    log.debug("String_Node_Str" + r.getID());
    Document doc=docB.parse(new ByteArrayInputStream(r.getData().getBytes()));
    Element elem=doc.getDocumentElement();
    traverseNodes(elem.getChildNodes());
    count++;
  }
  assertEquals(1,count);
  log.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.vivoweb.harvester.fetch.nih.PubmedFetch#PubmedFetch(java.lang.String,java.lang.String,java.lang.String,java.lang.String,org.vivoweb.harvester.util.repo.RecordHandler) PubmedFetch(String emailAddress, String searchTerm, String maxRecords, String batchSize, RecordHandler rh)}.
 * @throws IOException error
 * @throws ParserConfigurationException error
 * @throws SAXException error
 */
public final void testPubmedFetchOneRecord() throws IOException, ParserConfigurationException, SAXException {
  log.info("String_Node_Str");
  new PubmedFetch("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.rh).execute();
  assertTrue(this.rh.iterator().hasNext());
  DocumentBuilder docB=DocumentBuilderFactory.newInstance().newDocumentBuilder();
  int count=0;
  for (  Record r : this.rh) {
    log.debug("String_Node_Str" + r.getID());
    Document doc=docB.parse(new ByteArrayInputStream(r.getData().getBytes("String_Node_Str")));
    Element elem=doc.getDocumentElement();
    traverseNodes(elem.getChildNodes());
    count++;
  }
  assertEquals(1,count);
  log.info("String_Node_Str");
}
Program: 12951
Project: 12951
Buggy source:
/** 
 * checks again for the necessary file and makes sure that they exist
 * @throws IOException error processing
 */
public void execute() throws IOException {
  int translated=0;
  int passed=0;
  for (  Record r : this.inStore) {
    if (this.force || r.needsProcessed(this.getClass())) {
      log.trace("String_Node_Str" + r.getID());
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      xmlTranslate(new ByteArrayInputStream(r.getData().getBytes()),baos,new ByteArrayInputStream(this.translationString.getBytes()));
      this.outStore.addRecord(r.getID(),baos.toString(),this.getClass());
      r.setProcessed(this.getClass());
      baos.close();
      translated++;
    }
 else {
      log.trace("String_Node_Str" + r.getID());
      passed++;
    }
  }
  log.info(Integer.toString(translated) + "String_Node_Str");
  log.info(Integer.toString(passed) + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * checks again for the necessary file and makes sure that they exist
 * @throws IOException error processing
 */
public void execute() throws IOException {
  int translated=0;
  int passed=0;
  for (  Record r : this.inStore) {
    if (this.force || r.needsProcessed(this.getClass())) {
      log.trace("String_Node_Str" + r.getID());
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      xmlTranslate(new ByteArrayInputStream(r.getData().getBytes("String_Node_Str")),baos,new ByteArrayInputStream(this.translationString.getBytes()));
      this.outStore.addRecord(r.getID(),baos.toString(),this.getClass());
      r.setProcessed(this.getClass());
      baos.close();
      translated++;
    }
 else {
      log.trace("String_Node_Str" + r.getID());
      passed++;
    }
  }
  log.info(Integer.toString(translated) + "String_Node_Str");
  log.info(Integer.toString(passed) + "String_Node_Str");
}
Program: 12952
Project: 12952
Buggy source:
/** 
 * Main method
 * @param args commandline arguments
 */
public static void main(String... args){
  Exception error=null;
  try {
    InitLog.initLogger(args,getParser());
    log.info(getParser().getAppName() + "String_Node_Str");
    new DatabaseClone(args).execute();
  }
 catch (  IllegalArgumentException e) {
    log.error(e.getMessage(),e);
    System.out.println(getParser().getUsage());
    error=e;
  }
catch (  Exception e) {
    log.error(e.getMessage(),e);
    error=e;
  }
 finally {
    log.info(getParser().getAppName() + "String_Node_Str");
    if (error != null) {
      System.exit(1);
    }
  }
}

Fixed version (ground truth):
/** 
 * Main method
 * @param args commandline arguments
 */
public static void main(String... args){
  Exception error=null;
  try {
    InitLog.initLogger(args,getParser());
    log.info(getParser().getAppName() + "String_Node_Str");
    new DatabaseClone(args).execute();
  }
 catch (  IllegalArgumentException e) {
    log.error(e.getMessage());
    log.debug("String_Node_Str",e);
    System.out.println(getParser().getUsage());
    error=e;
  }
catch (  Exception e) {
    log.error("String_Node_Str",e);
    error=e;
  }
 finally {
    log.info(getParser().getAppName() + "String_Node_Str");
    if (error != null) {
      System.exit(1);
    }
  }
}
Program: 12954
Project: 12954
Buggy source:
/** 
 * Test method for   {@link org.vivoweb.harvester.util.DatabaseClone#execute() execute()}.
 * @throws Exception error
 */
public final void testExecute() throws Exception {
  new DatabaseClone(this.inputConn,null,this.outputConn,null,null,null,null).execute();
  Statement cursor=this.outputConn.createStatement();
  ResultSet rs=cursor.executeQuery("String_Node_Str");
  assertTrue(rs.next());
  int count=0;
  Set<String> ids=new HashSet<String>();
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  do {
    assertTrue(ids.remove(rs.getString("String_Node_Str")));
    count++;
  }
 while (rs.next());
  assertEquals(4,count);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.vivoweb.harvester.util.DatabaseClone#execute() execute()}.
 * @throws Exception error
 */
public final void testExecute() throws Exception {
  new DatabaseClone(this.inputConn,null,this.outputConn,null,null,null,null).execute();
  Statement cursor=this.outputConn.createStatement();
  ResultSet rs=cursor.executeQuery("String_Node_Str");
  assertTrue(rs.next());
  int count=0;
  Set<String> ids=new HashSet<String>();
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  ids.add("String_Node_Str");
  Map<String,String> current=new HashMap<String,String>();
  current.put("String_Node_Str","String_Node_Str");
  current.put("String_Node_Str","String_Node_Str");
  current.put("String_Node_Str","String_Node_Str");
  current.put("String_Node_Str","String_Node_Str");
  do {
    String deptid=rs.getString("String_Node_Str");
    log.trace("String_Node_Str" + deptid);
    assertTrue(ids.remove(deptid));
    String currentVal=current.get(deptid);
    log.trace("String_Node_Str" + currentVal);
    String is_current=Boolean.valueOf(rs.getBoolean("String_Node_Str")).toString().toUpperCase();
    log.trace("String_Node_Str" + is_current);
    assertEquals(currentVal,is_current);
    count++;
  }
 while (rs.next());
  assertEquals(4,count);
}
Program: 12955
Project: 12955
Buggy source:
@Override protected void setUp() throws Exception {
  InitLog.initLogger(null,null);
  Class.forName(inputDriverClass);
  this.inputConn=DriverManager.getConnection(inputConnLine,inputUsername,inputPassword);
  Class.forName(outputDriverClass);
  this.outputConn=DriverManager.getConnection(outputConnLine,outputUsername,outputPassword);
  Statement cursor=this.inputConn.createStatement();
  cursor.executeUpdate("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");
  cursor.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  try {
    InitLog.initLogger(null,null);
    Class.forName(inputDriverClass);
    this.inputConn=DriverManager.getConnection(inputConnLine,inputUsername,inputPassword);
    Class.forName(outputDriverClass);
    this.outputConn=DriverManager.getConnection(outputConnLine,outputUsername,outputPassword);
    Statement cursor=this.inputConn.createStatement();
    cursor.executeUpdate("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");
    cursor.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
 catch (  Exception e) {
    if (this.inputConn != null) {
      try {
        this.inputConn.createStatement().executeUpdate("String_Node_Str");
      }
 catch (      SQLException e2) {
      }
      try {
        this.inputConn.close();
      }
 catch (      SQLException e2) {
      }
    }
    if (this.outputConn != null) {
      try {
        this.outputConn.createStatement().executeUpdate("String_Node_Str");
      }
 catch (      SQLException e2) {
      }
      try {
        this.outputConn.close();
      }
 catch (      SQLException e2) {
      }
    }
    FileAide.delete("String_Node_Str");
    throw e;
  }
}
Program: 12956
Project: 12956
Buggy source:
/** 
 * Export all RDF
 * @param out output stream to write rdf to
 * @throws IOException error writing to stream
 */
public void exportRdfToStream(OutputStream out) throws IOException {
  RDFWriter fasterWriter=this.jenaModel.getWriter("String_Node_Str");
  fasterWriter.setProperty("String_Node_Str","String_Node_Str");
  fasterWriter.setProperty("String_Node_Str","String_Node_Str");
  fasterWriter.setProperty("String_Node_Str","String_Node_Str");
  OutputStreamWriter osw=new OutputStreamWriter(out,Charset.availableCharsets().get("String_Node_Str"));
  fasterWriter.write(this.jenaModel,osw,"String_Node_Str");
  osw.flush();
  out.flush();
}

Fixed version (ground truth):
/** 
 * Export all RDF
 * @param m the model to export from
 * @param out output stream to write rdf to
 * @param language the language the rdf is in. Predefined values for lang are "RDF/XML", "N-TRIPLE", "TURTLE" (or"TTL") and "N3". null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is a synonym for "RDF/XML"
 * @throws IOException error writing to stream
 */
private static void exportRdfToStream(Model m,OutputStream out,String language) throws IOException {
  RDFWriter fasterWriter=m.getWriter(language);
  fasterWriter.setProperty("String_Node_Str","String_Node_Str");
  fasterWriter.setProperty("String_Node_Str","String_Node_Str");
  fasterWriter.setProperty("String_Node_Str","String_Node_Str");
  OutputStreamWriter osw=new OutputStreamWriter(out,Charset.availableCharsets().get("String_Node_Str"));
  fasterWriter.write(m,osw,"String_Node_Str");
  osw.flush();
  out.flush();
}
Program: 12957
Project: 12957
Buggy source:
/** 
 * Export the RDF to a file
 * @param fileName the file to write to
 * @param append append to the file
 * @throws IOException error writing to file
 */
public void exportRdfToFile(String fileName,boolean append) throws IOException {
  exportRdfToStream(FileAide.getOutputStream(fileName,append));
}

Fixed version (ground truth):
/** 
 * Export the RDF to a file
 * @param fileName the file to write to
 * @param language the language the rdf is in. Predefined values for lang are "RDF/XML", "N-TRIPLE", "TURTLE" (or"TTL") and "N3". null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is a synonym for "RDF/XML"
 * @param append append to the file
 * @throws IOException error writing to file
 */
public void exportRdfToFile(String fileName,String language,boolean append) throws IOException {
  exportRdfToStream(FileAide.getOutputStream(fileName,append),language);
}
Program: 12958
Project: 12958
Buggy source:
/** 
 * Export all RDF
 * @return the rdf
 * @throws IOException error writing to string
 */
public String exportRdfToString() throws IOException {
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  exportRdfToStream(baos);
  return baos.toString();
}

Fixed version (ground truth):
/** 
 * Export all RDF
 * @param language the language the rdf is in. Predefined values for lang are "RDF/XML", "N-TRIPLE", "TURTLE" (or"TTL") and "N3". null represents the default language, "RDF/XML". "RDF/XML-ABBREV" is a synonym for "RDF/XML"
 * @return the rdf
 * @throws IOException error writing to string
 */
public String exportRdfToString(String language) throws IOException {
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  exportRdfToStream(baos,language);
  return baos.toString();
}
Program: 12960
Project: 12960
Buggy source:
/** 
 * Execute is that method where the smushResoures method is ran for each predicate.
 */
public void execute(){
  Model outModel=this.outputJena.getJenaModel();
  for (  String runName : this.inputPredicates) {
    JenaConnect results=smushResources(this.inputJena,runName,this.namespace);
    outModel.add(results.getJenaModel());
  }
  if (this.inPlace) {
    JenaConnect additions=new MemJenaConnect();
    JenaConnect subtractions=new MemJenaConnect();
    Diff.diff(this.inputJena,this.outputJena,subtractions,null);
    Diff.diff(this.outputJena,this.inputJena,additions,null);
    this.inputJena.removeRdfFromJC(subtractions);
    this.inputJena.loadRdfFromJC(additions);
  }
}

Fixed version (ground truth):
/** 
 * Execute is that method where the smushResoures method is ran for each predicate.
 */
public void execute(){
  Model outModel=this.outputJena.getJenaModel();
  for (  String runName : this.inputPredicates) {
    JenaConnect results=smushResources(this.inputJena,runName,this.namespace);
    outModel.add(results.getJenaModel());
  }
  if (this.inPlace) {
    JenaConnect additions=new MemJenaConnect();
    JenaConnect subtractions=new MemJenaConnect();
    try {
      Diff.diff(this.inputJena,this.outputJena,subtractions,null);
      Diff.diff(this.outputJena,this.inputJena,additions,null);
    }
 catch (    FileSystemException e) {
      log.debug(e.getMessage(),e);
    }
    this.inputJena.removeRdfFromJC(subtractions);
    this.inputJena.loadRdfFromJC(additions);
  }
}
Program: 12961
Project: 12961
Buggy source:
/** 
 * Checks to make sure the bibutils base path is a directory and the input format is one of the acceptable values.  If not, log errors and explode.
 * @throws RuntimeException if either input path or output path is not a directory
 */
private void checkValidInputs(){
  File bibutilsBaseDir=new File(this.bibutilsBasePath);
  String errorMessage="String_Node_Str";
  if (!bibutilsBaseDir.isDirectory()) {
    String oneLineError="String_Node_Str" + this.bibutilsBasePath;
    log.error(oneLineError);
    errorMessage+=oneLineError + "String_Node_Str";
  }
  if (Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").contains(this.inputFormat)) {
    String oneLineError="String_Node_Str" + this.inputFormat;
    log.error(oneLineError);
    errorMessage+=oneLineError + "String_Node_Str";
  }
  if (!errorMessage.equals("String_Node_Str")) {
    errorMessage=errorMessage.substring(0,errorMessage.length() - 1);
    throw new RuntimeException(errorMessage);
  }
}

Fixed version (ground truth):
/** 
 * Checks to make sure the bibutils base path is a directory and the input format is one of the acceptable values.  If not, log errors and explode.
 * @throws RuntimeException if either input path or output path is not a directory
 */
private void checkValidInputs(){
  File bibutilsBaseDir=new File(this.bibutilsBasePath);
  String errorMessage="String_Node_Str";
  if (!bibutilsBaseDir.isDirectory()) {
    String oneLineError="String_Node_Str" + this.bibutilsBasePath;
    log.error(oneLineError);
    errorMessage+=oneLineError + "String_Node_Str";
  }
  if (!Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").contains(this.inputFormat)) {
    String oneLineError="String_Node_Str" + this.inputFormat;
    log.error(oneLineError);
    errorMessage+=oneLineError + "String_Node_Str";
  }
  if (!errorMessage.equals("String_Node_Str")) {
    errorMessage=errorMessage.substring(0,errorMessage.length() - 1);
    throw new RuntimeException(errorMessage);
  }
}
Program: 12964
Project: 12964
Buggy source:
/** 
 * Get the fields from a result set
 * @param rs the resultset
 * @return the list of fields
 * @throws SQLException error reading resultset
 */
private List<String> getResultSetFields(ResultSet rs) throws SQLException {
  ResultSetMetaData rsmd=rs.getMetaData();
  int count=rsmd.getColumnCount();
  List<String> fields=new ArrayList<String>(count);
  for (int x=1; x <= count; x++) {
    fields.add(rsmd.getColumnName(x));
  }
  return fields;
}

Fixed version (ground truth):
/** 
 * Get the fields from a result set
 * @param rs the resultset
 * @return the list of fields
 * @throws SQLException error reading resultset
 */
private List<String> getResultSetFields(ResultSet rs) throws SQLException {
  ResultSetMetaData rsmd=rs.getMetaData();
  int count=rsmd.getColumnCount();
  List<String> fields=new ArrayList<String>(count);
  for (int x=1; x <= count; x++) {
    fields.add(rsmd.getColumnLabel(x));
  }
  return fields;
}
Program: 12965
Project: 12965
Buggy source:
/** 
 * Test EqualityTest Algorithm
 * @throws IOException error
 */
public void testEmailLastNameEqualityTest() throws IOException {
  log.info("String_Node_Str");
  HashMap<String,Class<? extends Algorithm>> algorithms=new HashMap<String,Class<? extends Algorithm>>();
  algorithms.put("String_Node_Str",EqualityTest.class);
  algorithms.put("String_Node_Str",NormalizedDoubleMetaphoneDifference.class);
  algorithms.put("String_Node_Str",NormalizedDoubleMetaphoneDifference.class);
  HashMap<String,String> inputPredicates=new HashMap<String,String>();
  inputPredicates.put("String_Node_Str","String_Node_Str");
  inputPredicates.put("String_Node_Str","String_Node_Str");
  inputPredicates.put("String_Node_Str","String_Node_Str");
  HashMap<String,String> vivoPredicates=new HashMap<String,String>();
  vivoPredicates.put("String_Node_Str","String_Node_Str");
  vivoPredicates.put("String_Node_Str","String_Node_Str");
  vivoPredicates.put("String_Node_Str","String_Node_Str");
  HashMap<String,Double> weights=new HashMap<String,Double>();
  weights.put("String_Node_Str",Double.valueOf(1 / 2f));
  weights.put("String_Node_Str",Double.valueOf(4 / 6f));
  weights.put("String_Node_Str",Double.valueOf(2 / 6f));
  new Score(this.input,this.vivo,this.score,algorithms,inputPredicates,vivoPredicates,"String_Node_Str",weights).execute();
  log.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test EqualityTest Algorithm
 * @throws IOException error
 */
public void testEmailLastNameEqualityTest() throws IOException {
  log.info("String_Node_Str");
  HashMap<String,Class<? extends Algorithm>> algorithms=new HashMap<String,Class<? extends Algorithm>>();
  algorithms.put("String_Node_Str",EqualityTest.class);
  algorithms.put("String_Node_Str",NormalizedDoubleMetaphoneDifference.class);
  algorithms.put("String_Node_Str",NormalizedDoubleMetaphoneDifference.class);
  HashMap<String,String> inputPredicates=new HashMap<String,String>();
  inputPredicates.put("String_Node_Str","String_Node_Str");
  inputPredicates.put("String_Node_Str","String_Node_Str");
  inputPredicates.put("String_Node_Str","String_Node_Str");
  HashMap<String,String> vivoPredicates=new HashMap<String,String>();
  vivoPredicates.put("String_Node_Str","String_Node_Str");
  vivoPredicates.put("String_Node_Str","String_Node_Str");
  vivoPredicates.put("String_Node_Str","String_Node_Str");
  HashMap<String,Double> weights=new HashMap<String,Double>();
  weights.put("String_Node_Str",Double.valueOf(1 / 2f));
  weights.put("String_Node_Str",Double.valueOf(1 / 3f));
  weights.put("String_Node_Str",Double.valueOf(1 / 6f));
  new Score(this.input,this.vivo,this.score,algorithms,inputPredicates,vivoPredicates,"String_Node_Str",weights).execute();
  log.debug("String_Node_Str" + this.score.exportRdfToString());
  log.info("String_Node_Str");
}
Program: 12967
Project: 12967
Buggy source:
/** 
 * Remove all predicates in a given namespace
 * @param ns the namespace to remove all statements from
 */
private void rmNamespace(String ns){
  String predicateQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + ns + "String_Node_Str"+ "String_Node_Str";
  log.debug(predicateQuery);
  ResultSet propList=this.model.executeSelectQuery(predicateQuery);
  HashSet<Property> propArray=new HashSet<Property>();
  while (propList.hasNext()) {
    QuerySolution solution=propList.next();
    Resource pres=solution.getResource("String_Node_Str");
    Property p=pres.as(Property.class);
    propArray.add(p);
  }
  for (  Property p : propArray) {
    this.model.getJenaModel().removeAll(null,p,null);
  }
  this.model.getJenaModel().commit();
  log.info("String_Node_Str" + propArray.size() + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Remove all predicates in a given namespace
 * @param ns the namespace to remove all statements from
 */
private void rmNamespace(String ns){
  String predicateQuery="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + ns + "String_Node_Str"+ "String_Node_Str";
  log.debug(predicateQuery);
  ResultSet propList=this.model.executeSelectQuery(predicateQuery);
  HashSet<Property> propArray=new HashSet<Property>();
  while (propList.hasNext()) {
    propArray.add(ResourceFactory.createProperty(propList.next().getResource("String_Node_Str").getURI()));
  }
  for (  Property p : propArray) {
    this.model.getJenaModel().removeAll(null,p,null);
  }
  this.model.getJenaModel().commit();
  log.info("String_Node_Str" + propArray.size() + "String_Node_Str");
}
Program: 12969
Project: 12969
Buggy source:
/** 
 * @throws IOException error
 */
public void testDiff() throws IOException {
  log.info("String_Node_Str");
  JenaConnect diffJC;
  try {
    diffJC=new SDBJenaConnect("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  ClassNotFoundException e) {
    throw new IOException(e.getMessage(),e);
  }
  JenaConnect previousJC=diffJC.neighborConnectClone("String_Node_Str");
  previousJC.loadRdfFromString(this.previousRDF,null,null);
  JenaConnect incomingJC=diffJC.neighborConnectClone("String_Node_Str");
  incomingJC.loadRdfFromString(this.incomingRDF,null,null);
  Diff.diff(incomingJC,previousJC,diffJC,null);
  assertEquals(this.expectedAddRDF,diffJC.getJenaModel().difference(new MemJenaConnect(new ByteArrayInputStream(this.expectedAddRDF.getBytes()),null,null).getJenaModel()).toString());
  diffJC.truncate();
  Diff.diff(previousJC,incomingJC,diffJC,null);
  assertEquals(this.expectedSubRDF,diffJC.getJenaModel().difference(new MemJenaConnect(new ByteArrayInputStream(this.expectedSubRDF.getBytes()),null,null).getJenaModel()).toString());
  log.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @throws IOException error
 */
public void testDiff() throws IOException {
  log.info("String_Node_Str");
  JenaConnect diffJC=new MemJenaConnect();
  JenaConnect previousJC=new MemJenaConnect(new ByteArrayInputStream(this.previousRDF.getBytes()),null,null);
  JenaConnect incomingJC=new MemJenaConnect(new ByteArrayInputStream(this.incomingRDF.getBytes()),null,null);
  JenaConnect expectedAddDiff=new MemJenaConnect(new ByteArrayInputStream(this.expectedAddRDF.getBytes()),null,null);
  JenaConnect expectedSubDiff=new MemJenaConnect(new ByteArrayInputStream(this.expectedSubRDF.getBytes()),null,null);
  Diff.diff(incomingJC,previousJC,diffJC,null);
  assertEquals("String_Node_Str",diffJC.getJenaModel().difference(expectedAddDiff.getJenaModel()).toString());
  diffJC=new MemJenaConnect();
  System.out.println(diffJC.getJenaModel().toString());
  Diff.diff(previousJC,incomingJC,diffJC,null);
  assertEquals("String_Node_Str",diffJC.getJenaModel().difference(expectedSubDiff.getJenaModel()).toString());
  log.info("String_Node_Str");
}
Program: 12976
Project: 12976
Buggy source:
/** 
 * Setter for model
 * @param configFileName the config file that describes the model to set
 * @throws IOException error connecting to model
 */
private void setModel(String configFileName) throws IOException {
  try {
    if (this.modelName != null) {
      this.model=(new JenaConnect(JenaConnect.parseConfig(configFileName),this.modelName)).getJenaModel();
    }
 else {
      this.model=JenaConnect.parseConfig(configFileName).getJenaModel();
    }
  }
 catch (  ParserConfigurationException e) {
    throw new IOException(e.getMessage(),e);
  }
catch (  SAXException e) {
    throw new IOException(e.getMessage(),e);
  }
catch (  IOException e) {
    throw new IOException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Setter for model
 * @param configFileName the config file that describes the model to set
 * @throws IOException error connecting to model
 */
private void setModel(String configFileName) throws IOException {
  try {
    if (this.modelName != null) {
      log.trace("String_Node_Str" + this.modelName + "String_Node_Str");
      this.model=(new JenaConnect(JenaConnect.parseConfig(configFileName),this.modelName)).getJenaModel();
    }
 else {
      this.model=JenaConnect.parseConfig(configFileName).getJenaModel();
    }
  }
 catch (  ParserConfigurationException e) {
    throw new IOException(e.getMessage(),e);
  }
catch (  SAXException e) {
    throw new IOException(e.getMessage(),e);
  }
catch (  IOException e) {
    throw new IOException(e.getMessage(),e);
  }
}
Program: 12977
Project: 12977
Buggy source:
/** 
 * Performs an ESearch against PubMed database and returns the query web environment/query key data
 * @param term The search term to run against pubmed
 * @param maxNumRecords The maximum number of records to fetch
 * @param retStart record number (out of the total - eg: '1200' out of 15000 records), not the PMID
 * @return String[] = {WebEnv, QueryKey, number of records found, first PMID} from the search - used by fetchPubMedEnv
 * @author Chris Haines
 * @author Dale Scheppler
 */
public String[] runESearch(String term,Integer maxNumRecords,Integer retStart){
  String[] env=new String[4];
  try {
    EUtilsServiceStub service=new EUtilsServiceStub();
    EUtilsServiceStub.ESearchRequest req=new EUtilsServiceStub.ESearchRequest();
    req.setDb("String_Node_Str");
    req.setTerm(term);
    req.setRetMax(maxNumRecords.toString());
    req.setRetStart(retStart.toString());
    req.setUsehistory("String_Node_Str");
    EUtilsServiceStub.ESearchResult res=service.run_eSearch(req);
    IdListType a=res.getIdList();
    String[] b=a.getId();
    int numRec=b.length;
    log.trace("String_Node_Str" + numRec + "String_Node_Str");
    env[0]=res.getWebEnv();
    env[1]=res.getQueryKey();
    env[2]="String_Node_Str" + res.getIdList().getId().length;
    env[3]=res.getIdList().getId()[0];
  }
 catch (  RemoteException e) {
    log.error("String_Node_Str",e);
  }
  return env;
}

Fixed version (ground truth):
/** 
 * Performs an ESearch against PubMed database and returns the query web environment/query key data
 * @param term The search term to run against pubmed
 * @param maxNumRecords The maximum number of records to fetch
 * @param retStart record number (out of the total - eg: '1200' out of 15000 records), not the PMID
 * @return String[] = {WebEnv, QueryKey, number of records found, first PMID} from the search - used by fetchPubMedEnv
 * @author Chris Haines
 * @author Dale Scheppler
 */
public String[] runESearch(String term,Integer maxNumRecords,Integer retStart){
  String[] env=new String[4];
  try {
    EUtilsServiceStub service=new EUtilsServiceStub();
    EUtilsServiceStub.ESearchRequest req=new EUtilsServiceStub.ESearchRequest();
    req.setDb("String_Node_Str");
    req.setTerm(term);
    req.setRetMax(maxNumRecords.toString());
    req.setRetStart(retStart.toString());
    req.setUsehistory("String_Node_Str");
    EUtilsServiceStub.ESearchResult res=service.run_eSearch(req);
    env[0]=res.getWebEnv();
    env[1]=res.getQueryKey();
    env[2]="String_Node_Str" + res.getIdList().getId().length;
    env[3]=res.getIdList().getId()[0];
    log.trace("String_Node_Str" + env[2] + "String_Node_Str");
  }
 catch (  RemoteException e) {
    log.error("String_Node_Str",e);
  }
  return env;
}
Program: 12978
Project: 12978
Buggy source:
@Override protected void runTask() throws NumberFormatException {
  Integer recToFetch;
  if (this.strMaxRecords.equalsIgnoreCase("String_Node_Str")) {
    recToFetch=Integer.valueOf(getHighestRecordNumber());
  }
 else {
    recToFetch=Integer.valueOf(this.strMaxRecords);
  }
  int intBatchSize=Integer.parseInt(this.strBatchSize);
  if (recToFetch.intValue() <= intBatchSize) {
    fetchPubMed(runESearch(this.strSearchTerm,recToFetch));
  }
 else {
    String[] env=runESearch(this.strSearchTerm,recToFetch);
    String WebEnv=env[0];
    String QueryKey=env[1];
    for (int x=recToFetch.intValue(); x > 0; x-=intBatchSize) {
      int maxRec=(x <= intBatchSize) ? x : intBatchSize;
      int startRec=recToFetch.intValue() - x;
      System.out.println("String_Node_Str" + maxRec);
      System.out.println("String_Node_Str" + startRec);
      fetchPubMed(WebEnv,QueryKey,startRec + "String_Node_Str",maxRec + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override protected void runTask() throws NumberFormatException {
  Integer recToFetch;
  if (this.strMaxRecords.equalsIgnoreCase("String_Node_Str")) {
    recToFetch=Integer.valueOf(getHighestRecordNumber());
  }
 else {
    recToFetch=Integer.valueOf(this.strMaxRecords);
  }
  int intBatchSize=Integer.parseInt(this.strBatchSize);
  if (recToFetch.intValue() <= intBatchSize) {
    fetchPubMed(runESearch(this.strSearchTerm,recToFetch));
  }
 else {
    String[] env=runESearch(this.strSearchTerm,recToFetch);
    String WebEnv=env[0];
    String QueryKey=env[1];
    if (Integer.parseInt(env[2]) < recToFetch.intValue()) {
      recToFetch=Integer.getInteger(env[2]);
    }
    for (int x=recToFetch.intValue(); x > 0; x-=intBatchSize) {
      int maxRec=(x <= intBatchSize) ? x : intBatchSize;
      int startRec=recToFetch.intValue() - x;
      log.debug("String_Node_Str" + maxRec);
      log.debug("String_Node_Str" + startRec);
      fetchPubMed(WebEnv,QueryKey,startRec + "String_Node_Str",maxRec + "String_Node_Str");
    }
  }
}