nus-yam/ex-repair huggingface dataset:
Program: 45341
Project: 45341
Buggy source:
/** 
 * Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
 * @param str String
 * @return utf8 bytes
 * @see String#getBytes()
 */
public static byte[] getBytes(String str){
  try {
    return str.getBytes("String_Node_Str");
  }
 catch (  java.io.UnsupportedEncodingException e) {
    throw new Error("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
 * @param str String
 * @return utf8 bytes
 * @see String#getBytes()
 */
public static byte[] getBytes(String str){
  try {
    return str.getBytes("String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new Error("String_Node_Str" + e.getMessage());
  }
}
Program: 45342
Project: 45342
Buggy source:
/** 
 * Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
 * @param bytes byte array
 * @param offset starting offset in byte array
 * @param length length in byte array starting from offset
 * @return same as <code>new String(bytes, offset, length, "UTF8")</code>
 */
public static String getString(byte[] bytes,int offset,int length){
  try {
    return length == 0 ? null : new String(bytes,offset,length,"String_Node_Str");
  }
 catch (  java.io.UnsupportedEncodingException e) {
    throw new Error("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Should always be able convert to/from UTF-8, so encoding exceptions are converted to an Error to avoid adding throws declarations in lots of methods.
 * @param bytes byte array
 * @param offset starting offset in byte array
 * @param length length in byte array starting from offset
 * @return same as <code>new String(bytes, offset, length, "UTF8")</code>
 */
public static String getString(final byte[] bytes,final int offset,final int length){
  try {
    return length == 0 ? null : new String(bytes,offset,Math.min(length,bytes.length - offset),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new Error("String_Node_Str" + e.getMessage());
  }
}
Program: 45346
Project: 45346
Buggy source:
/** 
 * HTML is the top level element.
 */
public static Node parseDocument(Lexer lexer){
  Node node, document, html;
  Node doctype=null;
  document=lexer.newNode();
  document.type=NodeType.RootNode;
  lexer.root=document;
  while ((node=lexer.getToken(Lexer.IGNORE_WHITESPACE)) != null) {
    if (Node.insertMisc(document,node)) {
      continue;
    }
    if (node.type == NodeType.DocTypeTag) {
      if (doctype == null) {
        document.insertNodeAtEnd(node);
        doctype=node;
      }
 else {
        lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      }
      continue;
    }
    if (node.type == NodeType.EndTag) {
      lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      continue;
    }
    if (node.type != NodeType.StartTag || !node.is(TagId.HTML)) {
      lexer.ungetToken();
      html=lexer.inferredTag(TagId.HTML);
    }
 else {
      html=node;
    }
    if (document.findDocType() == null && !lexer.configuration.isBodyOnly()) {
      lexer.report.warning(lexer,null,null,Report.MISSING_DOCTYPE);
    }
    document.insertNodeAtEnd(html);
    HTML.parse(lexer,html,(short)0);
    break;
  }
  if (lexer.root.findTITLE() == null) {
    Node head=lexer.root.findHEAD();
    lexer.report.warning(lexer,head,null,Report.MISSING_TITLE_ELEMENT);
    head.insertNodeAtEnd(lexer.inferredTag(TagId.TITLE));
  }
  return document;
}

Fixed version (ground truth):
/** 
 * HTML is the top level element.
 */
public static Node parseDocument(Lexer lexer){
  Node node, document, html;
  Node doctype=null;
  document=lexer.newNode();
  document.type=NodeType.RootNode;
  lexer.root=document;
  while ((node=lexer.getToken(Lexer.IGNORE_WHITESPACE)) != null) {
    if (Node.insertMisc(document,node)) {
      continue;
    }
    if (node.type == NodeType.DocTypeTag) {
      if (doctype == null) {
        document.insertNodeAtEnd(node);
        doctype=node;
      }
 else {
        lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      }
      continue;
    }
    if (node.type == NodeType.EndTag) {
      lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      continue;
    }
    if (node.type != NodeType.StartTag || !node.is(TagId.HTML)) {
      lexer.ungetToken();
      html=lexer.inferredTag(TagId.HTML);
    }
 else {
      html=node;
    }
    if (document.findDocType() == null && !lexer.configuration.isBodyOnly()) {
      lexer.report.warning(lexer,null,null,Report.MISSING_DOCTYPE);
    }
    document.insertNodeAtEnd(html);
    HTML.parse(lexer,html,(short)0);
    break;
  }
  if (lexer.root.findHTML() == null) {
    html=lexer.inferredTag(TagId.HTML);
    lexer.root.insertNodeAtEnd(html);
    HTML.parse(lexer,html,Lexer.IGNORE_WHITESPACE);
  }
  if (lexer.root.findTITLE() == null) {
    Node head=lexer.root.findHEAD();
    lexer.report.warning(lexer,head,null,Report.MISSING_TITLE_ELEMENT);
    head.insertNodeAtEnd(lexer.inferredTag(TagId.TITLE));
  }
  return document;
}
Program: 45347
Project: 45347
Buggy source:
/** 
 * HTML is the top level element.
 */
public static Node parseDocument(Lexer lexer){
  Node node, document, html;
  Node doctype=null;
  document=lexer.newNode();
  document.type=NodeType.RootNode;
  lexer.root=document;
  while ((node=lexer.getToken(Lexer.IGNORE_WHITESPACE)) != null) {
    if (Node.insertMisc(document,node)) {
      continue;
    }
    if (node.type == NodeType.DocTypeTag) {
      if (doctype == null) {
        document.insertNodeAtEnd(node);
        doctype=node;
      }
 else {
        lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      }
      continue;
    }
    if (node.type == NodeType.EndTag) {
      lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      continue;
    }
    if (node.type != NodeType.StartTag || !node.is(TagId.HTML)) {
      lexer.ungetToken();
      html=lexer.inferredTag(TagId.HTML);
    }
 else {
      html=node;
    }
    if (document.findDocType() == null && !lexer.configuration.isBodyOnly()) {
      lexer.report.warning(lexer,null,null,Report.MISSING_DOCTYPE);
    }
    document.insertNodeAtEnd(html);
    HTML.parse(lexer,html,(short)0);
    break;
  }
  return document;
}

Fixed version (ground truth):
/** 
 * HTML is the top level element.
 */
public static Node parseDocument(Lexer lexer){
  Node node, document, html;
  Node doctype=null;
  document=lexer.newNode();
  document.type=NodeType.RootNode;
  lexer.root=document;
  while ((node=lexer.getToken(Lexer.IGNORE_WHITESPACE)) != null) {
    if (Node.insertMisc(document,node)) {
      continue;
    }
    if (node.type == NodeType.DocTypeTag) {
      if (doctype == null) {
        document.insertNodeAtEnd(node);
        doctype=node;
      }
 else {
        lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      }
      continue;
    }
    if (node.type == NodeType.EndTag) {
      lexer.report.warning(lexer,document,node,Report.DISCARDING_UNEXPECTED);
      continue;
    }
    if (node.type != NodeType.StartTag || !node.is(TagId.HTML)) {
      lexer.ungetToken();
      html=lexer.inferredTag(TagId.HTML);
    }
 else {
      html=node;
    }
    if (document.findDocType() == null && !lexer.configuration.isBodyOnly()) {
      lexer.report.warning(lexer,null,null,Report.MISSING_DOCTYPE);
    }
    document.insertNodeAtEnd(html);
    HTML.parse(lexer,html,(short)0);
    break;
  }
  if (lexer.root.findTITLE() == null) {
    Node head=lexer.root.findHEAD();
    lexer.report.warning(lexer,head,null,Report.MISSING_TITLE_ELEMENT);
    head.insertNodeAtEnd(lexer.inferredTag(TagId.TITLE));
  }
  return document;
}
Program: 45348
Project: 45348
Buggy source:
/** 
 * @see java.lang.Object#clone()
 */
@Override protected Object clone(){
  AttVal av=null;
  try {
    av=(AttVal)super.clone();
  }
 catch (  CloneNotSupportedException e) {
  }
  if (this.next != null) {
    av.next=(AttVal)this.next.clone();
  }
  if (this.asp != null) {
    av.asp=(Node)this.asp.clone();
  }
  if (this.php != null) {
    av.php=(Node)this.php.clone();
  }
  return av;
}

Fixed version (ground truth):
/** 
 * @see java.lang.Object#clone()
 */
@Override protected Object clone(){
  AttVal av=null;
  try {
    av=(AttVal)super.clone();
  }
 catch (  CloneNotSupportedException e) {
  }
  if (this.next != null) {
    av.next=(AttVal)this.next.clone();
  }
  if (this.asp != null) {
    av.asp=this.asp.cloneNode(false);
  }
  if (this.php != null) {
    av.php=this.php.cloneNode(false);
  }
  return av;
}
Program: 45349
Project: 45349
Buggy source:
/** 
 * @see org.w3c.dom.Node#cloneNode(boolean)
 */
public org.w3c.dom.Node cloneNode(boolean deep){
  Node node=adaptee.cloneNode(deep);
  node.parent=null;
  node.adapter=null;
  return node.getAdapter();
}

Fixed version (ground truth):
/** 
 * @see org.w3c.dom.Node#cloneNode(boolean)
 */
public org.w3c.dom.Node cloneNode(boolean deep){
  Node node=adaptee.cloneNode(deep);
  node.parent=null;
  return node.getAdapter();
}
Program: 45350
Project: 45350
Buggy source:
/** 
 * Clones a node and add it to node list.
 * @param node Node
 * @return cloned Node
 */
public Node cloneNode(Node node){
  Node cnode=(Node)node.clone();
  this.nodeList.add(cnode);
  for (AttVal att=cnode.attributes; att != null; att=att.next) {
    if (att.asp != null) {
      this.nodeList.add(att.asp);
    }
    if (att.php != null) {
      this.nodeList.add(att.php);
    }
  }
  return cnode;
}

Fixed version (ground truth):
/** 
 * Clones a node and add it to node list.
 * @param node Node
 * @return cloned Node
 */
public Node cloneNode(Node node){
  Node cnode=node.cloneNode(false);
  this.nodeList.add(cnode);
  for (AttVal att=cnode.attributes; att != null; att=att.next) {
    if (att.asp != null) {
      this.nodeList.add(att.asp);
    }
    if (att.php != null) {
      this.nodeList.add(att.php);
    }
  }
  return cnode;
}
Program: 45351
Project: 45351
Buggy source:
/** 
 * Clone this node.
 * @param deep if true deep clone the node (also clones all the contained nodes)
 * @return cloned node
 */
protected Node cloneNode(boolean deep){
  Node node=(Node)this.clone();
  node.content=null;
  node.last=null;
  if (deep) {
    Node child;
    Node newChild;
    for (child=this.content; child != null; child=child.next) {
      newChild=child.cloneNode(deep);
      node.insertNodeAtEnd(newChild);
    }
  }
  return node;
}

Fixed version (ground truth):
/** 
 * Clone this node.
 * @param deep if true deep clone the node (also clones all the contained nodes)
 * @return cloned node
 */
protected Node cloneNode(boolean deep){
  Node node=new Node(type,textarray,start,end);
  node.parent=parent;
  node.closed=closed;
  node.implicit=implicit;
  node.tag=tag;
  node.element=element;
  if (attributes != null) {
    node.attributes=(AttVal)attributes.clone();
  }
  if (deep) {
    Node child;
    Node newChild;
    for (child=this.content; child != null; child=child.next) {
      newChild=child.cloneNode(deep);
      node.insertNodeAtEnd(newChild);
    }
  }
  return node;
}
Program: 45352
Project: 45352
Buggy source:
/** 
 * @see org.w3c.dom.Node#cloneNode(boolean)
 */
public org.w3c.dom.Node cloneNode(boolean deep){
  Node node=adaptee.cloneNode(deep);
  node.parent=null;
  return node.getAdapter();
}

Fixed version (ground truth):
/** 
 * @see org.w3c.dom.Node#cloneNode(boolean)
 */
public org.w3c.dom.Node cloneNode(boolean deep){
  Node node=adaptee.cloneNode(deep);
  node.parent=null;
  node.adapter=null;
  return node.getAdapter();
}
Program: 45353
Project: 45353
Buggy source:
/** 
 * Clone this node.
 * @param deep if true deep clone the node (also clones all the contained nodes)
 * @return cloned node
 */
protected Node cloneNode(boolean deep){
  Node node=(Node)this.clone();
  if (deep) {
    Node child;
    Node newChild;
    for (child=this.content; child != null; child=child.next) {
      newChild=child.cloneNode(deep);
      node.insertNodeAtEnd(newChild);
    }
  }
  return node;
}

Fixed version (ground truth):
/** 
 * Clone this node.
 * @param deep if true deep clone the node (also clones all the contained nodes)
 * @return cloned node
 */
protected Node cloneNode(boolean deep){
  Node node=(Node)this.clone();
  node.content=null;
  node.last=null;
  if (deep) {
    Node child;
    Node newChild;
    for (child=this.content; child != null; child=child.next) {
      newChild=child.cloneNode(deep);
      node.insertNodeAtEnd(newChild);
    }
  }
  return node;
}
Program: 45354
Project: 45354
Buggy source:
/** 
 * Pretty-prints a tidy Node.
 * @param node org.w3c.tidy.Node
 * @param out output stream
 */
private void pprint(Node node,OutputStream out){
  PPrint pprint;
  if (out != null) {
    Out o=OutFactory.getOut(this.configuration,out);
    Lexer lexer=new Lexer(null,this.configuration,this.report);
    pprint=new PPrint(configuration);
    if (configuration.isXmlTags()) {
      pprint.printXMLTree(o,(short)0,0,lexer,node);
    }
 else {
      pprint.printTree(o,(short)0,0,lexer,node);
    }
    pprint.flushLine(o,0);
    try {
      out.flush();
    }
 catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Pretty-prints a tidy Node.
 * @param node org.w3c.tidy.Node
 * @param out output stream
 */
private void pprint(Node node,OutputStream out){
  PPrint pprint;
  if (out != null) {
    Out o=OutFactory.getOut(this.configuration,out);
    Lexer lexer=new Lexer(null,this.configuration,this.report);
    pprint=new PPrint(configuration);
    if (configuration.isXmlTags()) {
      pprint.printXMLTree(o,(short)0,0,lexer,node);
    }
 else {
      pprint.printTree(o,(short)0,0,lexer,node);
    }
    pprint.flushLine(o,0);
    o.flush();
  }
}
Program: 45355
Project: 45355
Buggy source:
/** 
 * please make it run hot enough in jvm by yourself, or try AbstractPerformanceTest
 * @param threads
 * @param loop
 * @return 
 */
public static boolean run(CyclicExecuteThread[] threads,int loop) throws Exception {
  int concurrent=threads.length;
  AtomicInteger success=new AtomicInteger();
  CountDownLatch begin=new CountDownLatch(1);
  CountDownLatch end=new CountDownLatch(concurrent * loop);
  CyclicBarrier barrier=new CyclicBarrier(loop);
  long beginTime=System.currentTimeMillis();
  for (  CyclicExecuteThread t : threads) {
    t.setBegin(begin);
    t.setEnd(end);
    t.setBarrier(barrier);
    t.setSuccess(success);
    t.start();
  }
  begin.countDown();
  end.await();
  long endTime=System.currentTimeMillis();
  long totalCost=endTime - beginTime;
  logger.log(Level.WARNING,"String_Node_Str",totalCost);
  return success.get() == concurrent * loop;
}

Fixed version (ground truth):
/** 
 * please make it run hot enough in jvm by yourself, or try AbstractPerformanceTest
 * @param threads
 * @param loop
 * @return 
 */
public static boolean run(CyclicExecuteThread[] threads,int loop) throws Exception {
  int concurrent=threads.length;
  AtomicInteger success=new AtomicInteger();
  CountDownLatch begin=new CountDownLatch(1);
  CountDownLatch end=new CountDownLatch(concurrent * loop);
  CyclicBarrier barrier=new CyclicBarrier(concurrent);
  long beginTime=System.currentTimeMillis();
  for (  CyclicExecuteThread t : threads) {
    t.setBegin(begin);
    t.setEnd(end);
    t.setBarrier(barrier);
    t.setSuccess(success);
    t.setLoop(loop);
    t.start();
  }
  begin.countDown();
  end.await();
  long endTime=System.currentTimeMillis();
  long totalCost=endTime - beginTime;
  logger.log(Level.WARNING,"String_Node_Str",totalCost);
  return success.get() == concurrent * loop;
}
Program: 45356
Project: 45356
Buggy source:
@Override public void run(){
  try {
    begin.await();
    for (int i=0; i < barrier.getParties(); i++) {
      try {
        if (runTask()) {
          success.incrementAndGet();
        }
      }
 catch (      Exception e) {
        logger.log(Level.WARNING,super.getName() + "String_Node_Str",e);
      }
 finally {
        end.countDown();
      }
      barrier.await();
    }
  }
 catch (  InterruptedException e) {
    logger.log(Level.WARNING,"String_Node_Str",super.getName());
    return;
  }
catch (  BrokenBarrierException e) {
    logger.log(Level.WARNING,"String_Node_Str",super.getName());
    return;
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    begin.await();
    for (int i=0; i < loop; i++) {
      try {
        if (runTask()) {
          success.incrementAndGet();
        }
      }
 catch (      Exception e) {
        logger.log(Level.WARNING,super.getName() + "String_Node_Str",e);
      }
 finally {
        end.countDown();
      }
      barrier.await();
    }
  }
 catch (  InterruptedException e) {
    logger.log(Level.WARNING,"String_Node_Str",super.getName());
    return;
  }
catch (  BrokenBarrierException e) {
    logger.log(Level.WARNING,"String_Node_Str",super.getName());
    return;
  }
}
Program: 45357
Project: 45357
Buggy source:
@Test public void concurrentUpdateAppConfig() throws Exception {
  final VisibleAppConfig visibleAppConfig=new VisibleAppConfig();
  final InvisibleAppConfig invisibleAppConfig=new InvisibleAppConfig();
  int concurrent=100;
  int loop=200;
  logger.log(Level.WARNING,"String_Node_Str",concurrent);
  final CyclicExecuteThread[] threads=new CyclicExecuteThread[concurrent];
  for (int i=0; i < concurrent; i++) {
    threads[i]=new CyclicExecuteThread("String_Node_Str"){
      @Override protected boolean runTask() throws Exception {
        invisibleAppConfig.update();
        visibleAppConfig.update();
        return true;
      }
    }
;
  }
  assertTrue(ConcurrentTestUtils.run(threads,loop));
  String format="String_Node_Str";
  System.out.println("String_Node_Str" + concurrent * loop);
  System.out.println("String_Node_Str" + invisibleAppConfig.i);
  System.out.println("String_Node_Str" + invisibleAppConfig.j);
  System.out.println("String_Node_Str" + visibleAppConfig.i);
  System.out.println("String_Node_Str" + visibleAppConfig.j);
}

Fixed version (ground truth):
@Test public void concurrentUpdateAppConfig() throws Exception {
  final VisibleAppConfig visibleAppConfig=new VisibleAppConfig();
  final InvisibleAppConfig invisibleAppConfig=new InvisibleAppConfig();
  int concurrent=100;
  int loop=10000;
  logger.log(Level.WARNING,"String_Node_Str",new Object[]{concurrent,loop});
  final CyclicExecuteThread[] threads=new CyclicExecuteThread[concurrent];
  for (int i=0; i < concurrent; i++) {
    threads[i]=new CyclicExecuteThread("String_Node_Str" + i){
      @Override protected boolean runTask() throws Exception {
        invisibleAppConfig.update();
        visibleAppConfig.update();
        return true;
      }
    }
;
  }
  assertTrue(ConcurrentTestUtils.run(threads,loop));
  String format="String_Node_Str";
  System.out.println("String_Node_Str" + concurrent * loop);
  System.out.println("String_Node_Str" + invisibleAppConfig.i);
  System.out.println("String_Node_Str" + invisibleAppConfig.j);
  System.out.println("String_Node_Str" + visibleAppConfig.i);
  System.out.println("String_Node_Str" + visibleAppConfig.j);
}
Program: 45358
Project: 45358
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void write(final byte[] b,int off,int len) throws IOException {
synchronized (decoder) {
    for (; ; ) {
      final ByteBuffer inputBuffer=this.inputBuffer;
      final int rem=inputBuffer.remaining();
      final int cnt=rem <= len ? rem : len;
      inputBuffer.put(b,off,cnt);
      len-=cnt;
      off+=cnt;
      if (len == 0) {
        return;
      }
      finish();
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void write(final byte[] b,int off,int len) throws IOException {
synchronized (decoder) {
    if (!inputBuffer.hasRemaining()) {
      finish();
    }
    for (; ; ) {
      final ByteBuffer inputBuffer=this.inputBuffer;
      final int rem=inputBuffer.remaining();
      final int cnt=rem <= len ? rem : len;
      inputBuffer.put(b,off,cnt);
      len-=cnt;
      off+=cnt;
      if (len == 0) {
        return;
      }
      finish();
    }
  }
}
Program: 45359
Project: 45359
Buggy source:
/** 
 * Connects to a database of a particular chunk (specified within the split). If a particular host fails during connection, it is avoided and another host is found. The method fails after a set number of maximum connection trials.
 */
protected Connection getConnection(DBInputSplit dbSplit){
  boolean connected=false;
  DBChunkHost avoid_host=null;
  int connect_tries=0;
  Connection connection=null;
  String localHostAddr=getLocatHostAddres();
  DBChunk chunk=dbSplit.getChunk();
  DBChunkHost chunk_host=null;
  while (!connected) {
    if (!chunk.getLocations().contains(localHostAddr)) {
      LOG.info("String_Node_Str" + localHostAddr);
      chunk_host=chunk.getAnyHost(avoid_host);
    }
 else {
      if (avoid_host != chunk.getHost(localHostAddr))       chunk_host=chunk.getHost(localHostAddr);
    }
    LOG.info("String_Node_Str" + localHostAddr + "String_Node_Str"+ chunk.getId()+ "String_Node_Str"+ chunk_host.getHost()+ "String_Node_Str"+ chunk_host.getUrl());
    try {
      Class.forName(chunk_host.getDriver());
      connection=DriverManager.getConnection(chunk_host.getUrl(),chunk_host.getUser(),chunk_host.getPassword());
      connected=true;
    }
 catch (    Exception e) {
      LOG.info("String_Node_Str");
      LOG.info(e);
      if (connect_tries < MAX_CONNECTION_TRIALS) {
        connect_tries++;
        avoid_host=chunk_host;
        chunk_host=null;
      }
 else       throw new RuntimeException(e);
    }
  }
  return connection;
}

Fixed version (ground truth):
/** 
 * Connects to a database of a particular chunk (specified within the split). If a particular host fails during connection, it is avoided and another host is found. The method fails after a set number of maximum connection trials.
 */
protected Connection getConnection(DBInputSplit dbSplit){
  boolean connected=false;
  DBChunkHost avoid_host=null;
  int connect_tries=0;
  Connection connection=null;
  String localHostAddr=getLocatHostAddres();
  DBChunk chunk=dbSplit.getChunk();
  DBChunkHost chunk_host=null;
  while (!connected) {
    if (!chunk.getLocations().contains(localHostAddr)) {
      LOG.info("String_Node_Str" + localHostAddr);
      chunk_host=chunk.getAnyHost(avoid_host);
    }
 else {
      if (avoid_host != chunk.getHost(localHostAddr)) {
        chunk_host=chunk.getHost(localHostAddr);
      }
 else {
        chunk_host=chunk.getAnyHost(avoid_host);
      }
    }
    LOG.info("String_Node_Str" + localHostAddr + "String_Node_Str"+ chunk.getId()+ "String_Node_Str"+ chunk_host.getHost()+ "String_Node_Str"+ chunk_host.getUrl());
    try {
      Class.forName(chunk_host.getDriver());
      connection=DriverManager.getConnection(chunk_host.getUrl(),chunk_host.getUser(),chunk_host.getPassword());
      connected=true;
    }
 catch (    Exception e) {
      LOG.info("String_Node_Str");
      LOG.info(e);
      if (connect_tries < MAX_CONNECTION_TRIALS) {
        connect_tries++;
        avoid_host=chunk_host;
        chunk_host=null;
      }
 else       throw new RuntimeException(e);
    }
  }
  return connection;
}
Program: 45360
Project: 45360
Buggy source:
/** 
 * Get the task for this field list. This is a convience method which calls this.getRecordOwner().getTask() in the thick model.
 * @return The task which contains this fieldList's recordowner Guaranteed to to non-null.
 */
public Task getTask(){
  if (this.getRecordOwner() != null)   return this.getRecordOwner().getTask();
  Task task=super.getTask();
  if (task == null) {
    if (this.getTable().getDatabase().getDatabaseOwner() != null)     if (((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getDefaultApplication() != null)     task=((BaseApplication)((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getDefaultApplication()).getMainTask();
  }
  return task;
}

Fixed version (ground truth):
/** 
 * Get the task for this field list. This is a convience method which calls this.getRecordOwner().getTask() in the thick model.
 * @return The task which contains this fieldList's recordowner Guaranteed to to non-null.
 */
public Task getTask(){
  if (this.getRecordOwner() != null)   return this.getRecordOwner().getTask();
  Task task=super.getTask();
  if (task == null) {
    if (this.getTable() != null)     if (this.getTable().getDatabase() != null)     if (this.getTable().getDatabase().getDatabaseOwner() != null)     if (((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getDefaultApplication() != null)     task=((BaseApplication)((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getDefaultApplication()).getMainTask();
  }
  return task;
}
Program: 45365
Project: 45365
Buggy source:
/** 
 * Free the resources for this holder.
 */
public void free(){
  if ((m_mapChildHolders != null) && (m_mapChildHolders.size() > 0)) {
    Utility.getLogger().warning("String_Node_Str");
synchronized (this) {
      for (      String strID : m_mapChildHolders.keySet()) {
        BaseHolder baseHolder=(BaseHolder)m_mapChildHolders.get(strID);
        baseHolder.free();
      }
      m_mapChildHolders.clear();
    }
  }
  m_mapChildHolders=null;
  if (m_parentHolder != null)   m_parentHolder.remove(this);
  m_parentHolder=null;
  m_remoteObject=null;
}

Fixed version (ground truth):
/** 
 * Free the resources for this holder.
 */
public void free(){
  if ((m_mapChildHolders != null) && (m_mapChildHolders.size() > 0)) {
    Utility.getLogger().info("String_Node_Str");
synchronized (this) {
      for (      String strID : m_mapChildHolders.keySet()) {
        BaseHolder baseHolder=(BaseHolder)m_mapChildHolders.get(strID);
        baseHolder.free();
      }
      m_mapChildHolders.clear();
    }
  }
  m_mapChildHolders=null;
  if (m_parentHolder != null)   m_parentHolder.remove(this);
  m_parentHolder=null;
  m_remoteObject=null;
}
Program: 45366
Project: 45366
Buggy source:
/** 
 * Constructor.
 */
public void init(BasicServlet servlet,BasicServlet.SERVLET_TYPE servletType){
  super.init(servlet,servletType);
  if (m_application == null)   m_application=this.getNonUserApplication();
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public void init(BasicServlet servlet,BasicServlet.SERVLET_TYPE servletType){
  super.init(servlet,servletType);
  if (m_application == null)   m_application=this.getNonUserApplication();
  m_application.addTask(this,null);
}
Program: 45368
Project: 45368
Buggy source:
/** 
 * Process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
public void doProcessOutput(BasicServlet servlet,HttpServletRequest req,HttpServletResponse res,PrintWriter outExt,ScreenModel screen) throws ServletException, IOException {
  PrintWriter out=outExt;
  if (screen == null) {
    if (out != null)     out.println("String_Node_Str");
    return;
  }
  try {
    String strDatatype=this.getProperty(DBParams.DATATYPE);
    if (strDatatype == null) {
      if (out == null)       out=servlet.getOutputStream(res);
      ((ScreenModel)screen).printReport(out);
    }
 else {
      ((ScreenModel)screen).getScreenFieldView().sendData(req,res);
    }
    screen.free();
    screen=null;
  }
 catch (  DBException ex) {
    if (out != null) {
      out.println("String_Node_Str");
      out.println("String_Node_Str" + ex.getMessage() + "String_Node_Str");
      ex.printStackTrace(out);
    }
    ex.printStackTrace();
  }
catch (  java.lang.Exception ex) {
    ex.printStackTrace();
  }
 finally {
    if (outExt == null)     if (out != null)     out.close();
  }
  if (m_application.getRemoteTask(this,null,false) != null)   m_application.removeTask(this);
  m_application=null;
  m_properties=null;
}

Fixed version (ground truth):
/** 
 * Process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
public void doProcessOutput(BasicServlet servlet,HttpServletRequest req,HttpServletResponse res,PrintWriter outExt,ScreenModel screen,boolean freeWhenDone) throws ServletException, IOException {
  PrintWriter out=outExt;
  if (screen == null) {
    if (out != null)     out.println("String_Node_Str");
    return;
  }
  try {
    String strDatatype=this.getProperty(DBParams.DATATYPE);
    if (strDatatype == null) {
      if (out == null)       out=servlet.getOutputStream(res);
      ((ScreenModel)screen).printReport(out);
    }
 else {
      ((ScreenModel)screen).getScreenFieldView().sendData(req,res);
    }
    screen.free();
    screen=null;
  }
 catch (  DBException ex) {
    if (out != null) {
      out.println("String_Node_Str");
      out.println("String_Node_Str" + ex.getMessage() + "String_Node_Str");
      ex.printStackTrace(out);
    }
    ex.printStackTrace();
  }
catch (  java.lang.Exception ex) {
    ex.printStackTrace();
  }
 finally {
    if (outExt == null)     if (out != null)     out.close();
  }
  if (freeWhenDone)   this.free();
}
Program: 45369
Project: 45369
Buggy source:
/** 
 * Process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
public void doProcess(BasicServlet servlet,HttpServletRequest req,HttpServletResponse res,PrintWriter outExt) throws ServletException, IOException {
  ScreenModel screen=this.doProcessInput(servlet,req,res);
  this.doProcessOutput(servlet,req,res,outExt,screen);
}

Fixed version (ground truth):
/** 
 * Process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
public void doProcess(BasicServlet servlet,HttpServletRequest req,HttpServletResponse res,PrintWriter outExt) throws ServletException, IOException {
  ScreenModel screen=this.doProcessInput(servlet,req,res);
  this.doProcessOutput(servlet,req,res,outExt,screen,true);
}
Program: 45370
Project: 45370
Buggy source:
/** 
 * Free all the resources belonging to this applet. If all applet screens are closed, shut down the applet.
 */
public void free(){
  if (m_recordOwnerCollection != null)   m_recordOwnerCollection.free();
  m_recordOwnerCollection=null;
  super.free();
}

Fixed version (ground truth):
/** 
 * Free all the resources belonging to this applet. If all applet screens are closed, shut down the applet.
 */
public void free(){
  super.free();
}
Program: 45371
Project: 45371
Buggy source:
/** 
 * Process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
public void doProcess(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
  ServletTask servletTask=new ServletTask(this,BasicServlet.SERVLET_TYPE.HTML);
  this.addBrowserProperties(req,servletTask);
  servletTask.doProcess(this,req,res,null);
  servletTask.free();
}

Fixed version (ground truth):
/** 
 * Process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
public void doProcess(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
  ServletTask servletTask=new ServletTask(this,BasicServlet.SERVLET_TYPE.HTML);
  this.addBrowserProperties(req,servletTask);
  servletTask.doProcess(this,req,res,null);
}
Program: 45372
Project: 45372
Buggy source:
public PrintThread(BasicServlet servlet,Writer outWriter,ServletTask servletTask,HttpServletRequest req,ScreenModel screen){
  super();
  this.outWriter=outWriter;
  this.servletTask=servletTask;
  this.req=req;
  this.screen=screen;
  this.servlet=servlet;
}

Fixed version (ground truth):
public PrintThread(BasicServlet servlet,Writer outWriter,ServletTask servletTask,HttpServletRequest req,ScreenModel screen,boolean freeWhenDone){
  super();
  this.outWriter=outWriter;
  this.servletTask=servletTask;
  this.req=req;
  this.screen=screen;
  this.servlet=servlet;
  this.freeWhenDone=freeWhenDone;
}
Program: 45373
Project: 45373
Buggy source:
/** 
 * process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
@Override public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
  ServletTask servletTask=new ServletTask(this,BasicServlet.SERVLET_TYPE.COCOON);
  this.addBrowserProperties(req,servletTask);
  ScreenModel screen=servletTask.doProcessInput(this,req,null);
  Transformer transformer=getTransformer(req,servletTask,screen);
  PipedReader in=new PipedReader();
  PipedWriter out=new PipedWriter(in);
  new PrintThread(this,out,servletTask,req,screen).start();
  StreamSource source=new StreamSource(in);
  ServletOutputStream outStream=res.getOutputStream();
  Result result=new StreamResult(outStream);
  try {
synchronized (transformer) {
      transformer.transform(source,result);
    }
  }
 catch (  TransformerException ex) {
    ex.printStackTrace();
    servletTask.free();
  }
}

Fixed version (ground truth):
/** 
 * process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
@Override public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
  ServletTask servletTask=new ServletTask(this,BasicServlet.SERVLET_TYPE.COCOON);
  this.addBrowserProperties(req,servletTask);
  ScreenModel screen=servletTask.doProcessInput(this,req,null);
  Transformer transformer=getTransformer(req,servletTask,screen);
  PipedReader in=new PipedReader();
  PipedWriter out=new PipedWriter(in);
  new PrintThread(this,out,servletTask,req,screen,true).start();
  StreamSource source=new StreamSource(in);
  ServletOutputStream outStream=res.getOutputStream();
  Result result=new StreamResult(outStream);
  try {
synchronized (transformer) {
      transformer.transform(source,result);
    }
  }
 catch (  TransformerException ex) {
    ex.printStackTrace();
    servletTask.free();
  }
}
Program: 45374
Project: 45374
Buggy source:
public void run(){
  PrintWriter writer=new PrintWriter(outWriter);
  try {
    servletTask.doProcessOutput(servlet,req,null,writer,screen);
  }
 catch (  ServletException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    writer.flush();
    writer.close();
  }
}

Fixed version (ground truth):
public void run(){
  PrintWriter writer=new PrintWriter(outWriter);
  try {
    servletTask.doProcessOutput(servlet,req,null,writer,screen,freeWhenDone);
  }
 catch (  ServletException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    writer.flush();
    writer.close();
  }
}
Program: 45375
Project: 45375
Buggy source:
/** 
 * Do a remote action.
 * @param strCommand Command to perform remotely.
 * @return boolean success.
 * @throws RemoteException TODO
 */
public Object doRemoteAction(String strCommand,Map<String,Object> properties) throws DBException, RemoteException ;

Fixed version (ground truth):
/** 
 * Do a remote action.
 * @param strCommand Command to perform remotely.
 * @return boolean success.
 * @throws RemoteException 
 */
public Object doRemoteAction(String strCommand,Map<String,Object> properties) throws DBException, RemoteException ;
Program: 45376
Project: 45376
Buggy source:
/** 
 * Build a new remote session and initialize it.
 * @param parentSessionObject The parent session for this new session (if null, parent = me).
 * @param strSessionClassName The class name of the remote session to build.
 * @throws RemoteException TODO
 */
public RemoteBaseSession makeRemoteSession(String strSessionClassName) throws RemoteException ;

Fixed version (ground truth):
/** 
 * Build a new remote session and initialize it.
 * @param parentSessionObject The parent session for this new session (if null, parent = me).
 * @param strSessionClassName The class name of the remote session to build.
 * @throws RemoteException 
 */
public RemoteBaseSession makeRemoteSession(String strSessionClassName) throws RemoteException ;
Program: 45377
Project: 45377
Buggy source:
/** 
 * Release the session and its resources.
 * @throws RemoteException TODO
 */
public void freeRemoteSession() throws RemoteException ;

Fixed version (ground truth):
/** 
 * Release the session and its resources.
 * @throws RemoteException 
 */
public void freeRemoteSession() throws RemoteException ;
Program: 45378
Project: 45378
Buggy source:
/** 
 * Open the physical database.
 * @exception DBException On open errors.
 */
public void setupJDBCConnection(String strJdbcDriver) throws DBException {
  if (m_JDBCConnection != null)   return;
  if (m_classDB == null)   m_classDB=ClassServiceUtility.getClassService().makeObjectFromClassName(strJdbcDriver);
  Utility.getLogger().info("String_Node_Str" + (m_classDB != null));
  m_JDBCConnection=this.getJDBCConnection();
}

Fixed version (ground truth):
/** 
 * Open the physical database.
 * @exception DBException On open errors.
 */
public void setupJDBCConnection(String strJdbcDriver) throws DBException {
  if (m_JDBCConnection != null)   return;
  if (firstTime == null)   firstTime=new Date();
  if (m_classDB == null) {
synchronized (firstTime) {
      if (m_classDB == null)       m_classDB=ClassServiceUtility.getClassService().makeObjectFromClassName(strJdbcDriver);
    }
  }
  Utility.getLogger().info("String_Node_Str" + (m_classDB != null));
  m_JDBCConnection=this.getJDBCConnection();
}
Program: 45380
Project: 45380
Buggy source:
/** 
 * Given the name of the database, get the properties file and optionally merge them with my current properties.
 * @param strDatabaseName The name of the database engine (as returned in the meta call).
 * @return The ResourceBundle with all the database properties.
 */
public boolean setupDatabaseProperties(){
  if (this.getProperty(DB_PROPERTIES_LOADED) != null)   return true;
  String strDatabaseName=this.getDatabaseName(true);
  Environment env=this.getDatabaseOwner().getEnvironment();
  Map<String,String> map=env.getCachedDatabaseProperties(strDatabaseName);
  if ((map == null) || (map == Environment.DATABASE_DOESNT_EXIST)) {
    map=this.getDatabaseProperties();
    if (map == null)     return false;
    env.cacheDatabaseProperties(strDatabaseName,map);
  }
  for (  String key : map.keySet()) {
    this.setProperty(key,map.get(key));
  }
  if (m_databaseBase == null)   if (this.getProperty(BASE_DATABASE) != null) {
    Map<String,Object> properties=new HashMap<String,Object>();
    properties.putAll(this.getProperties());
    properties.remove(BASE_DATABASE);
    properties.put(DBConstants.DB_USER_PREFIX,DBConstants.BLANK);
    properties.put(DBConstants.SUB_SYSTEM_LN_SUFFIX,DBConstants.BLANK);
    m_databaseBase=m_databaseOwner.getDatabase(this.getProperty(BASE_DATABASE),this.getDatabaseType() & DBConstants.TABLE_MASK,properties);
  }
  this.setProperty(DB_PROPERTIES_LOADED,DBConstants.TRUE);
  return true;
}

Fixed version (ground truth):
/** 
 * Given the name of the database, get the properties file and optionally merge them with my current properties.
 * @param strDatabaseName The name of the database engine (as returned in the meta call).
 * @return The ResourceBundle with all the database properties.
 */
public boolean setupDatabaseProperties(){
  if (this.getProperty(DB_PROPERTIES_LOADED) != null)   return true;
  String strDatabaseName=this.getDatabaseName(true);
  Environment env=this.getDatabaseOwner().getEnvironment();
  Map<String,String> map=env.getCachedDatabaseProperties(strDatabaseName);
  if ((map == null) || (map == Environment.DATABASE_DOESNT_EXIST)) {
    map=this.getDatabaseProperties();
    if (map == null)     return false;
    env.cacheDatabaseProperties(strDatabaseName,map);
  }
  for (  String key : map.keySet()) {
    this.setProperty(key,map.get(key));
  }
  if (m_databaseBase == null)   if (this.getProperty(BASE_DATABASE) != null) {
    Map<String,Object> properties=new HashMap<String,Object>();
    properties.putAll(this.getProperties());
    properties.remove(BASE_DATABASE);
    properties.remove(SQLParams.JDBC_DRIVER_PARAM);
    properties.put(DBConstants.DB_USER_PREFIX,DBConstants.BLANK);
    properties.put(DBConstants.SUB_SYSTEM_LN_SUFFIX,DBConstants.BLANK);
    m_databaseBase=m_databaseOwner.getDatabase(this.getProperty(BASE_DATABASE),this.getDatabaseType() & DBConstants.TABLE_MASK,properties);
  }
  this.setProperty(DB_PROPERTIES_LOADED,DBConstants.TRUE);
  return true;
}
Program: 45382
Project: 45382
Buggy source:
/** 
 * Free all the resources belonging to this application.
 */
public void free(){
  if (m_mapTasks != null) {
    while (m_mapTasks.size() > 0) {
      for (      Task task : m_mapTasks.keySet()) {
        if (task != null) {
          int iCount=0;
          while (task.isRunning()) {
            if (iCount++ == 10) {
              Util.getLogger().warning("String_Node_Str");
              break;
            }
            try {
              Thread.sleep(100);
            }
 catch (            InterruptedException e) {
              e.printStackTrace();
            }
          }
          task.stopTask();
        }
 else {
          try {
            RemoteTask remoteTask=m_mapTasks.remove(task);
            if (remoteTask != null)             remoteTask.freeRemoteSession();
          }
 catch (          RemoteException ex) {
            ex.printStackTrace();
          }
        }
        break;
      }
    }
  }
  m_mapTasks=null;
}

Fixed version (ground truth):
/** 
 * Free all the resources belonging to this application.
 */
public void free(){
  if (m_mapTasks != null) {
    while (m_mapTasks.size() > 0) {
      for (      Task task : m_mapTasks.keySet()) {
        if (task != null) {
          int iCount=0;
          while (task.isRunning()) {
            if (iCount++ == 10) {
              Util.getLogger().warning("String_Node_Str");
              break;
            }
            try {
              Thread.sleep(100);
            }
 catch (            InterruptedException e) {
              e.printStackTrace();
            }
          }
          this.removeTask(task);
          task.setApplication(null);
          task.stopTask();
        }
 else {
          try {
            RemoteTask remoteTask=m_mapTasks.remove(task);
            if (remoteTask != null)             remoteTask.freeRemoteSession();
          }
 catch (          RemoteException ex) {
            ex.printStackTrace();
          }
        }
        break;
      }
    }
  }
  m_mapTasks=null;
}
Program: 45383
Project: 45383
Buggy source:
public void touch(Instruction i){
  log.debug("String_Node_Str");
  int r=machine.peek();
  int top=machine.getPP();
  int pp=machine.get(machine.getFP());
  int fp=machine.get(machine.getFP() + 1);
  int pc=machine.get(machine.getFP() + 4);
  machine.setTOP(top);
  machine.setPP(pp);
  machine.setFP(fp);
  machine.setPC(pc);
  machine.push(r);
}

Fixed version (ground truth):
public void touch(Instruction i){
  log.debug("String_Node_Str");
  int r=machine.peek();
  int top=machine.getPP();
  int pp=machine.get(machine.getFP());
  int fp=machine.get(machine.getFP() + 1);
  int pc=machine.get(machine.getFP() + 4);
  machine.setTOP(top - 1);
  machine.setPP(pp);
  machine.setFP(fp);
  machine.setPC(pc);
  machine.push(r);
}
Program: 45384
Project: 45384
Buggy source:
@Test public void program4(){
  AbstractMachine m=new AbstractMachine();
  m.reserveSpace(1);
  m.execute(Instruction.program4);
  m.printStack();
}

Fixed version (ground truth):
@Test public void program4(){
  AbstractMachine m=new AbstractMachine();
  m.reserveSpace(1);
  m.execute(Instruction.program4);
  m.printStack();
  Assert.assertEquals(100,(int)m.get(0));
}
Program: 45385
Project: 45385
Buggy source:
@Test public void factorial(){
  AbstractMachine m=new AbstractMachine();
  m.execute(Instruction.factorial);
  m.printStack();
}

Fixed version (ground truth):
@Test public void factorial(){
  AbstractMachine m=new AbstractMachine();
  m.execute(Instruction.factorial);
  m.printStack();
  Assert.assertEquals(6,(int)m.get(0));
}
Program: 45386
Project: 45386
Buggy source:
@Test public void program1(){
  AbstractMachine m=new AbstractMachine();
  m.execute(Instruction.program1);
  m.printStack();
}

Fixed version (ground truth):
@Test public void program1(){
  AbstractMachine m=new AbstractMachine();
  m.execute(Instruction.program1);
  m.printStack();
  Assert.assertEquals(15,(int)m.peek());
}
Program: 45387
Project: 45387
Buggy source:
@Test public void program2(){
  AbstractMachine m=new AbstractMachine();
  m.execute(Instruction.program2);
  m.printStack();
}

Fixed version (ground truth):
@Test public void program2(){
  AbstractMachine m=new AbstractMachine();
  m.execute(Instruction.program2);
  m.printStack();
  Assert.assertEquals(28,(int)m.peek(1));
}
Program: 45388
Project: 45388
Buggy source:
@Test public void program3(){
  AbstractMachine m=new AbstractMachine();
  m.reserveSpace(1);
  m.execute(Instruction.program3);
  m.printStack();
}

Fixed version (ground truth):
@Test public void program3(){
  AbstractMachine m=new AbstractMachine();
  m.reserveSpace(1);
  m.execute(Instruction.program3);
  m.printStack();
  Assert.assertEquals(200,(int)m.peek(-1));
}
Program: 45389
Project: 45389
Buggy source:
private void importProjectCerts(Map<String,SSLToolsException> errors){
  RepositorySystemSession rss=session.getRepositorySession();
  MirrorSelector mirrorSelector=rss.getMirrorSelector();
  List<Repository> repos=project.getRepositories();
  importRepos(repos,mirrorSelector,errors);
  repos=project.getPluginRepositories();
  importRepos(repos,mirrorSelector,errors);
  DistributionManagement dm=project.getDistributionManagement();
  if (dm != null) {
    DeploymentRepository[] drepos={dm.getRepository(),dm.getSnapshotRepository()};
    for (    DeploymentRepository drepo : drepos) {
      if (drepo != null) {
        importCerts(drepo.getUrl(),errors);
      }
    }
    Site site=dm.getSite();
    if (site != null) {
      importCerts(site.getUrl(),errors);
    }
  }
}

Fixed version (ground truth):
private void importProjectCerts(Set<String> seen,Map<String,SSLToolsException> errors){
  RepositorySystemSession rss=session.getRepositorySession();
  MirrorSelector mirrorSelector=rss.getMirrorSelector();
  List<Repository> repos=project.getRepositories();
  importRepos(repos,mirrorSelector,seen,errors);
  repos=project.getPluginRepositories();
  importRepos(repos,mirrorSelector,seen,errors);
  DistributionManagement dm=project.getDistributionManagement();
  if (dm != null) {
    DeploymentRepository[] drepos={dm.getRepository(),dm.getSnapshotRepository()};
    for (    DeploymentRepository drepo : drepos) {
      if (drepo != null) {
        importCerts(drepo.getUrl(),seen,errors);
      }
    }
    Site site=dm.getSite();
    if (site != null) {
      importCerts(site.getUrl(),seen,errors);
    }
  }
}
Program: 45390
Project: 45390
Buggy source:
private void importCerts(String serverUrl,Map<String,SSLToolsException> errors){
  try {
    URL url=new URL(serverUrl);
    int port=url.getPort();
    if (port < 1) {
      port=80;
    }
    importer.importServerCertificates(url.getHost(),port,sourceKeystore,sourceStorepass.toCharArray(),keystore,storepass.toCharArray());
  }
 catch (  SSLToolsException e) {
    errors.put(serverUrl,e);
  }
catch (  MalformedURLException e) {
    errors.put(serverUrl,new SSLToolsException("String_Node_Str",e,serverUrl));
  }
}

Fixed version (ground truth):
private void importCerts(String serverUrl,Set<String> seen,Map<String,SSLToolsException> errors){
  if (seen.contains(serverUrl)) {
    return;
  }
  seen.add(serverUrl);
  if (!serverUrl.startsWith("String_Node_Str")) {
    getLog().info("String_Node_Str" + serverUrl + "String_Node_Str");
    return;
  }
 else {
    getLog().info("String_Node_Str" + serverUrl + "String_Node_Str");
  }
  try {
    URL url=new URL(serverUrl);
    int port=url.getPort();
    if (port < 1) {
      port=80;
    }
    importer.importServerCertificates(url.getHost(),port,sourceKeystore,sourceStorepass.toCharArray(),keystore,storepass.toCharArray());
  }
 catch (  SSLToolsException e) {
    errors.put(serverUrl,e);
  }
catch (  MalformedURLException e) {
    errors.put(serverUrl,new SSLToolsException("String_Node_Str",e,serverUrl));
  }
}