nus-yam/ex-repair huggingface dataset:
Program: 187981
Project: 187981
Buggy source:
/** 
 * <p>Constructor</p> <p> Selects the colour the closest the a proper terminal colour. </p>
 * @param red           The red   intensity [0–255].
 * @param green         The green intensity [0–255].
 * @param blue          The blue  intensity [0–255].
 * @param chromaWeight  The weight of chromaticity [0–∞[, 1 is unweighted.
 */
@SuppressWarnings("String_Node_Str") public Colour(final int red,final int green,final int blue,final double chromaWeight){
  if ((labs == null) || (chromaWeight != lastCW)) {
    if (labs == null)     labs=new double[240][];
    for (int b=0; b < 6; b++)     for (int g=0; g < 6; g++)     for (int r=0; r < 6; r++)     labs[r * 36 + g * 6 + b]=toLab(COLOUR_INTENSITIVITY[r],COLOUR_INTENSITIVITY[g],COLOUR_INTENSITIVITY[b],chromaWeight);
    for (int s=0; s < 24; s++)     labs[216 + s]=toLab(GREY_EXTRA_INTENSITIVITY[s],GREY_EXTRA_INTENSITIVITY[s],GREY_EXTRA_INTENSITIVITY[s],chromaWeight);
  }
  final double[] lab=toLab(red,green,blue,chromaWeight);
  final double L=lab[0], a=lab[1], b=lab[2];
  double d=-100.;
  int best=0;
  for (int i=0; i <= 240; i++) {
    final double[] tLab=labs[i];
    double ðL=L - tLab[0];
    double ða=a - tLab[1];
    double ðb=b - tLab[2];
    double ð=ðL * ðL + ða * ða + ðb * ðb;
    if ((d > ð) || (d < -50.)) {
      d=ð;
      best=i;
    }
  }
  final Colour that=new Colour(best + 16);
  this.red=that.red;
  this.green=that.green;
  this.blue=that.blue;
  this.index=that.index;
  this.systemColour=that.systemColour;
}

Fixed version (ground truth):
/** 
 * <p>Constructor</p> <p> Selects the colour the closest the a proper terminal colour. </p>
 * @param red           The red   intensity [0–255].
 * @param green         The green intensity [0–255].
 * @param blue          The blue  intensity [0–255].
 * @param chromaWeight  The weight of chromaticity [0–∞[, 1 is unweighted.
 */
@SuppressWarnings("String_Node_Str") public Colour(final int red,final int green,final int blue,final double chromaWeight){
  if ((labs == null) || (chromaWeight != lastCW)) {
    if (labs == null)     labs=new double[240][];
    for (int b=0; b < 6; b++)     for (int g=0; g < 6; g++)     for (int r=0; r < 6; r++)     labs[r * 36 + g * 6 + b]=toLab(COLOUR_INTENSITIVITY[r],COLOUR_INTENSITIVITY[g],COLOUR_INTENSITIVITY[b],chromaWeight);
    for (int s=0; s < 24; s++)     labs[216 + s]=toLab(GREY_EXTRA_INTENSITIVITY[s],GREY_EXTRA_INTENSITIVITY[s],GREY_EXTRA_INTENSITIVITY[s],chromaWeight);
  }
  final double[] lab=toLab(red,green,blue,chromaWeight);
  final double L=lab[0], a=lab[1], b=lab[2];
  double d=-100.;
  int best=0;
  for (int i=0; i < 240; i++) {
    final double[] tLab=labs[i];
    double ðL=L - tLab[0];
    double ða=a - tLab[1];
    double ðb=b - tLab[2];
    double ð=ðL * ðL + ða * ða + ðb * ðb;
    if ((d > ð) || (d < -50.)) {
      d=ð;
      best=i;
    }
  }
  final Colour that=new Colour(best + 16);
  this.red=that.red;
  this.green=that.green;
  this.blue=that.blue;
  this.index=that.index;
  this.systemColour=that.systemColour;
}
Program: 187984
Project: 187984
Buggy source:
@Override public void closeDbFile(){
  super.closeDbFile();
  closed=true;
  dbFile.close();
}

Fixed version (ground truth):
@Override public void closeDbFile(){
  super.closeDbFile();
  closed=true;
  if (dbFile != null)   dbFile.close();
}
Program: 187985
Project: 187985
Buggy source:
/** 
 * Create a JLPCActor.
 * @return The new actor.
 */
@Override protected EvaluatorListJid instantiateActor() throws Exception {
  EvaluatorListJid transactionListJid=new EvaluatorListJid();
  return transactionListJid;
}

Fixed version (ground truth):
/** 
 * Create a JLPCActor.
 * @return The new actor.
 */
@Override protected EvaluatorListJid instantiateActor() throws Exception {
  return new EvaluatorListJid();
}
Program: 187986
Project: 187986
Buggy source:
/** 
 * Returns the transaction aggregator.
 * @return The transaction aggregator.
 */
public TransactionAggregator getTransactionAggregator() throws Exception {
  if (transactionAggregator != null) {
    return transactionAggregator;
  }
  logReader=null;
  Actor parent=getParent();
  if (parent == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  TransactionProcessor transactionProcessor=new TransactionProcessor();
  transactionProcessor.initialize(getMailbox(),this);
  durableTransactionLogger=new DurableTransactionLogger();
  durableTransactionLogger.initialize(getMailboxFactory().createAsyncMailbox(),parent);
  durableTransactionLogger.setNext(transactionProcessor);
  String ts=(new DateTime()).toString("String_Node_Str");
  Path path=directoryPath.resolve(ts + "String_Node_Str");
  durableTransactionLogger.open(path,StandardOpenOption.WRITE,StandardOpenOption.CREATE);
  durableTransactionLogger.currentPosition=0L;
  Serializer serializer=new Serializer();
  serializer.initialize(getMailboxFactory().createAsyncMailbox(),parent);
  serializer.setNext(durableTransactionLogger);
  transactionAggregator=newTransactionAggregator();
  transactionAggregator.initialize(getMailboxFactory().createAsyncMailbox(),this);
  transactionAggregator.setNext(serializer);
  transactionAggregator.initialCapacity=initialCapacity;
  return transactionAggregator;
}

Fixed version (ground truth):
/** 
 * Returns the transaction aggregator.
 * @return The transaction aggregator.
 */
public TransactionAggregator getTransactionAggregator() throws Exception {
  if (transactionAggregator != null) {
    return transactionAggregator;
  }
  logReader=null;
  Actor parent=getParent();
  if (parent == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  TransactionProcessor transactionProcessor=new TransactionProcessor();
  transactionProcessor.initialize(getMailbox(),this);
  durableTransactionLogger=new DurableTransactionLogger();
  durableTransactionLogger.initialize(getMailboxFactory().createAsyncMailbox(),parent);
  durableTransactionLogger.setNext(transactionProcessor);
  String ts=(new DateTime()).toString("String_Node_Str");
  Path path=directoryPath.resolve(ts + "String_Node_Str");
  durableTransactionLogger.open(path,StandardOpenOption.WRITE,StandardOpenOption.CREATE);
  durableTransactionLogger.currentPosition=0L;
  Serializer serializer=new Serializer();
  serializer.initialize(getMailboxFactory().createAsyncMailbox(),parent);
  serializer.setNext(durableTransactionLogger);
  transactionAggregator=newTransactionAggregator();
  transactionAggregator.initialize(getMailboxFactory().createAsyncMailbox(),this);
  transactionAggregator.setNext(serializer);
  return transactionAggregator;
}
Program: 187987
Project: 187987
Buggy source:
private void makeRootJid() throws Exception {
  if (rootJid != null)   return;
  rootJid=new RootJid();
  rootJid.initialize(getMailboxFactory().createMailbox(),getParent());
  rootJid.setValue(JFileFactories.EVALUATER_LIST_JID_TYPE);
  transactionListJid=(EvaluatorListJid)rootJid.getValue();
  transactionListJid.initialCapacity=initialCapacity;
}

Fixed version (ground truth):
private void makeRootJid() throws Exception {
  if (rootJid != null)   return;
  rootJid=new RootJid();
  rootJid.initialize(getMailboxFactory().createMailbox(),getParent());
  rootJid.setValue(JFileFactories.EVALUATER_LIST_JID_TYPE);
  transactionListJid=(EvaluatorListJid)rootJid.getValue();
}
Program: 187988
Project: 187988
Buggy source:
protected void go(RP rp) throws Exception {
  pendingManager=new PendingManager();
  pendingManager.rp=rp;
  ndx=0;
  int w=0;
  while (w < win && w < batch) {
    sender();
    w+=1;
  }
}

Fixed version (ground truth):
protected void go(RP rp) throws Exception {
  pendingManager=new PendingManager();
  pendingManager.rp=rp;
  ndx=0;
  int w=0;
  while (w < win && w < count) {
    sender();
    w+=1;
  }
}
Program: 187990
Project: 187990
Buggy source:
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  Class reqClass=request.getClass();
  if (reqClass == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    RootJid rootJid=req.block.getRootJid(getMailbox(),getParent());
    TransactionListJid transactionListJid=(TransactionListJid)rootJid.getValue();
    int i=0;
    while (i < transactionListJid.size()) {
      ActorJid actorJid=(ActorJid)transactionListJid.iGet(i);
      actorJid.getValue();
      i+=1;
    }
    req.send(this,blockFlowBuffer,rp);
    return;
  }
  throw new UnsupportedOperationException(reqClass.getName());
}

Fixed version (ground truth):
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  Class reqClass=request.getClass();
  if (reqClass == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    RootJid rootJid=req.block.getRootJid(getMailboxFactory().createMailbox(),getParent());
    TransactionListJid transactionListJid=(TransactionListJid)rootJid.getValue();
    int i=0;
    while (i < transactionListJid.size()) {
      ActorJid actorJid=(ActorJid)transactionListJid.iGet(i);
      actorJid.getValue();
      i+=1;
    }
    req.send(this,blockFlowBuffer,rp);
    return;
  }
  throw new UnsupportedOperationException(reqClass.getName());
}
Program: 187991
Project: 187991
Buggy source:
protected void readRootJid(Block block){
  try {
    block.setRootJid(null);
    int rem=block.headerLength();
    byte[] hdr=new byte[rem];
    ByteBuffer hbb=ByteBuffer.wrap(hdr);
    long currentPosition=block.getCurrentPosition();
    int rl=fileChannel.read(hbb,currentPosition);
    if (rl == -1)     return;
    currentPosition+=rl;
    rem-=rl;
    while (rem > 0) {
      rl=fileChannel.read(hbb,currentPosition);
      if (rl == -1)       return;
      currentPosition+=rl;
      rem-=rl;
    }
    rem=block.setHeaderBytes(hdr);
    byte[] rjb=new byte[rem];
    if (rem > 0) {
      ByteBuffer rjbb=ByteBuffer.wrap(rjb);
      while (rem > 0) {
        rl=fileChannel.read(rjbb,currentPosition);
        if (rl == -1)         return;
        currentPosition+=rl;
        rem-=rl;
      }
    }
    if (block.setRootJidBytes(rjb)) {
      block.setCurrentPosition(currentPosition);
    }
  }
 catch (  Exception ex) {
    return;
  }
  return;
}

Fixed version (ground truth):
protected void readRootJid(Block block){
  try {
    block.setRootJid(null);
    int rem=block.headerLength();
    byte[] hdr=new byte[rem];
    ByteBuffer hbb=ByteBuffer.wrap(hdr);
    long currentPosition=block.getCurrentPosition();
    int rl=fileChannel.read(hbb,currentPosition);
    if (rl == -1) {
      return;
    }
    currentPosition+=rl;
    rem-=rl;
    while (rem > 0) {
      rl=fileChannel.read(hbb,currentPosition);
      if (rl == -1) {
        return;
      }
      currentPosition+=rl;
      rem-=rl;
    }
    rem=block.setHeaderBytes(hdr);
    byte[] rjb=new byte[rem];
    if (rem > 0) {
      ByteBuffer rjbb=ByteBuffer.wrap(rjb);
      while (rem > 0) {
        rl=fileChannel.read(rjbb,currentPosition);
        if (rl == -1) {
          return;
        }
        currentPosition+=rl;
        rem-=rl;
      }
    }
    if (block.setRootJidBytes(rjb)) {
      block.setCurrentPosition(currentPosition);
    }
  }
 catch (  Exception ex) {
    block.setRootJid(null);
    return;
  }
  return;
}
Program: 187992
Project: 187992
Buggy source:
/** 
 * Serializes the header and the assigned RootJid.
 * @return The bytes of the header and serialized RootJid.
 */
@Override public byte[] serialize() throws Exception {
  if (blockBytes != null)   return blockBytes;
  l=rootJid.getSerializedLength();
  blockBytes=new byte[headerLength() + l];
  AppendableBytes ab=new AppendableBytes(blockBytes,0);
  saveHeader(ab,l);
  rootJid.save(ab);
  return blockBytes;
}

Fixed version (ground truth):
/** 
 * Serializes the header and the assigned RootJid.
 * @return The bytes of the header and serialized RootJid.
 */
@Override public byte[] serialize() throws Exception {
  if (blockBytes != null)   return blockBytes;
  l=rootJid.getSerializedLength();
  blockBytes=new byte[headerLength() + l];
  AppendableBytes ab=new AppendableBytes(blockBytes,headerLength());
  rootJid.save(ab);
  ab=new AppendableBytes(blockBytes,0);
  saveHeader(ab,l);
  return blockBytes;
}
Program: 187993
Project: 187993
Buggy source:
/** 
 * Return the RootJid, deserializing it as needed..
 * @param mailbox The mailbox.
 * @param parent  The parent.
 * @return The deserialized RootJid, or null.
 */
@Override public RootJid getRootJid(Mailbox mailbox,Actor parent) throws Exception {
  if (rootJid != null)   return rootJid;
  rb=null;
  if (rootJidBytes == null)   return null;
  RootJid rootJid=new RootJid(mailbox);
  rootJid.setParent(parent);
  rootJid.load(new ReadableBytes(rootJidBytes,0));
  return rootJid;
}

Fixed version (ground truth):
/** 
 * Return the RootJid, deserializing it as needed..
 * @param mailbox The mailbox.
 * @param parent  The parent.
 * @return The deserialized RootJid, or null.
 */
@Override public RootJid getRootJid(Mailbox mailbox,Actor parent) throws Exception {
  if (rootJid != null)   return rootJid;
  rb=null;
  if (rootJidBytes == null)   return null;
  rootJid=new RootJid(mailbox);
  rootJid.setParent(parent);
  rootJid.load(new ReadableBytes(rootJidBytes,0));
  return rootJid;
}
Program: 187994
Project: 187994
Buggy source:
/** 
 * Provides the data read from disk after the header.
 * @param bytesRead The data following the header on disk.
 * @return True when the data is valid.
 */
@Override public boolean setRootJidBytes(byte[] bytesRead){
  if (!super.setRootJidBytes(bytesRead))   return false;
  a32.reset();
  a32.update(bytesRead);
  boolean match=checksum == a32.getValue();
  if (match)   return true;
  rootJidBytes=null;
  return false;
}

Fixed version (ground truth):
/** 
 * Provides the data read from disk after the header.
 * @param bytesRead The data following the header on disk.
 * @return True when the data is valid.
 */
@Override public boolean setRootJidBytes(byte[] bytesRead){
  if (!super.setRootJidBytes(bytesRead))   return false;
  int i=0;
  while (i < bytesRead.length) {
    i+=1;
  }
  a32.reset();
  a32.update(bytesRead);
  boolean match=checksum == a32.getValue();
  if (match)   return true;
  rootJidBytes=null;
  return false;
}
Program: 187995
Project: 187995
Buggy source:
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,final RP rp) throws Exception {
  Class reqClass=request.getClass();
  if (reqClass == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    forcedWriteRootJid(req.block,-1);
    req.send(DurableTransactionLogger.this,blockFlowBuffer,rp);
    return;
  }
  if (reqClass == Finish.class) {
    Finish.req.send(this,blockFlowBuffer,rp);
    return;
  }
  super.processRequest(request,rp);
}

Fixed version (ground truth):
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,final RP rp) throws Exception {
  Class reqClass=request.getClass();
  if (reqClass == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    Block block=req.block;
    block.setCurrentPosition(currentPosition);
    forcedWriteRootJid(block,-1);
    currentPosition=block.getCurrentPosition();
    req.send(DurableTransactionLogger.this,blockFlowBuffer,rp);
    return;
  }
  if (reqClass == Finish.class) {
    Finish.req.send(this,blockFlowBuffer,rp);
    return;
  }
  super.processRequest(request,rp);
}
Program: 187996
Project: 187996
Buggy source:
private void reader() throws Exception {
  while (true) {
    Block block=newBlock();
    readRootJid(block);
    if (block.isEmpty()) {
      long position=block.getCurrentPosition();
      long size=fileChannel.size();
      long rem=size - position;
      RP<Long> rp=_rp;
      _rp=null;
      rp.processResponse(rem);
      return;
    }
    ProcessBlock req=new ProcessBlock(block);
    sync=false;
    async=false;
    req.send(this,blockFlowBuffer,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        if (!async)         sync=true;
 else         reader();
      }
    }
);
    if (!sync) {
      async=true;
      return;
    }
  }
}

Fixed version (ground truth):
private void reader() throws Exception {
  while (true) {
    Block block=newBlock();
    block.setCurrentPosition(currentPosition);
    readRootJid(block);
    currentPosition=block.getCurrentPosition();
    if (block.isEmpty()) {
      long position=block.getCurrentPosition();
      long size=fileChannel.size();
      long rem=size - position;
      RP<Long> rp=_rp;
      _rp=null;
      rp.processResponse(rem);
      return;
    }
    ProcessBlock req=new ProcessBlock(block);
    sync=false;
    async=false;
    req.send(this,blockFlowBuffer,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        if (!async)         sync=true;
 else         reader();
      }
    }
);
    if (!sync) {
      async=true;
      return;
    }
  }
}
Program: 187997
Project: 187997
Buggy source:
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  factory.defineActorType("String_Node_Str",IncrementCounterTransaction.class);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  CounterDB db=new CounterDB(dbMailbox);
  db.setParent(factory);
  LogReader logReader=db.getLogReader();
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  logReader.fileChannel=FileChannel.open(path,StandardOpenOption.READ);
  ReadLog.req.send(future,logReader);
  Finish.req.send(future,logReader);
  logReader.fileChannel.close();
  mailboxFactory.close();
}

Fixed version (ground truth):
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  factory.defineActorType("String_Node_Str",IncrementCounterTransaction.class);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  CounterDB db=new CounterDB(dbMailbox);
  db.setParent(factory);
  LogReader logReader=db.getLogReader();
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  logReader.fileChannel=FileChannel.open(path,StandardOpenOption.READ);
  logReader.currentPosition=0;
  long rem=ReadLog.req.send(future,logReader);
  System.out.println("String_Node_Str" + rem);
  Finish.req.send(future,logReader);
  logReader.fileChannel.close();
  mailboxFactory.close();
}
Program: 187999
Project: 187999
Buggy source:
@Override protected void eval(RP rp) throws Exception {
  IncrementCounter.req.send(this,getParent(),rp);
}

Fixed version (ground truth):
@Override protected void eval(RP rp) throws Exception {
  System.out.println("String_Node_Str");
  IncrementCounter.req.send(this,getParent(),rp);
}
Program: 188001
Project: 188001
Buggy source:
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  factory.defineActorType("String_Node_Str",IncrementCounterTransaction.class);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  CounterDB db=new CounterDB(dbMailbox);
  db.setParent(factory);
  LogReader logReader=db.getLogReader(10000);
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  logReader.fileChannel=FileChannel.open(path,StandardOpenOption.READ);
  logReader.currentPosition=0;
  long rem=ReadLog.req.send(future,logReader);
  System.out.println("String_Node_Str" + rem);
  Finish.req.send(future,logReader);
  logReader.fileChannel.close();
  int total=db.getCounter();
  mailboxFactory.close();
}

Fixed version (ground truth):
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  factory.defineActorType("String_Node_Str",IncrementCounterTransaction.class);
  factory.defineActorType("String_Node_Str",GetCounterTransaction.class);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  CounterDB db=new CounterDB(dbMailbox);
  db.setParent(factory);
  LogReader logReader=db.getLogReader(10000);
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  logReader.fileChannel=FileChannel.open(path,StandardOpenOption.READ);
  logReader.currentPosition=0;
  long rem=ReadLog.req.send(future,logReader);
  System.out.println("String_Node_Str" + rem);
  Finish.req.send(future,logReader);
  logReader.fileChannel.close();
  int total=db.getCounter();
  assertEquals(6,total);
  mailboxFactory.close();
}
Program: 188002
Project: 188002
Buggy source:
@Override protected void eval(RP rp) throws Exception {
  System.out.println("String_Node_Str");
  IncrementCounter.req.send(this,getParent(),rp);
}

Fixed version (ground truth):
@Override protected void eval(RP rp) throws Exception {
  IncrementCounter.req.send(this,getParent(),rp);
}
Program: 188003
Project: 188003
Buggy source:
private void nextSend() throws Exception {
  if (responsePending || pendingRequest == null)   return;
  responsePending=true;
  ProcessBlock req=pendingRequest;
  pendingRequest=null;
  if (_rp != null) {
    _rp.processResponse(null);
    _rp=null;
  }
  req.send(this,next,new RP<Object>(){
    @Override public void processResponse(    Object response) throws Exception {
      responsePending=false;
      nextSend();
    }
  }
);
}

Fixed version (ground truth):
private void nextSend() throws Exception {
  if (responsePending || pendingRequest == null)   return;
  responsePending=true;
  ProcessBlock req=pendingRequest;
  pendingRequest=null;
  if (_rp != null) {
    _rp.processResponse(null);
    _rp=null;
  }
  if (req.block instanceof FBlock) {
    Finish.req.send(this,next,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        responsePending=false;
        nextSend();
      }
    }
);
  }
 else {
    req.send(this,next,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        responsePending=false;
        nextSend();
      }
    }
);
  }
}
Program: 188004
Project: 188004
Buggy source:
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  Class reqClass=request.getClass();
  if (reqClass == ProcessBlock.class) {
    pendingRequest=(ProcessBlock)request;
    _rp=rp;
    nextSend();
    return;
  }
  if (reqClass == Finish.class) {
    Finish.req.send(this,next,rp);
    return;
  }
  throw new UnsupportedOperationException(reqClass.getName());
}

Fixed version (ground truth):
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  Class reqClass=request.getClass();
  if (reqClass == ProcessBlock.class) {
    pendingRequest=(ProcessBlock)request;
    _rp=rp;
    nextSend();
    return;
  }
  if (reqClass == Finish.class) {
    pendingRequest=FBlock.process;
    _rp=rp;
    nextSend();
    return;
  }
  throw new UnsupportedOperationException(reqClass.getName());
}
Program: 188005
Project: 188005
Buggy source:
private void nextSend() throws Exception {
  if (responsePending || pendingRequest == null)   return;
  responsePending=true;
  ProcessBlock req=pendingRequest;
  pendingRequest=null;
  if (_rp != null) {
    _rp.processResponse(null);
    _rp=null;
  }
  if (req.block instanceof FBlock) {
    Finish.req.send(this,next,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        responsePending=false;
        nextSend();
      }
    }
);
  }
 else {
    req.send(this,next,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        responsePending=false;
        nextSend();
      }
    }
);
  }
}

Fixed version (ground truth):
private void nextSend() throws Exception {
  if (responsePending || pendingRequest == null)   return;
  responsePending=true;
  ProcessBlock req=pendingRequest;
  pendingRequest=null;
  if (req.block instanceof FBlock) {
    final RP rp=_rp;
    _rp=null;
    Finish.req.send(this,next,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        responsePending=false;
        rp.processResponse(null);
        nextSend();
      }
    }
);
  }
 else {
    _rp.processResponse(null);
    _rp=null;
    req.send(this,next,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        responsePending=false;
        nextSend();
      }
    }
);
  }
}
Program: 188006
Project: 188006
Buggy source:
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  factory.defineActorType("String_Node_Str",IncrementCounterTransaction.class);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  CounterDB db=new CounterDB(dbMailbox);
  db.setParent(factory);
  LogReader logReader=db.getLogReader(1000000);
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  try {
    logReader.fileChannel=FileChannel.open(path,StandardOpenOption.READ);
  }
 catch (  Exception ex) {
    System.out.println("String_Node_Str");
    mailboxFactory.close();
    return;
  }
  logReader.currentPosition=0;
  long t0=System.currentTimeMillis();
  long rem=ReadLog.req.send(future,logReader);
  long t1=System.currentTimeMillis();
  Finish.req.send(future,logReader);
  Finish.req.send(future,logReader);
  Finish.req.send(future,logReader);
  Finish.req.send(future,logReader);
  System.out.println("String_Node_Str" + rem);
  logReader.fileChannel.close();
  int transactions=db.getCounter();
  System.out.println("String_Node_Str" + (t1 - t0));
  System.out.println("String_Node_Str" + transactions);
  System.out.println("String_Node_Str" + (1000L * transactions / (t1 - t0)));
  mailboxFactory.close();
}

Fixed version (ground truth):
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  factory.defineActorType("String_Node_Str",IncrementCounterTransaction.class);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  CounterDB db=new CounterDB(dbMailbox);
  db.setParent(factory);
  LogReader logReader=db.getLogReader(1000000);
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  try {
    logReader.fileChannel=FileChannel.open(path,StandardOpenOption.READ);
  }
 catch (  Exception ex) {
    System.out.println("String_Node_Str");
    mailboxFactory.close();
    return;
  }
  logReader.currentPosition=0;
  long t0=System.currentTimeMillis();
  long rem=ReadLog.req.send(future,logReader);
  long t1=System.currentTimeMillis();
  Finish.req.send(future,logReader);
  System.out.println("String_Node_Str" + rem);
  logReader.fileChannel.close();
  int transactions=db.getCounter();
  System.out.println("String_Node_Str" + (t1 - t0));
  System.out.println("String_Node_Str" + transactions);
  System.out.println("String_Node_Str" + (1000L * transactions / (t1 - t0)));
  mailboxFactory.close();
}
Program: 188007
Project: 188007
Buggy source:
/** 
 * Returns the transaction log reader.
 * @return The LogReader
 */
public LogReader getLogReader() throws Exception {
  if (logReader != null)   return logReader;
  Actor parent=getParent();
  if (parent == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  TransactionProcessor transactionProcessor=new TransactionProcessor(getMailbox());
  transactionProcessor.setParent(this);
  Deserializer deserializer=new Deserializer(getMailboxFactory().createAsyncMailbox());
  deserializer.setParent(this);
  deserializer.setNext(transactionProcessor);
  LogReader logReader=new LogReader(getMailboxFactory().createAsyncMailbox());
  logReader.setParent(parent);
  logReader.setNext(deserializer);
  return logReader;
}

Fixed version (ground truth):
/** 
 * Returns the transaction log reader.
 * @return The LogReader
 */
public LogReader getLogReader() throws Exception {
  if (logReader != null)   return logReader;
  Actor parent=getParent();
  if (parent == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  TransactionProcessor transactionProcessor=new TransactionProcessor(getMailbox());
  transactionProcessor.setParent(this);
  transactionProcessor.generateCheckpoints=false;
  Deserializer deserializer=new Deserializer(getMailboxFactory().createAsyncMailbox());
  deserializer.setParent(this);
  deserializer.setNext(transactionProcessor);
  LogReader logReader=newLogReader(getMailboxFactory().createAsyncMailbox());
  logReader.setParent(parent);
  logReader.setNext(deserializer);
  return logReader;
}
Program: 188008
Project: 188008
Buggy source:
private void eval(final TransactionEval req,final RP rp) throws Exception {
  while (true) {
    if (ndx == size()) {
      rp.processResponse(null);
      return;
    }
    Transaction transaction=(Transaction)iGet(ndx);
    ndx+=1;
    sync=false;
    async=true;
    req.send(this,transaction,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        if (!async)         sync=true;
 else         eval(req,rp);
      }
    }
);
    if (!sync) {
      async=true;
      return;
    }
  }
}

Fixed version (ground truth):
private void eval(final TransactionEval req,final RP rp) throws Exception {
  while (true) {
    if (ndx == size()) {
      rp.processResponse(null);
      return;
    }
    Transaction transaction=(Transaction)iGet(ndx);
    ndx+=1;
    sync=false;
    async=false;
    req.send(this,transaction,new RP<Object>(){
      @Override public void processResponse(      Object response) throws Exception {
        if (!async)         sync=true;
 else         eval(req,rp);
      }
    }
);
    if (!sync) {
      async=true;
      return;
    }
  }
}
Program: 188009
Project: 188009
Buggy source:
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  NullTransactionFactory ntf=new NullTransactionFactory("String_Node_Str");
  factory.registerActorFactory(ntf);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  StatelessDB db=new StatelessDB(dbMailbox);
  db.setParent(factory);
  TransactionProcessor transactionProcessor=new TransactionProcessor(dbMailbox);
  transactionProcessor.setParent(db);
  JFile jFile=new JFile(mailboxFactory.createAsyncMailbox());
  jFile.setParent(transactionProcessor);
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  jFile.fileChannel=FileChannel.open(path,StandardOpenOption.READ,StandardOpenOption.WRITE,StandardOpenOption.CREATE);
  TransactionLogger transactionLogger=new TransactionLogger(mailboxFactory.createAsyncMailbox());
  transactionLogger.setParent(jFile);
  long t0=System.currentTimeMillis();
  int i=0;
  while (i < 99) {
    (new ProcessTransaction(ntf)).sendEvent(transactionLogger);
    i+=1;
  }
  (new ProcessTransaction(ntf)).send(future,transactionLogger);
  long t1=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (t1 - t0));
  jFile.fileChannel.close();
  mailboxFactory.close();
}

Fixed version (ground truth):
public void test() throws Exception {
  MailboxFactory mailboxFactory=JAMailboxFactory.newMailboxFactory(10);
  Mailbox factoryMailbox=mailboxFactory.createMailbox();
  JAFactory factory=new JAFactory(factoryMailbox);
  (new JFileFactories(factoryMailbox)).setParent(factory);
  NullTransactionFactory ntf=new NullTransactionFactory("String_Node_Str");
  factory.registerActorFactory(ntf);
  JAFuture future=new JAFuture();
  Mailbox dbMailbox=mailboxFactory.createAsyncMailbox();
  StatelessDB db=new StatelessDB(dbMailbox);
  db.setParent(factory);
  TransactionProcessor transactionProcessor=new TransactionProcessor(dbMailbox);
  transactionProcessor.setParent(db);
  JFile jFile=new JFile(mailboxFactory.createAsyncMailbox());
  jFile.setParent(transactionProcessor);
  Path path=FileSystems.getDefault().getPath("String_Node_Str");
  System.out.println(path.toAbsolutePath());
  jFile.fileChannel=FileChannel.open(path,StandardOpenOption.READ,StandardOpenOption.WRITE,StandardOpenOption.CREATE);
  TransactionLogger transactionLogger=new TransactionLogger(mailboxFactory.createAsyncMailbox());
  transactionLogger.setParent(jFile);
  long t0=System.currentTimeMillis();
  int i=0;
  while (i < 999999) {
    (new ProcessTransaction(ntf)).sendEvent(transactionLogger);
    i+=1;
  }
  (new ProcessTransaction(ntf)).send(future,transactionLogger);
  long t1=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (t1 - t0));
  jFile.fileChannel.close();
  mailboxFactory.close();
}
Program: 188010
Project: 188010
Buggy source:
private void processTransaction(String actorType,ActorFactory actorFactory,byte[] bytes,final RP rp) throws Exception {
  makeRootJid();
  transactionListJid.iAdd(-1);
  TransactionActorJid transactionActorJid=(TransactionActorJid)transactionListJid.iGet(-1);
  if (actorType != null) {
    if (bytes == null) {
      transactionActorJid.setValue(actorType);
    }
 else {
      transactionActorJid.setJidBytes(actorType,bytes);
    }
  }
 else {
    if (bytes == null) {
      transactionActorJid.setValue(actorFactory);
    }
 else {
      transactionActorJid.setJidBytes(actorFactory,bytes);
    }
  }
  if (!rp.isEvent()) {
    TransactionResult.req.send(this,transactionActorJid.getValue(),rp);
  }
  if (!writePending && getMailbox().isEmpty()) {
    writeBlock();
  }
}

Fixed version (ground truth):
private void processTransaction(String actorType,ActorFactory actorFactory,byte[] bytes,final RP rp) throws Exception {
  makeRootJid();
  transactionListJid.iAdd(-1);
  TransactionActorJid transactionActorJid=(TransactionActorJid)transactionListJid.iGet(-1);
  if (actorType != null) {
    if (bytes == null) {
      transactionActorJid.setValue(actorType);
    }
 else {
      transactionActorJid.setJidBytes(actorType,bytes);
    }
  }
 else {
    if (bytes == null) {
      transactionActorJid.setValue(actorFactory);
    }
 else {
      transactionActorJid.setJidBytes(actorFactory,bytes);
    }
  }
  if (!rp.isEvent()) {
    TransactionResult.req.send(this,transactionActorJid.getValue(),rp);
  }
  if (!writePending) {
    writeBlock();
  }
}
Program: 188011
Project: 188011
Buggy source:
private void processBlock(Block block) throws Exception {
}

Fixed version (ground truth):
private void processBlock(Block block,RP rp) throws Exception {
  rp.processResponse(null);
}
Program: 188012
Project: 188012
Buggy source:
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  if (request.getClass() == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    processBlock(req.block);
    rp.processResponse(null);
  }
  throw new UnsupportedOperationException(request.getClass().getName());
}

Fixed version (ground truth):
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  if (request.getClass() == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    processBlock(req.block,rp);
    return;
  }
  throw new UnsupportedOperationException(request.getClass().getName());
}
Program: 188013
Project: 188013
Buggy source:
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  if (request.getClass() == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    processBlock(req.block);
  }
  throw new UnsupportedOperationException(request.getClass().getName());
}

Fixed version (ground truth):
/** 
 * The application method for processing requests sent to the actor.
 * @param request A request.
 * @param rp      The response processor.
 * @throws Exception Any uncaught exceptions raised while processing the request.
 */
@Override protected void processRequest(Object request,RP rp) throws Exception {
  if (request.getClass() == ProcessBlock.class) {
    ProcessBlock req=(ProcessBlock)request;
    processBlock(req.block);
    rp.processResponse(null);
  }
  throw new UnsupportedOperationException(request.getClass().getName());
}
Program: 188014
Project: 188014
Buggy source:
@Override protected void processRequest(Object request,RP rp) throws Exception {
  rp.processResponse(null);
}

Fixed version (ground truth):
@Override protected void processRequest(Object request,RP rp) throws Exception {
  if (request.getClass() == Eval.class) {
    rp.processResponse(null);
    return;
  }
  super.processRequest(request,rp);
}
Program: 188015
Project: 188015
Buggy source:
@Override public Customer createCustomer(Customer customer){
  customer.setId(nextId());
  return customer;
}

Fixed version (ground truth):
@Override public Customer createCustomer(Customer customer){
  findAllCustomers();
  customer.setId(nextId());
  return customer;
}
Program: 188016
Project: 188016
Buggy source:
public void renameFolder(DefaultMutableTreeNode treenode,MyFolder parent){
  final JTextField name=new JTextField();
  name.addAncestorListener(new AncestorListener(){
    @Override public void ancestorRemoved(    AncestorEvent arg0){
    }
    @Override public void ancestorMoved(    AncestorEvent arg0){
    }
    @Override public void ancestorAdded(    AncestorEvent arg0){
      name.requestFocusInWindow();
    }
  }
);
  name.setText(parent.toString());
  JPanel p=getPropPanel(name,null);
  int r=(Integer)CustomDialog.showDialog(p,JOptionPane.PLAIN_MESSAGE,JOptionPane.OK_CANCEL_OPTION,panel,"String_Node_Str",null);
  if (r == JOptionPane.OK_OPTION && (!name.getText().equals("String_Node_Str"))) {
    parent.getNode().setNodeValue(name.getText());
    ((DefaultTreeModel)tree.getModel()).nodeChanged(treenode);
    writeXML();
    uploadFile();
  }
}

Fixed version (ground truth):
public void renameFolder(DefaultMutableTreeNode treenode,MyFolder parent){
  final JTextField name=new JTextField();
  name.addAncestorListener(new AncestorListener(){
    @Override public void ancestorRemoved(    AncestorEvent arg0){
    }
    @Override public void ancestorMoved(    AncestorEvent arg0){
    }
    @Override public void ancestorAdded(    AncestorEvent arg0){
      name.requestFocusInWindow();
    }
  }
);
  name.setText(parent.toString());
  JPanel p=getPropPanel(name,null);
  int r=(Integer)CustomDialog.showDialog(p,JOptionPane.PLAIN_MESSAGE,JOptionPane.OK_CANCEL_OPTION,panel,"String_Node_Str",null);
  if (r == JOptionPane.OK_OPTION) {
    if (name.getText().equals("String_Node_Str")) {
      CustomDialog.showInfo(JOptionPane.WARNING_MESSAGE,main,"String_Node_Str","String_Node_Str");
      return;
    }
    for (int i=0; i < treenode.getParent().getChildCount(); i++) {
      Object node=((DefaultMutableTreeNode)treenode.getParent().getChildAt(i)).getUserObject();
      if (node.getClass() == MyFolder.class && node != parent) {
        if (((MyFolder)node).toString().equals(name.getText())) {
          CustomDialog.showInfo(JOptionPane.WARNING_MESSAGE,main,"String_Node_Str","String_Node_Str");
          return;
        }
      }
    }
    parent.getNode().setNodeValue(name.getText());
    ((DefaultTreeModel)tree.getModel()).nodeChanged(treenode);
    writeXML();
    uploadFile();
  }
}
Program: 188017
Project: 188017
Buggy source:
public void appendFolder(DefaultMutableTreeNode treenode,MyFolder parent){
  String resp=CustomDialog.showInputDialog(JOptionPane.PLAIN_MESSAGE,JOptionPane.OK_CANCEL_OPTION,panel,"String_Node_Str","String_Node_Str");
  if (resp != null && !resp.equals("String_Node_Str")) {
    Element rootElement=doc.createElement("String_Node_Str");
    parent.getNode().getParentNode().getParentNode().appendChild(rootElement);
    Element fname=doc.createElement("String_Node_Str");
    rootElement.appendChild(fname);
    Node node=doc.createTextNode(resp);
    fname.appendChild(node);
    MyFolder folder=new MyFolder(node);
    DefaultMutableTreeNode temp=new DefaultMutableTreeNode(folder,true);
    ((DefaultTreeModel)tree.getModel()).insertNodeInto(temp,treenode,treenode.getChildCount());
    writeXML();
    uploadFile();
  }
}

Fixed version (ground truth):
public void appendFolder(DefaultMutableTreeNode treenode,MyFolder parent){
  String resp=CustomDialog.showInputDialog(JOptionPane.PLAIN_MESSAGE,JOptionPane.OK_CANCEL_OPTION,panel,"String_Node_Str","String_Node_Str");
  if (resp != null) {
    if (resp.equals("String_Node_Str")) {
      CustomDialog.showInfo(JOptionPane.WARNING_MESSAGE,main,"String_Node_Str","String_Node_Str");
      return;
    }
    for (int i=0; i < treenode.getChildCount(); i++) {
      Object node=((DefaultMutableTreeNode)treenode.getChildAt(i)).getUserObject();
      if (node.getClass() == MyFolder.class) {
        if (((MyFolder)node).toString().equals(resp)) {
          CustomDialog.showInfo(JOptionPane.WARNING_MESSAGE,main,"String_Node_Str","String_Node_Str");
          return;
        }
      }
    }
    Element rootElement=doc.createElement("String_Node_Str");
    parent.getNode().getParentNode().getParentNode().appendChild(rootElement);
    Element fname=doc.createElement("String_Node_Str");
    rootElement.appendChild(fname);
    Node node=doc.createTextNode(resp);
    fname.appendChild(node);
    MyFolder folder=new MyFolder(node);
    DefaultMutableTreeNode temp=new DefaultMutableTreeNode(folder,true);
    ((DefaultTreeModel)tree.getModel()).insertNodeInto(temp,treenode,treenode.getChildCount());
    writeXML();
    uploadFile();
  }
}
Program: 188018
Project: 188018
Buggy source:
public void parseFolder(Node node,DefaultMutableTreeNode parent){
  try {
    Node n=((Element)node).getElementsByTagName("String_Node_Str").item(0);
    MyFolder fname=new MyFolder(n.getFirstChild());
    DefaultMutableTreeNode temp=new DefaultMutableTreeNode(fname,true);
    parent.add(temp);
    XPathExpression expr1=xpath.compile("String_Node_Str");
    NodeList nodes=(NodeList)expr1.evaluate(node,XPathConstants.NODESET);
    for (int i=0; i < nodes.getLength(); i++) {
      MyParam param=new MyParam();
      n=((Element)nodes.item(i)).getElementsByTagName("String_Node_Str").item(0);
      param.setName(n.getFirstChild());
      n=((Element)nodes.item(i)).getElementsByTagName("String_Node_Str").item(0);
      param.setValue(n.getFirstChild());
      temp.add(new DefaultMutableTreeNode(param,true));
    }
    expr1=xpath.compile("String_Node_Str");
    nodes=(NodeList)expr1.evaluate(node,XPathConstants.NODESET);
    for (int i=0; i < nodes.getLength(); i++) {
      parseFolder(nodes.item(i),temp);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void parseFolder(Node node,DefaultMutableTreeNode parent){
  try {
    Node n=((Element)node).getElementsByTagName("String_Node_Str").item(0);
    MyFolder fname=new MyFolder(n.getFirstChild());
    DefaultMutableTreeNode temp=new DefaultMutableTreeNode(fname,true);
    parent.add(temp);
    XPathExpression expr1=xpath.compile("String_Node_Str");
    NodeList nodes=(NodeList)expr1.evaluate(node,XPathConstants.NODESET);
    for (int i=0; i < nodes.getLength(); i++) {
      MyParam param=new MyParam();
      n=((Element)nodes.item(i)).getElementsByTagName("String_Node_Str").item(0);
      param.setName(n.getFirstChild());
      n=((Element)nodes.item(i)).getElementsByTagName("String_Node_Str").item(0);
      if (n.getChildNodes().getLength() == 0) {
        Node tn=doc.createTextNode("String_Node_Str");
        ((Element)nodes.item(i)).getElementsByTagName("String_Node_Str").item(0).appendChild(tn);
        param.setValue(tn);
      }
 else {
        param.setValue(n.getFirstChild());
      }
      temp.add(new DefaultMutableTreeNode(param,true));
    }
    expr1=xpath.compile("String_Node_Str");
    nodes=(NodeList)expr1.evaluate(node,XPathConstants.NODESET);
    for (int i=0; i < nodes.getLength(); i++) {
      parseFolder(nodes.item(i),temp);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}