nus-yam/ex-repair huggingface dataset:
Program: 99019
Project: 99019
Buggy source:
public void checkForNameInList(Integer errorCode,String userName,String filename,Integer serverId,Callback userExistsCallback,Callback userNoExistsCallback) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName,filename,null,userExistsCallback,userNoExistsCallback};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] pTypes={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Method checkForName=Callback.getMethod("String_Node_Str",this,pTypes);
  Object[] p={null,userName,userExistsCallback,userNoExistsCallback};
  Callback checkForNameCallback=new Callback(checkForName,this,p);
  get(serverId,filename,checkForNameCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void checkForNameInList(Integer errorCode,String userName,String filename,Integer serverId,Callback userExistsCallback,Callback userNoExistsCallback) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName,filename,null,userExistsCallback,userNoExistsCallback};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] pTypes={"String_Node_Str",byte[].class.getName(),String.class.getName(),"String_Node_Str","String_Node_Str"};
  Method checkForName=Callback.getMethod("String_Node_Str",this,pTypes);
  Object[] p={null,null,userName,userExistsCallback,userNoExistsCallback};
  Callback checkForNameCallback=new Callback(checkForName,this,p);
  get(serverId,filename,checkForNameCallback,tryAgainCallback);
}
Program: 99020
Project: 99020
Buggy source:
public void removeFromRequestList(String fileContents,String username) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  Set<String> pendingRequests=new HashSet<String>();
  Scanner friendScanner=new Scanner(fileContents);
  while (friendScanner.hasNext()) {
    pendingRequests.add(friendScanner.next());
  }
  pendingRequests.remove(username);
  StringBuilder fixedFriendList=new StringBuilder();
  Iterator<String> listIterator=pendingRequests.iterator();
  while (listIterator.hasNext()) {
    fixedFriendList.append(listIterator.next() + "String_Node_Str");
  }
  String[] failParamTypes={Integer.class.getName(),String.class.getName()};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,username};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] goodParamTypes={"String_Node_Str"};
  Method continueMethod=Callback.getMethod("String_Node_Str",this,goodParamTypes);
  Object[] goodParams={username};
  Callback continuationCallback=new Callback(continueMethod,this,goodParams);
  String filename=REQUESTS_PREFIX + loggedInUser;
  String newFileContents=fixedFriendList.toString();
  put(userDataLocations.get(loggedInUser),filename,newFileContents,continuationCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void removeFromRequestList(Integer from,byte[] contents,String username) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String fileContents=Utility.byteArrayToString(contents);
  Set<String> pendingRequests=new HashSet<String>();
  Scanner friendScanner=new Scanner(fileContents);
  while (friendScanner.hasNext()) {
    pendingRequests.add(friendScanner.next());
  }
  pendingRequests.remove(username);
  StringBuilder fixedFriendList=new StringBuilder();
  Iterator<String> listIterator=pendingRequests.iterator();
  while (listIterator.hasNext()) {
    fixedFriendList.append(listIterator.next() + "String_Node_Str");
  }
  String[] failParamTypes={Integer.class.getName(),String.class.getName()};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,username};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] goodParamTypes={Integer.class.getName(),byte[].class.getName(),"String_Node_Str"};
  Method continueMethod=Callback.getMethod("String_Node_Str",this,goodParamTypes);
  Object[] goodParams={null,null,username};
  Callback continuationCallback=new Callback(continueMethod,this,goodParams);
  String filename=REQUESTS_PREFIX + loggedInUser;
  String newFileContents=fixedFriendList.toString();
  put(userDataLocations.get(loggedInUser),filename,newFileContents,continuationCallback,tryAgainCallback);
}
Program: 99021
Project: 99021
Buggy source:
public void addToRequestsFile(Integer errorCode,String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  if (errorCode != null && errorCode.equals(FILE_TOO_LARGE)) {
    printError("String_Node_Str" + userName + "String_Node_Str");
    doingWork=false;
    return;
  }
  if (errorCode != null && errorCode.equals(FILE_NO_EXIST)) {
    printError("String_Node_Str" + userName);
    doingWork=false;
    return;
  }
  String[] failParamTypes={"String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] successParamTypes={Integer.class.getName(),byte[].class.getName(),String.class.getName()};
  Method showSuccess=Callback.getMethod("String_Node_Str",this,successParamTypes);
  Object[] successParams={null,null,userName};
  Callback successCallback=new Callback(showSuccess,this,successParams);
  String appendContents="String_Node_Str" + loggedInUser;
  String filename=REQUESTS_PREFIX + userName;
  append(userDataLocations.get(userName),filename,appendContents,successCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void addToRequestsFile(Integer errorCode,String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  if (errorCode != null && errorCode.equals(FILE_TOO_LARGE)) {
    printError("String_Node_Str" + userName + "String_Node_Str");
    doingWork=false;
    return;
  }
  if (!userDataLocations.containsKey(userName) || (errorCode != null && errorCode.equals(FILE_NO_EXIST))) {
    printError("String_Node_Str" + userName);
    doingWork=false;
    return;
  }
  String[] failParamTypes={"String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] successParamTypes={Integer.class.getName(),byte[].class.getName(),String.class.getName()};
  Method showSuccess=Callback.getMethod("String_Node_Str",this,successParamTypes);
  Object[] successParams={null,null,userName};
  Callback successCallback=new Callback(showSuccess,this,successParams);
  String appendContents="String_Node_Str" + loggedInUser;
  String filename=REQUESTS_PREFIX + userName;
  append(userDataLocations.get(userName),filename,appendContents,successCallback,tryAgainCallback);
}
Program: 99022
Project: 99022
Buggy source:
public void showAllOfList(Integer errorCode,String filename,Integer serverId) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,filename,serverId};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] goodParamTypes={Integer.class.getName(),byte[].class.getName()};
  Method printResults=Callback.getMethod("String_Node_Str",this,goodParamTypes);
  Object[] goodParams={null};
  Callback printCallback=new Callback(printResults,this,goodParams);
  get(serverId,filename,printCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void showAllOfList(Integer errorCode,String filename,Integer serverId) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,filename,serverId};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  if (errorCode != null && errorCode == FILE_NO_EXIST) {
    printError("String_Node_Str");
    return;
  }
  String[] goodParamTypes={Integer.class.getName(),byte[].class.getName()};
  Method printResults=Callback.getMethod("String_Node_Str",this,goodParamTypes);
  Object[] goodParams={null,null};
  Callback printCallback=new Callback(printResults,this,goodParams);
  get(serverId,filename,printCallback,tryAgainCallback);
}
Program: 99023
Project: 99023
Buggy source:
public void sendDecisionRequest(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  TxnState txnState=participantTxns.get(txnID);
  for (  Integer otherAddr : txnState.participants) {
    TxnPacket txnPkt=TxnPacket.getDecisionRequestPacket(this,txnID);
    Callback success=createCallback("String_Node_Str",new String[]{Byte[].class.getName()},null);
    makeRequest(Command.TXN,txnPkt.pack(),success,null,otherAddr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ otherAddr+ "String_Node_Str");
  }
  Callback decisionTimeout=createCallback("String_Node_Str",new String[]{UUID.class.getName()},new Object[]{txnID});
  addTimeout(decisionTimeout,DECISION_RESEND_TIMEOUT);
}

Fixed version (ground truth):
public void sendDecisionRequest(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  TxnState txnState=participantTxns.get(txnID);
  for (  Integer otherAddr : txnState.participants) {
    TxnPacket txnPkt=TxnPacket.getDecisionRequestPacket(this,txnID);
    Callback success=createCallback("String_Node_Str",new String[]{byte[].class.getName()},null);
    makeRequest(Command.TXN,txnPkt.pack(),success,null,otherAddr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ otherAddr+ "String_Node_Str");
  }
  Callback decisionTimeout=createCallback("String_Node_Str",new String[]{UUID.class.getName()},new Object[]{txnID});
  addTimeout(decisionTimeout,DECISION_RESEND_TIMEOUT);
}
Program: 99026
Project: 99026
Buggy source:
public void sendDecisionRequest(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  TxnState txnState=participantTxns.get(txnID);
  for (  Integer otherAddr : txnState.participants) {
    TxnPacket txnPkt=TxnPacket.getDecisionRequestPacket(this,txnID);
    Callback success=createCallback("String_Node_Str",new String[]{byte[].class.getName()},new Object[]{null});
    makeRequest(Command.TXN,txnPkt.pack(),success,null,otherAddr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ otherAddr+ "String_Node_Str");
  }
  Callback decisionTimeout=createCallback("String_Node_Str",new String[]{UUID.class.getName()},new Object[]{txnID});
  addTimeout(decisionTimeout,DECISION_RESEND_TIMEOUT);
}

Fixed version (ground truth):
public void sendDecisionRequest(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  TxnState txnState=participantTxns.get(txnID);
  for (  Integer otherAddr : txnState.participants) {
    TxnPacket txnPkt=TxnPacket.getDecisionRequestPacket(this,txnID);
    Callback success=createCallback("String_Node_Str",new String[]{Integer.class.getName(),byte[].class.getName()},new Object[]{null,null});
    makeRequest(Command.TXN,txnPkt.pack(),success,null,otherAddr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ otherAddr+ "String_Node_Str");
  }
  Callback decisionTimeout=createCallback("String_Node_Str",new String[]{UUID.class.getName()},new Object[]{txnID});
  addTimeout(decisionTimeout,DECISION_RESEND_TIMEOUT);
}
Program: 99027
Project: 99027
Buggy source:
public void receiveDecisionResponse(byte[] response){
  if (response != null && response.length > 0) {
    TxnPacket pkt=TxnPacket.unpack(response);
    writeOutput("String_Node_Str" + pkt.getID() + "String_Node_Str");
    if (pkt.getProtocol() == TxnProtocol.TXN_COMMIT) {
      recieveTxnCommit(pkt);
    }
 else     if (pkt.getProtocol() == TxnProtocol.TXN_ABORT) {
      recieveTxnAbort(pkt);
    }
  }
}

Fixed version (ground truth):
public void receiveDecisionResponse(Integer from,byte[] response){
  if (response != null && response.length > 0) {
    TxnPacket pkt=TxnPacket.unpack(response);
    writeOutput("String_Node_Str" + pkt.getID() + "String_Node_Str");
    if (pkt.getProtocol() == TxnProtocol.TXN_COMMIT) {
      recieveTxnCommit(pkt);
    }
 else     if (pkt.getProtocol() == TxnProtocol.TXN_ABORT) {
      recieveTxnAbort(pkt);
    }
  }
}
Program: 99028
Project: 99028
Buggy source:
protected Callback createCallback(String methodName,String[] parameterTypes,Object[] params){
  Method m;
  try {
    m=Callback.getMethod(methodName,this,parameterTypes);
  }
 catch (  Exception e) {
    writeError("String_Node_Str");
    e.printStackTrace();
    fail();
    return null;
  }
  return new Callback(m,this,params);
}

Fixed version (ground truth):
protected Callback createCallback(String methodName,String[] parameterTypes,Object[] params){
  Method m;
  try {
    m=Callback.getMethod(methodName,this,parameterTypes);
  }
 catch (  Exception e) {
    writeError("String_Node_Str" + methodName + "String_Node_Str"+ Arrays.toString(parameterTypes)+ "String_Node_Str");
    e.printStackTrace();
    fail();
    return null;
  }
  return new Callback(m,this,params);
}
Program: 99029
Project: 99029
Buggy source:
private void sendTxnAbort(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  for (  Integer addr : coordinatorTxns.get(txnID).getAcceptors()) {
    TxnPacket txnPkt=TxnPacket.getAbortPacket(this,txnID);
    makeRequest(Command.TXN,txnPkt.pack(),null,null,addr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ addr);
  }
}

Fixed version (ground truth):
public void sendTxnAbort(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  for (  Integer addr : coordinatorTxns.get(txnID).getAcceptors()) {
    TxnPacket txnPkt=TxnPacket.getAbortPacket(this,txnID);
    makeRequest(Command.TXN,txnPkt.pack(),null,null,addr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ addr);
  }
}
Program: 99030
Project: 99030
Buggy source:
public void sendDecisionRequest(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  TxnState txnState=participantTxns.get(txnID);
  for (  Integer addr : txnState.participants) {
    TxnPacket txnPkt=TxnPacket.getDecisionRequestPacket(this,txnID);
    Callback success=createCallback("String_Node_Str",new String[]{"String_Node_Str"},null);
    makeRequest(Command.TXN,txnPkt.pack(),success,null,addr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ addr+ "String_Node_Str");
  }
  Callback decisionTimeout=createCallback("String_Node_Str",new String[]{"String_Node_Str"},new Object[]{txnID});
  addTimeout(decisionTimeout,DECISION_RESEND_TIMEOUT);
}

Fixed version (ground truth):
public void sendDecisionRequest(UUID txnID){
  writeOutput("String_Node_Str" + txnID + "String_Node_Str");
  TxnState txnState=participantTxns.get(txnID);
  for (  Integer addr : txnState.participants) {
    TxnPacket txnPkt=TxnPacket.getDecisionRequestPacket(this,txnID);
    Callback success=createCallback("String_Node_Str",new String[]{Byte[].class.getName()},null);
    makeRequest(Command.TXN,txnPkt.pack(),success,null,addr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnID + "String_Node_Str"+ addr+ "String_Node_Str");
  }
  Callback decisionTimeout=createCallback("String_Node_Str",new String[]{UUID.class.getName()},new Object[]{txnID});
  addTimeout(decisionTimeout,DECISION_RESEND_TIMEOUT);
}
Program: 99031
Project: 99031
Buggy source:
public void receiveProposalResponse(int from,byte[] response){
  TxnPacket pkt=TxnPacket.unpack(response);
  TxnState txnState=coordinatorTxns.get(pkt.getID());
  if (pkt.getProtocol() == TxnProtocol.TXN_ACCEPT) {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ from);
    txnState.accept(from);
  }
 else {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ from+ "String_Node_Str"+ pkt.getPayload());
    txnState.reject(from);
  }
  if (txnState.allVotesIn()) {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    if (txnState.allAccepted()) {
      txnLogger.logCommit(txnState);
      sendTxnCommit(txnState.txnID);
    }
 else {
      txnLogger.logAbort(txnState);
      sendTxnAbort(txnState.txnID);
    }
  }
}

Fixed version (ground truth):
public void receiveProposalResponse(Integer from,Byte[] response){
  TxnPacket pkt=TxnPacket.unpack(response);
  TxnState txnState=coordinatorTxns.get(pkt.getID());
  if (pkt.getProtocol() == TxnProtocol.TXN_ACCEPT) {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ from);
    txnState.accept(from);
  }
 else {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ from+ "String_Node_Str"+ pkt.getPayload());
    txnState.reject(from);
  }
  if (txnState.allVotesIn()) {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    if (txnState.allAccepted()) {
      txnLogger.logCommit(txnState);
      sendTxnCommit(txnState.txnID);
    }
 else {
      txnLogger.logAbort(txnState);
      sendTxnAbort(txnState.txnID);
    }
  }
}
Program: 99032
Project: 99032
Buggy source:
public void proposeTransaction(Set<Integer> participant_addrs,String request,String args){
  if (!participant_addrs.contains(this.addr)) {
    writeOutput("String_Node_Str" + addr + "String_Node_Str");
    participant_addrs.add(this.addr);
  }
  UUID txnID=UUID.randomUUID();
  TxnState txnState=new TxnState(txnID,participant_addrs,request,args);
  coordinatorTxns.put(txnID,txnState);
  for (  int addr : coordinatorTxns.get(txnID).participants) {
    TxnPacket txnPkt=TxnPacket.getPropositionPacket(this,txnID,participant_addrs,request,args);
    Callback success=createCallback("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},null);
    Callback failure=createCallback("String_Node_Str",new String[]{"String_Node_Str"},new Object[]{txnID});
    this.makeRequest(Command.TXN,txnPkt.pack(),success,failure,addr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ addr);
  }
  txnLogger.logStart(txnState);
  Callback abortTimeout=createCallback("String_Node_Str",new String[]{"String_Node_Str"},new Object[]{txnID});
  addTimeout(abortTimeout,PROPOSAL_RESPONSE_TIMEOUT);
}

Fixed version (ground truth):
public void proposeTransaction(Set<Integer> participant_addrs,String request,String args){
  if (!participant_addrs.contains(this.addr)) {
    writeOutput("String_Node_Str" + addr + "String_Node_Str");
    participant_addrs.add(this.addr);
  }
  UUID txnID=UUID.randomUUID();
  TxnState txnState=new TxnState(txnID,participant_addrs,request,args);
  coordinatorTxns.put(txnID,txnState);
  for (  int addr : coordinatorTxns.get(txnID).participants) {
    TxnPacket txnPkt=TxnPacket.getPropositionPacket(this,txnID,participant_addrs,request,args);
    Callback success=createCallback("String_Node_Str",new String[]{Integer.class.getName(),Byte[].class.getName()},null);
    Callback failure=createCallback("String_Node_Str",new String[]{UUID.class.getName()},new Object[]{txnID});
    this.makeRequest(Command.TXN,txnPkt.pack(),success,failure,addr,"String_Node_Str");
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ addr);
  }
  txnLogger.logStart(txnState);
  Callback abortTimeout=createCallback("String_Node_Str",new String[]{UUID.class.getName()},new Object[]{txnID});
  addTimeout(abortTimeout,PROPOSAL_RESPONSE_TIMEOUT);
}
Program: 99034
Project: 99034
Buggy source:
public void receiveDecisionResponse(byte[] response){
  if (response != null && response.length > 0) {
    TxnPacket pkt=TxnPacket.unpack(response);
    writeOutput("String_Node_Str" + pkt.getID() + "String_Node_Str");
    if (pkt.getProtocol() == TxnProtocol.TXN_COMMIT) {
      recieveTxnCommit(pkt);
    }
 else     if (pkt.getProtocol() == TxnProtocol.TXN_ABORT) {
      recieveTxnAbort(pkt);
    }
  }
}

Fixed version (ground truth):
public void receiveDecisionResponse(Byte[] response){
  if (response != null && response.length > 0) {
    TxnPacket pkt=TxnPacket.unpack(response);
    writeOutput("String_Node_Str" + pkt.getID() + "String_Node_Str");
    if (pkt.getProtocol() == TxnProtocol.TXN_COMMIT) {
      recieveTxnCommit(pkt);
    }
 else     if (pkt.getProtocol() == TxnProtocol.TXN_ABORT) {
      recieveTxnAbort(pkt);
    }
  }
}
Program: 99036
Project: 99036
Buggy source:
private void recieveTxnCommit(TxnPacket pkt){
  TxnState txnState=participantTxns.get(pkt.getID());
  txnLogger.logCommit(txnState);
  txnState.status=TxnState.TxnStatus.COMMITTED;
  String request=pkt.getRequest();
  try {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    Class<? extends TransactionNode> me=this.getClass();
    Method handler=me.getDeclaredMethod(COMMIT_PREFIX + request,java.lang.String.class,java.util.UUID.class);
    handler.invoke(me,pkt.getPayload(),txnState.txnID);
    txnLogger.logDone(txnState);
  }
 catch (  NoSuchMethodException e) {
    writeError("String_Node_Str" + request);
    fail();
  }
catch (  IllegalArgumentException e) {
    writeError("String_Node_Str" + request + "String_Node_Str");
    fail();
  }
catch (  Exception e) {
    writeError("String_Node_Str" + request + "String_Node_Str"+ e.getMessage());
    this.fail();
  }
}

Fixed version (ground truth):
private void recieveTxnCommit(TxnPacket pkt){
  TxnState txnState=participantTxns.get(pkt.getID());
  txnLogger.logCommit(txnState);
  txnState.status=TxnState.TxnStatus.COMMITTED;
  String request=pkt.getRequest();
  try {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    Class<? extends TransactionNode> me=this.getClass();
    Method handler=me.getDeclaredMethod(COMMIT_PREFIX + request,java.util.UUID.class,java.lang.String.class);
    handler.invoke(this,txnState.txnID,pkt.getPayload());
    txnLogger.logDone(txnState);
  }
 catch (  NoSuchMethodException e) {
    writeError("String_Node_Str" + request);
    fail();
  }
catch (  IllegalArgumentException e) {
    writeError("String_Node_Str" + request + "String_Node_Str");
    fail();
  }
catch (  Exception e) {
    writeError("String_Node_Str" + request + "String_Node_Str"+ e.getMessage());
    this.fail();
  }
}
Program: 99037
Project: 99037
Buggy source:
private void recieveTxnAbort(TxnPacket pkt){
  TxnState txnState=participantTxns.get(pkt.getID());
  txnLogger.logAbort(txnState);
  txnState.status=TxnState.TxnStatus.ABORTED;
  String request=pkt.getRequest();
  try {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    Class<? extends TransactionNode> me=this.getClass();
    Method handler=me.getDeclaredMethod(ABORT_PREFIX + request,java.lang.String.class,java.util.UUID.class);
    handler.invoke(me,pkt.getPayload(),txnState.txnID);
    txnLogger.logDone(txnState);
  }
 catch (  NoSuchMethodException e) {
    writeError("String_Node_Str" + request);
    fail();
  }
catch (  IllegalArgumentException e) {
    writeError("String_Node_Str" + request + "String_Node_Str");
    fail();
  }
catch (  Exception e) {
    writeError("String_Node_Str" + request + "String_Node_Str"+ e.getMessage());
    this.fail();
  }
}

Fixed version (ground truth):
private void recieveTxnAbort(TxnPacket pkt){
  TxnState txnState=participantTxns.get(pkt.getID());
  txnLogger.logAbort(txnState);
  txnState.status=TxnState.TxnStatus.ABORTED;
  String request=pkt.getRequest();
  try {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    Class<? extends TransactionNode> me=this.getClass();
    Method handler=me.getDeclaredMethod(ABORT_PREFIX + request,java.util.UUID.class,java.lang.String.class);
    handler.invoke(this,txnState.txnID,pkt.getPayload());
    txnLogger.logDone(txnState);
  }
 catch (  NoSuchMethodException e) {
    writeError("String_Node_Str" + request);
    fail();
  }
catch (  IllegalArgumentException e) {
    writeError("String_Node_Str" + request + "String_Node_Str");
    fail();
  }
catch (  Exception e) {
    writeError("String_Node_Str" + request + "String_Node_Str"+ e.getMessage());
    this.fail();
  }
}
Program: 99038
Project: 99038
Buggy source:
public void createNewUser(String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  doingWork=true;
  String[] paramTypes={"String_Node_Str","String_Node_Str"};
  Method createFiles=Callback.getMethod("String_Node_Str",this,paramTypes);
  Object[] params={null,userName};
  Callback userNoExistCallback=new Callback(createFiles,this,params);
  String[] noParamTypes={};
  Object[] noParams={};
  Method showWarning=Callback.getMethod("String_Node_Str",this,noParamTypes);
  Callback userExistsCallback=new Callback(showWarning,this,noParams);
  userExists(null,userName,userExistsCallback,userNoExistCallback);
}

Fixed version (ground truth):
public void createNewUser(String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  doingWork=true;
  String[] paramTypes={"String_Node_Str",byte[].class.getName(),"String_Node_Str"};
  Method createFiles=Callback.getMethod("String_Node_Str",this,paramTypes);
  Object[] params={null,null,userName};
  Callback userNoExistCallback=new Callback(createFiles,this,params);
  String[] noParamTypes={Integer.class.getName(),byte[].class.getName()};
  Object[] noParams={null,null};
  Method showWarning=Callback.getMethod("String_Node_Str",this,noParamTypes);
  Callback userExistsCallback=new Callback(showWarning,this,noParams);
  userExists(null,userName,userExistsCallback,userNoExistCallback);
}
Program: 99039
Project: 99039
Buggy source:
public void userAlreadyExists(){
  doingWork=false;
  printError("String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
public void userAlreadyExists(Integer from,byte[] res){
  doingWork=false;
  printError("String_Node_Str" + "String_Node_Str");
}
Program: 99040
Project: 99040
Buggy source:
public void addUserToList(Integer from,byte[] result,String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] successParamTypes={"String_Node_Str"};
  Method showSuccess=Callback.getMethod("String_Node_Str",this,successParamTypes);
  Object[] successParams={userName};
  Callback successCallback=new Callback(showSuccess,this,successParams);
  String appendContents="String_Node_Str" + userName;
  append(ALL_USERS_LOCATION,ALL_USERS_FILE,appendContents,successCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void addUserToList(Integer from,byte[] result,String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] successParamTypes={Integer.class.getName(),byte[].class.getName(),"String_Node_Str"};
  Method showSuccess=Callback.getMethod("String_Node_Str",this,successParamTypes);
  Object[] successParams={null,null,userName};
  Callback successCallback=new Callback(showSuccess,this,successParams);
  String appendContents="String_Node_Str" + userName;
  append(ALL_USERS_LOCATION,ALL_USERS_FILE,appendContents,successCallback,tryAgainCallback);
}
Program: 99041
Project: 99041
Buggy source:
public void userExists(Integer errorCode,String userName,Callback userExistsCallback,Callback userNoExistsCallback) throws SecurityException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName,userExistsCallback,userNoExistsCallback};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  if (errorCode != null && errorCode.equals(FILE_NO_EXIST)) {
    printOutput("String_Node_Str");
    createUsersFile(null,userNoExistsCallback);
    return;
  }
  if (userDataLocations.keySet().size() > 0) {
    if (!userDataLocations.containsKey(userName)) {
      userNoExistsCallback.invoke();
    }
 else {
      userExistsCallback.invoke();
    }
    return;
  }
  String[] pTypes={Integer.class.getName(),byte[].class.getName(),String.class.getName(),Callback.class.getName(),Callback.class.getName()};
  Method checkForName=Callback.getMethod("String_Node_Str",this,pTypes);
  Object[] p={null,userName,userExistsCallback,userNoExistsCallback};
  Callback checkForNameCallback=new Callback(checkForName,this,p);
  get(ALL_USERS_LOCATION,ALL_USERS_FILE,checkForNameCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void userExists(Integer errorCode,String userName,Callback userExistsCallback,Callback userNoExistsCallback) throws SecurityException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName,userExistsCallback,userNoExistsCallback};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  if (errorCode != null && errorCode.equals(FILE_NO_EXIST)) {
    printOutput("String_Node_Str");
    createUsersFile(null,userNoExistsCallback);
    return;
  }
  if (userDataLocations.keySet().size() > 0) {
    if (!userDataLocations.containsKey(userName)) {
      userNoExistsCallback.invoke();
    }
 else {
      userExistsCallback.invoke();
    }
    return;
  }
  String[] pTypes={Integer.class.getName(),byte[].class.getName(),String.class.getName(),Callback.class.getName(),Callback.class.getName()};
  Method checkForName=Callback.getMethod("String_Node_Str",this,pTypes);
  Object[] p={null,null,userName,userExistsCallback,userNoExistsCallback};
  Callback checkForNameCallback=new Callback(checkForName,this,p);
  get(ALL_USERS_LOCATION,ALL_USERS_FILE,checkForNameCallback,tryAgainCallback);
}
Program: 99042
Project: 99042
Buggy source:
public void createPostsFile(Integer errorCode,String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  if (!userDataLocations.containsKey(userName)) {
    userDataLocations.put(userName,nextServer);
    nextServer=(nextServer + 2) % (2 * NUM_SERVERS);
  }
  if (errorCode != null && errorCode.equals(FILE_EXISTS)) {
    createFriendsFile(null,null,userName);
    return;
  }
  String[] failParamTypes={"String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,userName};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] successParamTypes={Integer.class.getName(),byte[].class.getName(),String.class.getName()};
  Method makeFriendsFile=Callback.getMethod("String_Node_Str",this,successParamTypes);
  Object[] successParams={null,null,userName};
  Callback successCallback=new Callback(makeFriendsFile,this,successParams);
  String filename=MESSAGES_PREFIX + userName;
  create(userDataLocations.get(userName),filename,successCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void createPostsFile(Integer errorCode,byte[] res,String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  if (!userDataLocations.containsKey(userName)) {
    userDataLocations.put(userName,nextServer);
    nextServer=(nextServer + 2) % (2 * NUM_SERVERS);
  }
  if (errorCode != null && errorCode.equals(FILE_EXISTS)) {
    createFriendsFile(null,null,userName);
    return;
  }
  String[] failParamTypes={"String_Node_Str",byte[].class.getName(),"String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,null,userName};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] successParamTypes={Integer.class.getName(),byte[].class.getName(),String.class.getName()};
  Method makeFriendsFile=Callback.getMethod("String_Node_Str",this,successParamTypes);
  Object[] successParams={null,null,userName};
  Callback successCallback=new Callback(makeFriendsFile,this,successParams);
  String filename=MESSAGES_PREFIX + userName;
  create(userDataLocations.get(userName),filename,successCallback,tryAgainCallback);
}
Program: 99043
Project: 99043
Buggy source:
public void noSuchUserReport(String username){
  doingWork=false;
  printError("String_Node_Str" + username);
}

Fixed version (ground truth):
public void noSuchUserReport(Integer from,byte[] results,String username){
  doingWork=false;
  printError("String_Node_Str" + username);
}
Program: 99044
Project: 99044
Buggy source:
public void setLoggedInUser(String username){
  loggedInUser=username;
  printOutput("String_Node_Str" + username);
  doingWork=false;
}

Fixed version (ground truth):
public void setLoggedInUser(Integer from,byte[] results,String username){
  loggedInUser=username;
  printOutput("String_Node_Str" + username);
  doingWork=false;
}
Program: 99045
Project: 99045
Buggy source:
public void loginUser(String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  doingWork=true;
  if (loggedInUser != null) {
    printError("String_Node_Str" + loggedInUser);
    doingWork=false;
    return;
  }
  String[] noExistParamTypes={"String_Node_Str"};
  Method noExist=Callback.getMethod("String_Node_Str",this,noExistParamTypes);
  Object[] noExistParams={userName};
  Callback noExistCallback=new Callback(noExist,this,noExistParams);
  Method doesExist=Callback.getMethod("String_Node_Str",this,noExistParamTypes);
  Callback doesExistCallback=new Callback(doesExist,this,noExistParams);
  userExists(null,userName,doesExistCallback,noExistCallback);
}

Fixed version (ground truth):
public void loginUser(String userName) throws SecurityException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  doingWork=true;
  if (loggedInUser != null) {
    printError("String_Node_Str" + loggedInUser);
    doingWork=false;
    return;
  }
  String[] noExistParamTypes={"String_Node_Str",byte[].class.getName(),"String_Node_Str"};
  Method noExist=Callback.getMethod("String_Node_Str",this,noExistParamTypes);
  Object[] noExistParams={null,null,userName};
  Callback noExistCallback=new Callback(noExist,this,noExistParams);
  Method doesExist=Callback.getMethod("String_Node_Str",this,noExistParamTypes);
  Callback doesExistCallback=new Callback(doesExist,this,noExistParams);
  userExists(null,userName,doesExistCallback,noExistCallback);
}
Program: 99046
Project: 99046
Buggy source:
public void createSuccess(String userName){
  doingWork=false;
  printOutput("String_Node_Str" + userName);
}

Fixed version (ground truth):
public void createSuccess(Integer from,byte[] res,String userName){
  doingWork=false;
  printOutput("String_Node_Str" + userName);
}
Program: 99047
Project: 99047
Buggy source:
public void showAllOfList(Integer errorCode,String filename,Integer serverId) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,filename};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] goodParamTypes={"String_Node_Str"};
  Method printResults=Callback.getMethod("String_Node_Str",this,goodParamTypes);
  Object[] goodParams={null};
  Callback printCallback=new Callback(printResults,this,goodParams);
  get(serverId,filename,printCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void showAllOfList(Integer errorCode,String filename,Integer serverId) throws SecurityException, ClassNotFoundException, NoSuchMethodException {
  String[] failParamTypes={"String_Node_Str","String_Node_Str","String_Node_Str"};
  Method tryAgain=Callback.getMethod("String_Node_Str",this,failParamTypes);
  Object[] failParams={null,filename,serverId};
  Callback tryAgainCallback=new Callback(tryAgain,this,failParams);
  String[] goodParamTypes={"String_Node_Str"};
  Method printResults=Callback.getMethod("String_Node_Str",this,goodParamTypes);
  Object[] goodParams={null};
  Callback printCallback=new Callback(printResults,this,goodParams);
  get(serverId,filename,printCallback,tryAgainCallback);
}
Program: 99048
Project: 99048
Buggy source:
public void logSequenceNumber(int seqNum){
  try {
    if (Utility.fileExists(n,log_file)) {
      PersistentStorageReader reader=n.getReader(log_file);
      char[] buf=new char[RIOPacket.MAX_PACKET_SIZE];
      reader.read(buf);
      String oldFileData=new String(buf);
      PersistentStorageWriter writer=n.getWriter(temp_log_file,false);
      writer.write(oldFileData);
      writer.close();
    }
    PersistentStorageWriter writer=n.getWriter(log_file,false);
    writer.write(seqNum);
    writer.close();
    writer=n.getWriter(temp_log_file,false);
    writer.delete();
    writer.close();
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str" + n.addr + "String_Node_Str"+ seqNum+ "String_Node_Str"+ log_file);
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void logSequenceNumber(int seqNum){
  debugPrint("String_Node_Str" + seqNum + "String_Node_Str"+ log_file);
  boolean createdTemp=false;
  if (Utility.fileExists(n,log_file)) {
    int oldValue=getSequenceNumFromFile(log_file);
    if (oldValue != -1) {
      debugPrint("String_Node_Str" + oldValue + "String_Node_Str"+ log_file);
      if (writeCurrentSequence(temp_log_file,oldValue)) {
        debugPrint("String_Node_Str" + seqNum + "String_Node_Str"+ temp_log_file);
        createdTemp=true;
      }
    }
  }
  if (writeCurrentSequence(log_file,seqNum)) {
    debugPrint("String_Node_Str" + seqNum + "String_Node_Str"+ log_file);
  }
  if (createdTemp) {
    deleteFile(temp_log_file);
  }
}
Program: 99049
Project: 99049
Buggy source:
public void setSequenceNumber(){
  lastSeqNum=-1;
  if (Utility.fileExists(n,temp_log_file)) {
    try {
      PersistentStorageReader reader=n.getReader(temp_log_file);
      if (!reader.ready()) {
        PersistentStorageWriter deleter=n.getWriter(temp_log_file,false);
        deleter.delete();
      }
 else {
        char[] buf=new char[RIOPacket.MAX_PACKET_SIZE];
        reader.read(buf);
        PersistentStorageWriter writer=n.getWriter(log_file,false);
        writer.write(buf);
        PersistentStorageWriter deleter=n.getWriter(temp_log_file,false);
        deleter.delete();
      }
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + n.addr + "String_Node_Str"+ log_file);
    }
  }
  if (Utility.fileExists(n,log_file)) {
    try {
      PersistentStorageReader r=n.getReader(log_file);
      if (r.ready()) {
        String num=r.readLine();
        if (!num.trim().isEmpty()) {
          lastSeqNum=Integer.parseInt(num.trim());
        }
      }
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + n.addr + "String_Node_Str"+ log_file+ "String_Node_Str");
      e.printStackTrace();
    }
catch (    NumberFormatException e) {
      System.err.println("String_Node_Str" + n.addr + "String_Node_Str"+ log_file+ "String_Node_Str");
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void setSequenceNumber(){
  debugPrint("String_Node_Str");
  lastSeqNum=-1;
  if (Utility.fileExists(n,temp_log_file)) {
    debugPrint("String_Node_Str" + temp_log_file + "String_Node_Str");
    int oldVal=getSequenceNumFromFile(temp_log_file);
    if (oldVal != -1) {
      if (writeCurrentSequence(log_file,oldVal)) {
        debugPrint("String_Node_Str" + oldVal + "String_Node_Str"+ log_file);
      }
    }
    deleteFile(temp_log_file);
  }
  if (Utility.fileExists(n,log_file)) {
    debugPrint("String_Node_Str" + log_file + "String_Node_Str");
    lastSeqNum=getSequenceNumFromFile(log_file);
  }
 else {
    debugPrint("String_Node_Str" + log_file + "String_Node_Str");
  }
}
Program: 99050
Project: 99050
Buggy source:
/** 
 * Puts contents into the file.
 * @param filename
 * @param contents
 * @param id
 * @return NOT_EXIST status if the file does not exist. FAILURE status ifthe put fails in process.
 */
private RPCResultPacket put(String filename,String contents,int id){
  if (!Utility.fileExists(this,filename)) {
    logError("String_Node_Str" + this.addr + "String_Node_Str"+ filename+ "String_Node_Str");
    return new RPCResultPacket(id,Status.NOT_EXIST,Utility.stringToByteArray(Status.NOT_EXIST.toString()));
  }
  try {
    PersistentStorageReader reader=getReader(filename);
    char[] buf=new char[MAX_FILE_SIZE];
    reader.read(buf);
    String oldFileData=new String(buf);
    PersistentStorageWriter writer=this.getWriter(TEMP_PUT_FILE,false);
    writer.write(filename + "String_Node_Str" + oldFileData);
    writer=this.getWriter(filename,false);
    writer.write(contents);
    writer=this.getWriter(filename,false);
    writer.delete();
    return new RPCResultPacket(id,Status.SUCCESS,Utility.stringToByteArray("String_Node_Str" + filename));
  }
 catch (  IOException e) {
    logError("String_Node_Str" + this.addr + "String_Node_Str"+ filename+ "String_Node_Str");
    return new RPCResultPacket(id,Status.FAILURE,Utility.stringToByteArray(e.getMessage()));
  }
}

Fixed version (ground truth):
/** 
 * Puts contents into the file.
 * @param filename
 * @param contents
 * @param id
 * @return NOT_EXIST status if the file does not exist. FAILURE status ifthe put fails in process.
 */
private RPCResultPacket put(String filename,String contents,int id){
  if (!Utility.fileExists(this,filename)) {
    logError("String_Node_Str" + this.addr + "String_Node_Str"+ filename+ "String_Node_Str");
    return new RPCResultPacket(id,Status.NOT_EXIST,Utility.stringToByteArray(Status.NOT_EXIST.toString()));
  }
  try {
    PersistentStorageReader reader=getReader(filename);
    char[] buf=new char[MAX_FILE_SIZE];
    reader.read(buf);
    String oldFileData=new String(buf);
    PersistentStorageWriter writer=this.getWriter(TEMP_PUT_FILE,false);
    writer.write(filename + "String_Node_Str" + oldFileData);
    writer=this.getWriter(filename,false);
    writer.write(contents);
    writer=this.getWriter(TEMP_PUT_FILE,false);
    writer.delete();
    return new RPCResultPacket(id,Status.SUCCESS,Utility.stringToByteArray("String_Node_Str" + filename));
  }
 catch (  IOException e) {
    logError("String_Node_Str" + this.addr + "String_Node_Str"+ filename+ "String_Node_Str");
    return new RPCResultPacket(id,Status.FAILURE,Utility.stringToByteArray(e.getMessage()));
  }
}
Program: 99052
Project: 99052
Buggy source:
OutChannel(ReliableInOrderMsgLayer parent,int destAddr){
  lastSeqNumSent=-1;
  unACKedPackets=new HashMap<Integer,RIOPacket>();
  this.parent=parent;
  this.destAddr=destAddr;
}

Fixed version (ground truth):
OutChannel(ReliableInOrderMsgLayer parent,int destAddr){
  lastSeqNumSent=-1;
  unACKedPackets=new HashMap<Integer,RIOPacket>();
  attemptsMade=new HashMap<Integer,Integer>();
  this.parent=parent;
  this.destAddr=destAddr;
}
Program: 99053
Project: 99053
Buggy source:
public void addException(AppliedRule exception){
  if (exceptions.contains(exception) && !this.hasException(exception.getId())) {
    exceptions.add(exception);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void addException(AppliedRule exception){
  if (!exceptions.contains(exception) && !this.hasException(exception.getId())) {
    exceptions.add(exception);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 99054
Project: 99054
Buggy source:
@Override public void initUi() throws Exception {
  Log.i(this,"String_Node_Str");
  jframe=new JFrameAppliedRules();
  loadSelectBoxes();
  fillRuleTypeComboBox();
  if (getAction().equals(SoftwareUnitController.ACTION_NEW)) {
    jframe.jButtonSave.setText("String_Node_Str");
    jframe.setTitle("String_Node_Str");
  }
 else   if (getAction().equals(SoftwareUnitController.ACTION_EDIT)) {
    jframe.jButtonSave.setText("String_Node_Str");
    jframe.setTitle("String_Node_Str");
    if (appliedRuleId != -1L) {
      JTableException table=jframe.jTableException;
      JTableTableModel tablemodel=(JTableTableModel)table.getModel();
      ArrayList<Long> exceptions=defineDomainService.getAppliedRuleExceptions(getLayerID(),appliedRuleId);
      for (      long exception_id : exceptions) {
        DataHelper datahelper=new DataHelper();
        datahelper.setId(exception_id);
      }
    }
  }
  jframe.jButtonAddExceptionRow.addActionListener(this);
  jframe.jButtonRemoveExceptionRow.addActionListener(this);
  jframe.jButtonSave.addActionListener(this);
  jframe.jButtonCancel.addActionListener(this);
  jframe.addKeyListener(this);
  UiDialogs.showOnScreen(0,jframe);
  jframe.setVisible(true);
}

Fixed version (ground truth):
@Override public void initUi() throws Exception {
  Log.i(this,"String_Node_Str");
  jframe=new JFrameAppliedRules();
  loadSelectBoxes();
  fillRuleTypeComboBox();
  if (getAction().equals(SoftwareUnitController.ACTION_NEW)) {
    jframe.jButtonSave.setText("String_Node_Str");
    jframe.setTitle("String_Node_Str");
  }
 else   if (getAction().equals(SoftwareUnitController.ACTION_EDIT)) {
    jframe.jButtonSave.setText("String_Node_Str");
    jframe.setTitle("String_Node_Str");
    if (appliedRuleId != -1L) {
      JTableException table=jframe.jTableException;
      JTableTableModel tablemodel=(JTableTableModel)table.getModel();
      ArrayList<Long> exceptionIds=defineDomainService.getExceptionIdsByAppliedRule(appliedRuleId);
      for (      long exception_id : exceptionIds) {
        DataHelper datahelper=new DataHelper();
        datahelper.setId(exception_id);
      }
    }
  }
  jframe.jButtonAddExceptionRow.addActionListener(this);
  jframe.jButtonRemoveExceptionRow.addActionListener(this);
  jframe.jButtonSave.addActionListener(this);
  jframe.jButtonCancel.addActionListener(this);
  jframe.addKeyListener(this);
  UiDialogs.showOnScreen(0,jframe);
  jframe.setVisible(true);
}