nus-yam/ex-repair huggingface dataset:
Program: 98629
Project: 98629
Buggy source:
/** 
 * onReceive_HandleReset
 * @param packet
 */
private void onReceive_HandleReset(Packet packet){
  Session current=getOutboundByNode(packet.getFrom());
  if (current != null && current.getConnectionId() == packet.getConnectionId()) {
    info("String_Node_Str" + packet.stringizeHeader());
    current.setClosed();
    m_activeOutSessions.remove(packet.getFrom());
    onConnectionAborted(packet.getFrom());
  }
 else {
    current=getInboundByNode(packet.getFrom());
    if (current != null && current.getConnectionId() == packet.getConnectionId()) {
      info("String_Node_Str" + packet.stringizeHeader());
      current.setClosed();
      m_activeInSessions.remove(packet.getFrom());
      onConnectionAborted(packet.getFrom());
    }
 else {
      info("String_Node_Str" + packet.stringizeHeader());
    }
  }
}

Fixed version (ground truth):
/** 
 * onReceive_HandleReset
 * @param packet
 */
private void onReceive_HandleReset(Packet packet){
  Session current=getOutboundByNode(packet.getFrom());
  if (current != null && current.getConnectionId() == packet.getConnectionId()) {
    info("String_Node_Str" + packet.stringizeHeader());
    current.setClosed();
    m_activeOutSessions.remove(packet.getFrom());
    onConnectionAborted(packet.getFrom());
  }
 else {
    info("String_Node_Str" + packet.stringizeHeader());
  }
}
Program: 98630
Project: 98630
Buggy source:
/** 
 * onReceive_HandleAck
 * @param packet
 */
private void onReceive_HandleAck(Packet packet){
  Session current=getOutboundByNode(packet.getFrom());
  if (current != null && current.getConnectionId() == packet.getConnectionId()) {
    if (packet.getSequence() == 0 && current.getConnecting() && !current.getConnected()) {
      info(String.format("String_Node_Str",packet.getConnectionId(),packet.getFrom()));
      current.setConnected();
      while (current.getSendQueue().size() > 0) {
        Packet dataPacket;
        dataPacket=current.getSendQueue().remove();
        info("String_Node_Str" + dataPacket.stringize());
        current.addToWaitingForAckList(dataPacket.getSequence());
        this.internalSendPacket(dataPacket,TIMEOUT);
      }
    }
 else {
      info("String_Node_Str" + packet.getSequence());
    }
    current.removeFromWaitingForAckList(packet.getSequence());
  }
 else {
    info("String_Node_Str" + packet.stringizeHeader());
  }
}

Fixed version (ground truth):
/** 
 * onReceive_HandleAck
 * @param packet
 */
private void onReceive_HandleAck(Packet packet){
  Session current=getOutboundByNode(packet.getFrom());
  if (current != null && current.getConnectionId() == packet.getConnectionId()) {
    if (packet.getSequence() == 0 && current.getConnecting() && !current.getConnected()) {
      info(String.format("String_Node_Str",packet.getConnectionId(),packet.getFrom()));
      current.setConnected();
      while (current.getSendQueue().size() > 0) {
        Packet dataPacket;
        dataPacket=current.getSendQueue().remove();
        info("String_Node_Str" + dataPacket.stringize());
        current.addToWaitingForAckList(dataPacket.getSequence());
        this.internalSendPacket(current,dataPacket,TIMEOUT);
      }
    }
 else {
      info("String_Node_Str" + packet.getSequence());
    }
    current.removeFromWaitingForAckList(packet.getSequence());
  }
 else {
    info("String_Node_Str" + packet.stringizeHeader());
  }
}
Program: 98631
Project: 98631
Buggy source:
public Packet getNextReceivePacket(){
  if (this.m_reorderMap.containsKey(this.m_sequence)) {
    Packet packet=this.m_reorderMap.get(this.m_sequence);
    this.m_reorderMap.remove(this.m_sequence);
    this.m_sequence++;
    return packet;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public Packet getNextReceivePacket(int minSequence){
  Packet packet=null;
  while (packet == null) {
    if (this.m_reorderMap.containsKey(this.m_sequence)) {
      packet=this.m_reorderMap.get(this.m_sequence);
      this.m_reorderMap.remove(this.m_sequence);
      this.m_sequence++;
    }
 else     if (this.m_sequence < minSequence) {
      this.m_sequence++;
    }
 else {
      break;
    }
  }
  return packet;
}
Program: 98632
Project: 98632
Buggy source:
public String addFriend(String login,String friendLogin) throws FacebookException {
  if (!this.isValidUser(friendLogin)) {
    throw new FacebookException(FacebookException.USER_DONT_EXIST);
  }
  this.appendToLog("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  List<String> listFriends;
  listFriends=this.m_friendRequests.get(friendLogin);
  listFriends.add(login);
  this.info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  return null;
}

Fixed version (ground truth):
public String addFriend(String token,String friendLogin) throws FacebookException {
  String login=this.getUser(token).getLogin();
  if (!this.isValidUser(friendLogin)) {
    throw new FacebookException(FacebookException.USER_DONT_EXIST);
  }
  this.appendToLog("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  List<String> listFriends;
  listFriends=this.m_friendRequests.get(friendLogin);
  listFriends.add(login);
  this.info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  return null;
}
Program: 98633
Project: 98633
Buggy source:
protected String callLocalMethod(String methodCall,Vector<String> params) throws FacebookException {
  if (methodCall.startsWith("String_Node_Str")) {
    return this.createUser(params.get(0),params.get(1));
  }
 else   if (methodCall.startsWith("String_Node_Str")) {
    return this.addFriend(params.get(0),params.get(1));
  }
 else   if (methodCall.startsWith("String_Node_Str")) {
    return this.acceptFriend(params.get(0),params.get(1));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
protected String callLocalMethod(String methodCall,Vector<String> params) throws FacebookException {
  if (methodCall.startsWith("String_Node_Str")) {
    return this.createUser(params.get(0),params.get(1));
  }
 else   if (methodCall.startsWith("String_Node_Str")) {
    return this.login(params.get(0),params.get(1));
  }
 else   if (methodCall.startsWith("String_Node_Str")) {
    return this.logout(params.get(0));
  }
 else   if (methodCall.startsWith("String_Node_Str")) {
    return this.addFriend(params.get(0),params.get(1));
  }
 else   if (methodCall.startsWith("String_Node_Str")) {
    return this.acceptFriend(params.get(0),params.get(1));
  }
 else {
    return null;
  }
}
Program: 98634
Project: 98634
Buggy source:
public User getUser(String token) throws FacebookException {
  if (this.isLoggedIn(token)) {
    String login=this.m_activeSessions.get(token);
    return this.m_users.get(login);
  }
 else {
    throw new FacebookException(FacebookException.SESSION_DONT_EXIST);
  }
}

Fixed version (ground truth):
public User getUser(String token) throws FacebookException {
  if (this.m_inRecovery) {
    return this.m_users.get(token);
  }
  if (this.isLoggedIn(token)) {
    String login=this.m_activeSessions.get(token);
    return this.m_users.get(login);
  }
 else {
    throw new FacebookException(FacebookException.SESSION_DONT_EXIST);
  }
}
Program: 98635
Project: 98635
Buggy source:
public String acceptFriend(String login,String friendLogin) throws FacebookException {
  if (!this.isValidUser(friendLogin)) {
    throw new FacebookException(FacebookException.USER_DONT_EXIST);
  }
  List<String> requestList;
  requestList=this.m_friendRequests.get(login);
  User friendUser;
  friendUser=this.m_users.get(friendLogin);
  if (!requestList.contains(friendUser)) {
    throw new FacebookException(FacebookException.INVALID_REQUEST);
  }
  this.appendToLog("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  requestList.remove(friendUser);
  addFriendToList(login,friendLogin);
  addFriendToList(friendLogin,login);
  this.info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  return null;
}

Fixed version (ground truth):
public String acceptFriend(String token,String friendLogin) throws FacebookException {
  String login=this.getUser(token).getLogin();
  if (!this.isValidUser(friendLogin)) {
    throw new FacebookException(FacebookException.USER_DONT_EXIST);
  }
  List<String> requestList;
  requestList=this.m_friendRequests.get(login);
  User friendUser;
  friendUser=this.m_users.get(friendLogin);
  if (!requestList.contains(friendLogin)) {
    throw new FacebookException(FacebookException.INVALID_REQUEST);
  }
  this.appendToLog("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  requestList.remove(friendUser);
  addFriendToList(login,friendLogin);
  addFriendToList(friendLogin,login);
  this.info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
  return null;
}
Program: 98636
Project: 98636
Buggy source:
private void routeToAppropriateShards(String methodName,Vector<String> params) throws FacebookException {
  String userId=params.get(0);
  FacebookFrontendSystem frontendSystem=(FacebookFrontendSystem)this.m_system;
  String token=params.get(0);
  User user=frontendSystem.getUser(token);
  params.set(0,user.getLogin());
  if (methodName.startsWith("String_Node_Str")) {
    for (int i=FRONTEND_ADDRESS + 1; i < FRONTEND_ADDRESS + 1 + NUMBER_OF_SHARDS; i++) {
      this.callMethod(i,methodName,params);
    }
  }
 else {
    int shardAddress=userId.hashCode() % NUMBER_OF_SHARDS;
    this.callMethod(shardAddress,methodName,params);
  }
}

Fixed version (ground truth):
private void routeToAppropriateShards(String methodName,Vector<String> params) throws FacebookException {
  FacebookFrontendSystem frontendSystem=(FacebookFrontendSystem)this.m_system;
  String token=params.get(0);
  User user=frontendSystem.getUser(token);
  params.set(0,user.getLogin());
  if (methodName.startsWith("String_Node_Str")) {
    for (    int shardAddr : SHARDS_ADDRESSES) {
      this.callMethod(shardAddr,methodName,params);
    }
  }
 else {
    int shardAddress=user.getLogin().hashCode() % SHARDS_ADDRESSES.length;
    this.callMethod(shardAddress,methodName,params);
  }
}
Program: 98637
Project: 98637
Buggy source:
public String readMessagesAll(String token) throws FacebookException {
  return "String_Node_Str";
}

Fixed version (ground truth):
public String readMessagesAll(String login) throws FacebookException {
  if (!this.m_messages.containsKey(login)) {
    return null;
  }
  Vector<Message> messages=this.m_messages.get(login);
  StringBuffer sb=new StringBuffer();
  for (  Message message : messages) {
    sb.append("String_Node_Str");
    sb.append(message.getFromLogin());
    sb.append('\n');
    sb.append("String_Node_Str");
    sb.append(message.getMessage());
    sb.append('\n');
  }
  return sb.toString();
}
Program: 98638
Project: 98638
Buggy source:
public String writeMessagesAll(String token,String message) throws FacebookException {
  return null;
}

Fixed version (ground truth):
public String writeMessagesAll(String from,String message) throws FacebookException {
  Set<String> logins=m_messages.keySet();
  Message m=new Message(from,message);
  for (  String login : logins) {
    this.m_messages.get(login).add(m);
  }
  this.appendToLog("String_Node_Str" + from + "String_Node_Str"+ message);
  return null;
}
Program: 98639
Project: 98639
Buggy source:
public int getShardAddress(String user){
  int shardCount=FacebookRPCNode.getShardAddresses().size();
  int hash=(int)user.charAt(0) - 'a';
  return 1 + (hash * shardCount) / 26;
}

Fixed version (ground truth):
public int getShardAddress(String user){
  int shardCount=FacebookRPCNode.getShardAddresses().size();
  int hash=(int)Character.toLowerCase(user.charAt(0)) - 'a';
  return 1 + (hash * shardCount) / 26;
}
Program: 98640
Project: 98640
Buggy source:
@Override public void onCommand(String command){
  String[] parts=command.split("String_Node_Str");
  String verb=parts[0];
  if (verb.startsWith("String_Node_Str")) {
    this.createUser(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    System.out.println(this.login(parts[1],parts[2]));
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.logout(parts[1]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.addFriend(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.acceptFriend(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.postMessageToAllFriends(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    System.out.println(this.readAllMessages(parts[1]));
  }
}

Fixed version (ground truth):
@Override public void onCommand(String command){
  String[] parts=command.split("String_Node_Str");
  String verb=parts[0];
  if (verb.startsWith("String_Node_Str")) {
    this.createUser(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    System.out.println(this.login(parts[1],parts[2]));
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.logout(parts[1]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.addFriend(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.acceptFriend(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.writeMessagesAll(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    System.out.println(this.readMessagesAll(parts[1]));
  }
}
Program: 98641
Project: 98641
Buggy source:
private void sendAck(int targetSender,int sequenceNumber){
  byte[] buffer=new byte[4];
  ByteManipulator.addInt(buffer,0,sequenceNumber);
  this.send(targetSender,MESSAGE_TYPE.ACK,buffer);
}

Fixed version (ground truth):
private void sendAck(int targetSender,int sequenceNumber){
  byte[] buffer=new byte[4];
  ByteManipulator.addInt(buffer,0,sequenceNumber);
  this.send(targetSender,MESSAGE_TYPE.ACK,buffer);
  info("String_Node_Str" + targetSender + "String_Node_Str"+ sequenceNumber);
}
Program: 98642
Project: 98642
Buggy source:
@Override public void onReceive(Integer from,int protocol,byte[] msg){
  int sequence=ByteManipulator.getInt(msg,0);
  Session session=this.m_sessionManager.getSession(from);
  if (session.didAlreadyReceiveSequence(sequence)) {
    info("String_Node_Str" + sequence);
    this.sendAck(from.intValue(),sequence);
    long identifier=getPacketIdentifier(from.intValue(),sequence);
    this.onReliableMessageSent(identifier);
  }
 else {
    if (protocol == MESSAGE_TYPE.NORMAL) {
      session.markSequenceAsReceived(sequence);
      session.addToReceiveQueue(new Packet(msg,from));
      Packet packet;
      while ((packet=session.getNextReceivePacket()) != null) {
        this.onReliableMessageReceived(packet.getFrom(),packet.getBuffer());
      }
      this.sendAck(from.intValue(),sequence);
    }
 else     if (protocol == MESSAGE_TYPE.ACK) {
      info("String_Node_Str" + sequence);
      session.removeFromWaitingForAckList(sequence);
    }
 else {
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Integer from,int protocol,byte[] msg){
  int sequence=ByteManipulator.getInt(msg,0);
  Session session=this.m_sessionManager.getSession(from);
  if (protocol == MESSAGE_TYPE.NORMAL) {
    if (session.didAlreadyReceiveSequence(sequence)) {
      info("String_Node_Str" + from + "String_Node_Str"+ sequence);
      this.sendAck(from.intValue(),sequence);
      long identifier=getPacketIdentifier(from.intValue(),sequence);
      this.onReliableMessageSent(identifier);
    }
 else {
      info("String_Node_Str" + from + "String_Node_Str"+ sequence);
      session.markSequenceAsReceived(sequence);
      session.addToReceiveQueue(new Packet(msg,from));
      Packet packet;
      while ((packet=session.getNextReceivePacket()) != null) {
        this.onReliableMessageReceived(packet.getFrom(),packet.getBuffer());
      }
      this.sendAck(from.intValue(),sequence);
    }
  }
 else   if (protocol == MESSAGE_TYPE.ACK) {
    info("String_Node_Str" + from + "String_Node_Str"+ sequence);
    session.removeFromWaitingForAckList(sequence);
  }
 else {
  }
}
Program: 98643
Project: 98643
Buggy source:
protected static void warn(String msg){
  System.out.println("String_Node_Str" + msg);
}

Fixed version (ground truth):
protected void warn(String msg){
  System.out.println("String_Node_Str" + this.addr + "String_Node_Str"+ msg);
}
Program: 98644
Project: 98644
Buggy source:
/** 
 * Method that subclasses will override to handle reliably message received stuff
 * @param msg
 */
protected void onReliableMessageReceived(int from,byte[] msg){
  info("String_Node_Str" + Utility.byteArrayToString(msg) + "String_Node_Str"+ from);
}

Fixed version (ground truth):
/** 
 * Method that subclasses will override to handle reliably message received stuff
 * @param msg
 */
protected void onReliableMessageReceived(int from,byte[] msg){
  info("String_Node_Str" + from + "String_Node_Str"+ Utility.byteArrayToString(msg));
}
Program: 98645
Project: 98645
Buggy source:
public void onTimeout(Integer targetSender,Integer sequenceNumber,byte[] buffer){
  Session session=this.m_sessionManager.getSession(targetSender);
  if (session.containsInWaitinfForAckList(sequenceNumber.intValue())) {
    info("String_Node_Str" + sequenceNumber);
    this.internalSendPacket(targetSender,sequenceNumber,buffer);
  }
}

Fixed version (ground truth):
public void onTimeout(Integer targetSender,Integer sequenceNumber,byte[] buffer){
  Session session=this.m_sessionManager.getSession(targetSender);
  if (session.containsInWaitinfForAckList(sequenceNumber.intValue())) {
    info("String_Node_Str" + targetSender + "String_Node_Str"+ sequenceNumber.intValue());
    this.internalSendPacket(targetSender,sequenceNumber,buffer);
  }
}
Program: 98646
Project: 98646
Buggy source:
protected static void info(String msg){
  System.out.println("String_Node_Str" + msg);
}

Fixed version (ground truth):
protected void info(String msg){
  System.out.println("String_Node_Str" + this.addr + "String_Node_Str"+ msg);
}
Program: 98647
Project: 98647
Buggy source:
@Override public void start(){
  super.start();
  info("String_Node_Str" + this.addr);
  recoverFromCrash();
}

Fixed version (ground truth):
@Override public void start(){
  super.start();
  recoverFromCrash();
}
Program: 98648
Project: 98648
Buggy source:
public static StringBuffer serialize(RPCMethodCall methodCall){
  StringBuffer sb=new StringBuffer();
  sb.append(methodCall.getMethodName().length());
  sb.append("String_Node_Str");
  sb.append(methodCall.getMethodName());
  sb.append("String_Node_Str");
  for (int i=0; i < methodCall.getParams().size(); i++) {
    String paramStr=methodCall.getParams().get(i).toString();
    sb.append(paramStr.length());
    sb.append("String_Node_Str");
    sb.append(paramStr);
    sb.append("String_Node_Str");
  }
  return sb;
}

Fixed version (ground truth):
public static StringBuffer serialize(RPCMethodCall methodCall){
  StringBuffer sb=new StringBuffer();
  sb.append(methodCall.getMethodName().length());
  sb.append("String_Node_Str");
  sb.append(methodCall.getMethodName());
  sb.append("String_Node_Str");
  if (methodCall.getParams() != null) {
    for (int i=0; i < methodCall.getParams().size(); i++) {
      String paramStr=methodCall.getParams().get(i).toString();
      sb.append(paramStr.length());
      sb.append("String_Node_Str");
      sb.append(paramStr);
      sb.append("String_Node_Str");
    }
  }
  return sb;
}
Program: 98649
Project: 98649
Buggy source:
@Override public String readLine() throws IOException {
  String ret=super.readLine();
  n.handleDiskReadEvent("String_Node_Str" + Utility.logEscape(ret));
  return ret;
}

Fixed version (ground truth):
@Override public String readLine() throws IOException {
  String ret=super.readLine();
  if (ret != null) {
    n.handleDiskReadEvent("String_Node_Str" + Utility.logEscape(ret));
  }
  return ret;
}
Program: 98653
Project: 98653
Buggy source:
@Override protected void checkWriteCrash(Node n,String description){
  if (userControl.compareTo(FailureLvl.CRASH) < 0) {
    if (Utility.getRNG().nextDouble() < failureRate) {
      System.out.println("String_Node_Str" + n.addr);
      NodeCrashException e=failNode(n.addr);
      throw e;
    }
  }
 else {
    try {
      System.out.println("String_Node_Str" + n.addr + "String_Node_Str"+ description+ "String_Node_Str");
      String input=m_prompt ? Replay.getLine().trim() : "String_Node_Str";
      if (input.length() != 0 && input.charAt(0) == 'y') {
        NodeCrashException e=failNode(n.addr);
        throw e;
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override protected void checkWriteCrash(Node n,String description){
  if (userControl.compareTo(FailureLvl.CRASH) < 0) {
    if (Utility.getRNG().nextDouble() < failureRate) {
      System.out.println("String_Node_Str" + n.addr);
      NodeCrashException e=failNode(n.addr);
      throw e;
    }
  }
 else {
    try {
      String input="String_Node_Str";
      if (m_prompt) {
        System.out.println("String_Node_Str" + n.addr + "String_Node_Str"+ description+ "String_Node_Str");
        input=Replay.getLine().trim();
      }
      if (input.length() != 0 && input.charAt(0) == 'y') {
        NodeCrashException e=failNode(n.addr);
        throw e;
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 98654
Project: 98654
Buggy source:
private void writeMessagesAll(String token,String message){
  User user=getUserFromToken(token);
  this.appendToLog("String_Node_Str" + user.getLogin() + "String_Node_Str"+ message);
  String login=user.getLogin();
  internalPostMessageToAllFriends(login,message);
  info("String_Node_Str" + login + "String_Node_Str"+ message);
}

Fixed version (ground truth):
private void writeMessagesAll(String token,String message) throws Exception {
  User user=getUserFromToken(token);
  this.appendToLog("String_Node_Str" + user.getLogin() + "String_Node_Str"+ message);
  String login=user.getLogin();
  internalPostMessageToAllFriends(login,message);
  info("String_Node_Str" + login + "String_Node_Str"+ message);
}
Program: 98655
Project: 98655
Buggy source:
private String login(String username,String password){
  if (this.m_users.containsKey(username)) {
    String token=username;
    this.m_activeSessions.put(token,username);
    info("String_Node_Str" + username + "String_Node_Str"+ token);
    return token;
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
private String login(String username,String password) throws Exception {
  if (this.m_users.containsKey(username)) {
    String token=username;
    this.m_activeSessions.put(token,username);
    info("String_Node_Str" + username + "String_Node_Str"+ token);
    return token;
  }
 else {
    throw new Exception("String_Node_Str");
  }
}
Program: 98656
Project: 98656
Buggy source:
private User getUserFromToken(String token){
  if (this.m_activeSessions.containsKey(token)) {
    String login=this.m_activeSessions.get(token);
    return this.m_users.get(login);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private User getUserFromToken(String token) throws Exception {
  if (this.m_activeSessions.containsKey(token)) {
    String login=this.m_activeSessions.get(token);
    return this.m_users.get(login);
  }
 else {
    throw new Exception("String_Node_Str");
  }
}
Program: 98657
Project: 98657
Buggy source:
private void logout(String token){
  if (this.m_activeSessions.containsKey(token)) {
    this.m_activeSessions.remove(token);
    info("String_Node_Str" + token + "String_Node_Str");
  }
 else {
  }
}

Fixed version (ground truth):
private void logout(String token) throws Exception {
  if (this.m_activeSessions.containsKey(token)) {
    this.m_activeSessions.remove(token);
    info("String_Node_Str" + token + "String_Node_Str");
  }
 else {
    throw new Exception("String_Node_Str");
  }
}
Program: 98658
Project: 98658
Buggy source:
private String readMessagesAll(String token){
  User user=getUserFromToken(token);
  String login=user.getLogin();
  StringBuffer sb=new StringBuffer();
  if (this.m_messages.containsKey(login)) {
    List<Message> listOfMessages=this.m_messages.get(login);
    for (    Message message : listOfMessages) {
      sb.append(message.getMessage());
      sb.append('\n');
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
private String readMessagesAll(String token) throws Exception {
  User user=getUserFromToken(token);
  String login=user.getLogin();
  StringBuffer sb=new StringBuffer();
  if (this.m_messages.containsKey(login)) {
    List<Message> listOfMessages=this.m_messages.get(login);
    for (    Message message : listOfMessages) {
      sb.append(message.getMessage());
      sb.append('\n');
    }
  }
  return sb.toString();
}
Program: 98659
Project: 98659
Buggy source:
private void internalAcceptFriend(String login,String friendLogin){
  addFriendToList(login,friendLogin);
  addFriendToList(friendLogin,login);
  info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
}

Fixed version (ground truth):
private void internalAcceptFriend(String login,String friendLogin) throws Exception {
  addFriendToList(login,friendLogin);
  addFriendToList(friendLogin,login);
  info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
}
Program: 98660
Project: 98660
Buggy source:
@Override protected void onMethodCalled(int from,String methodName,Vector<String> params){
  Vector<String> returnParams=new Vector();
  String returnMethodName="String_Node_Str";
  try {
    String returnValue=null;
    if (methodName == "String_Node_Str") {
      this.createUser(params.get(0),params.get(1));
    }
 else     if (methodName == "String_Node_Str") {
      returnValue=this.login(params.get(0),params.get(1));
    }
 else     if (methodName == "String_Node_Str") {
      this.logout(params.get(0));
    }
 else     if (methodName == "String_Node_Str") {
      this.addFriend(params.get(0),params.get(1));
    }
 else     if (methodName == "String_Node_Str") {
      this.acceptFriend(params.get(0),params.get(1));
    }
 else     if (methodName == "String_Node_Str") {
      this.writeMessagesAll(params.get(0),params.get(1));
    }
 else     if (methodName == "String_Node_Str") {
      returnValue=this.readMessagesAll(params.get(0));
    }
    returnParams.add("String_Node_Str");
    if (returnValue != null) {
      returnParams.add(returnValue);
    }
  }
 catch (  Exception e) {
    returnParams.add("String_Node_Str");
    returnParams.add(e.getMessage());
  }
  this.callMethod(from,returnMethodName,returnParams);
}

Fixed version (ground truth):
@Override protected void onMethodCalled(int from,String methodName,Vector<String> params){
  Vector<String> returnParams=new Vector();
  String returnMethodName="String_Node_Str";
  try {
    String returnValue=null;
    if (methodName.startsWith("String_Node_Str")) {
      this.createUser(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      returnValue=this.login(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.logout(params.get(0));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.addFriend(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.acceptFriend(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.writeMessagesAll(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      returnValue=this.readMessagesAll(params.get(0));
    }
 else {
      throw new Exception("String_Node_Str");
    }
    returnParams.add("String_Node_Str");
    if (returnValue != null) {
      returnParams.add(returnValue);
    }
  }
 catch (  Exception e) {
    returnParams.add("String_Node_Str");
    returnParams.add(e.getMessage());
  }
  this.callMethod(from,returnMethodName,returnParams);
}
Program: 98661
Project: 98661
Buggy source:
private void addFriend(String token,String friendLogin){
  User user=getUserFromToken(token);
  this.appendToLog("String_Node_Str" + user.getLogin() + "String_Node_Str"+ friendLogin);
  String login=user.getLogin();
  internalAddFriend(login,friendLogin);
}

Fixed version (ground truth):
private void addFriend(String token,String friendLogin) throws Exception {
  User user=getUserFromToken(token);
  this.appendToLog("String_Node_Str" + user.getLogin() + "String_Node_Str"+ friendLogin);
  String login=user.getLogin();
  internalAddFriend(login,friendLogin);
}
Program: 98662
Project: 98662
Buggy source:
private void internalAddFriend(String login,String friendLogin){
  List<User> listFriends;
  if (this.m_friendRequestss.containsKey(login)) {
    listFriends=this.m_friends.get(login);
  }
 else {
    listFriends=new Vector<User>();
    this.m_friendRequestss.put(login,listFriends);
  }
  User friendUser=this.m_users.get(friendLogin);
  listFriends.add(friendUser);
  info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
}

Fixed version (ground truth):
private void internalAddFriend(String login,String friendLogin) throws Exception {
  List<User> listFriends;
  if (this.m_friendRequestss.containsKey(login)) {
    listFriends=this.m_friends.get(login);
  }
 else {
    listFriends=new Vector<User>();
    this.m_friendRequestss.put(login,listFriends);
  }
  if (!this.m_users.containsKey(friendLogin)) {
    throw new Exception("String_Node_Str");
  }
  User friendUser=this.m_users.get(friendLogin);
  listFriends.add(friendUser);
  info("String_Node_Str" + login + "String_Node_Str"+ friendLogin);
}
Program: 98663
Project: 98663
Buggy source:
@Override public void onCommand(String command){
  String[] parts=command.split("String_Node_Str");
  String verb=parts[0];
  if (verb.startsWith("String_Node_Str")) {
    this.createUser(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    System.out.println(this.login(parts[1],parts[2]));
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.logout(parts[1]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.addFriend(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.acceptFriend(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    this.writeMessagesAll(parts[1],parts[2]);
  }
 else   if (verb.startsWith("String_Node_Str")) {
    System.out.println(this.readMessagesAll(parts[1]));
  }
}

Fixed version (ground truth):
@Override public void onCommand(String command){
  try {
    String[] parts=command.split("String_Node_Str");
    String verb=parts[0];
    if (verb.startsWith("String_Node_Str")) {
      this.createUser(parts[1],parts[2]);
    }
 else     if (verb.startsWith("String_Node_Str")) {
      System.out.println(this.login(parts[1],parts[2]));
    }
 else     if (verb.startsWith("String_Node_Str")) {
      this.logout(parts[1]);
    }
 else     if (verb.startsWith("String_Node_Str")) {
      this.addFriend(parts[1],parts[2]);
    }
 else     if (verb.startsWith("String_Node_Str")) {
      this.acceptFriend(parts[1],parts[2]);
    }
 else     if (verb.startsWith("String_Node_Str")) {
      this.writeMessagesAll(parts[1],parts[2]);
    }
 else     if (verb.startsWith("String_Node_Str")) {
      System.out.println(this.readMessagesAll(parts[1]));
    }
  }
 catch (  Exception ex) {
    error(ex.getMessage());
  }
}
Program: 98664
Project: 98664
Buggy source:
private void acceptFriend(String token,String friendLogin){
  User user=getUserFromToken(token);
  this.appendToLog("String_Node_Str" + user.getLogin() + "String_Node_Str"+ friendLogin);
  String login=user.getLogin();
  internalAcceptFriend(login,friendLogin);
}

Fixed version (ground truth):
private void acceptFriend(String token,String friendLogin) throws Exception {
  User user=getUserFromToken(token);
  this.appendToLog("String_Node_Str" + user.getLogin() + "String_Node_Str"+ friendLogin);
  String login=user.getLogin();
  internalAcceptFriend(login,friendLogin);
}
Program: 98665
Project: 98665
Buggy source:
private void createUser(String username,String password){
  if (this.m_users.containsKey(username)) {
  }
 else {
    this.appendToLog("String_Node_Str" + username + password);
    this.m_users.put(username,new User(username,password));
  }
}

Fixed version (ground truth):
private void createUser(String username,String password) throws Exception {
  if (this.m_users.containsKey(username)) {
    throw new Exception("String_Node_Str");
  }
 else {
    this.appendToLog("String_Node_Str" + username + password);
    this.m_users.put(username,new User(username,password));
  }
}
Program: 98666
Project: 98666
Buggy source:
private void addFriendToList(String login,String friendLogin){
  List<User> listFriends;
  if (this.m_friends.containsKey(login)) {
    listFriends=this.m_friends.get(login);
  }
 else {
    listFriends=new Vector<User>();
    this.m_friends.put(login,listFriends);
  }
  User friendUser=this.m_users.get(friendLogin);
  listFriends.add(friendUser);
}

Fixed version (ground truth):
private void addFriendToList(String login,String friendLogin) throws Exception {
  List<User> listFriends;
  if (this.m_friends.containsKey(login)) {
    listFriends=this.m_friends.get(login);
  }
 else {
    listFriends=new Vector<User>();
    this.m_friends.put(login,listFriends);
  }
  if (!this.m_users.containsKey(friendLogin)) {
    throw new Exception("String_Node_Str");
  }
  User friendUser=this.m_users.get(friendLogin);
  listFriends.add(friendUser);
}
Program: 98667
Project: 98667
Buggy source:
@Override protected void executeClientCommand(String command){
  String[] parts=command.split("String_Node_Str");
  String verb=parts[0];
  Vector<String> params=new Vector<String>();
  for (int i=1; i < parts.length; i++) {
    params.add(parts[i]);
  }
  m_pendingCommand=verb;
  this.callMethod(0,verb,params);
}

Fixed version (ground truth):
@Override protected void executeClientCommand(String command){
  String[] parts=command.split("String_Node_Str");
  String methodName=parts[0];
  Vector<String> params=new Vector<String>();
  if (methodName.startsWith("String_Node_Str")) {
    int idx=command.indexOf(' ');
    int nextIdx=command.indexOf(' ',idx + 1);
    if (idx != -1 && nextIdx != -1) {
      String token=command.substring(idx,nextIdx).trim();
      String msg=command.substring(nextIdx,command.length()).trim();
      params.add(token);
      params.add(msg);
    }
  }
 else {
    for (int i=1; i < parts.length; i++) {
      params.add(parts[i]);
    }
  }
  this.callMethod(0,methodName,params);
}
Program: 98668
Project: 98668
Buggy source:
private void executeServerCommand(int from,String methodName,Vector<String> params){
  Vector<String> returnParams=new Vector<String>();
  String returnMethodName="String_Node_Str";
  try {
    String returnValue=null;
    if (methodName.startsWith("String_Node_Str")) {
      this.m_system.createUser(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      returnValue=this.m_system.login(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.logout(params.get(0));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.addFriend(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.acceptFriend(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.writeMessagesAll(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      returnValue=this.m_system.readMessagesAll(params.get(0));
    }
 else {
      throw new FacebookException(FacebookException.INVALID_FACEBOOK_METHOD);
    }
    returnParams.add("String_Node_Str");
    if (returnValue != null) {
      returnParams.add(returnValue);
    }
  }
 catch (  FacebookException e) {
    returnParams.add("String_Node_Str");
    returnParams.add(String.format(ERROR_MESSAGE_FORMAT,methodName,this.addr,e.getExceptionCode()));
  }
  m_pendingCommand=returnMethodName;
  this.callMethod(from,returnMethodName,returnParams);
}

Fixed version (ground truth):
private void executeServerCommand(int from,String methodName,Vector<String> params){
  Vector<String> returnParams=new Vector<String>();
  String returnMethodName="String_Node_Str";
  try {
    String returnValue=null;
    if (methodName.startsWith("String_Node_Str")) {
      this.m_system.createUser(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      returnValue=this.m_system.login(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.logout(params.get(0));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.addFriend(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.acceptFriend(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      this.m_system.writeMessagesAll(params.get(0),params.get(1));
    }
 else     if (methodName.startsWith("String_Node_Str")) {
      returnValue=this.m_system.readMessagesAll(params.get(0));
    }
 else {
      throw new FacebookException(FacebookException.INVALID_FACEBOOK_METHOD);
    }
    returnParams.add("String_Node_Str");
    if (returnValue != null) {
      returnParams.add(returnValue);
    }
  }
 catch (  FacebookException e) {
    returnParams.add("String_Node_Str");
    returnParams.add(String.format(ERROR_MESSAGE_FORMAT,methodName,this.addr,e.getExceptionCode()));
  }
  this.callMethod(from,returnMethodName,returnParams);
}
Program: 98669
Project: 98669
Buggy source:
@Override protected void onMethodCalled(int from,String methodName,Vector<String> params){
  if (isServer()) {
    executeServerCommand(from,methodName,params);
  }
 else {
    endClientCommand(from,methodName,params);
  }
}

Fixed version (ground truth):
@Override protected void onMethodCalled(int from,String methodName,Vector<String> params){
  if (isServer()) {
    executeServerCommand(from,methodName,params);
  }
 else {
    endClientCommand(from,methodName.toLowerCase().trim(),params);
  }
}
Program: 98670
Project: 98670
Buggy source:
private void endClientCommand(int from,String methodName,Vector<String> params){
  if (params.size() == 2 && params.get(0).equals("String_Node_Str")) {
    user_info(String.format("String_Node_Str",this.addr,params.get(1)));
  }
 else   if (params.size() == 2 && params.get(0).equals("String_Node_Str")) {
    user_info("String_Node_Str" + params.get(1));
  }
  endCommand();
}

Fixed version (ground truth):
private void endClientCommand(int from,String methodName,Vector<String> params){
  if (params.size() == 2 && params.get(0).equals("String_Node_Str")) {
    user_info(String.format("String_Node_Str",this.addr,params.get(1)));
  }
 else   if (params.size() >= 1 && params.get(0).equals("String_Node_Str")) {
    String returnValue=params.size() == 2 ? params.get(1) : null;
    user_info("String_Node_Str" + returnValue);
  }
  endCommand();
}
Program: 98671
Project: 98671
Buggy source:
@Override protected void onConnectionAborted(int endpoint){
  if (isServer()) {
  }
 else {
    if (m_pendingCommand != null) {
      Vector<String> args=new Vector<String>();
      args.add("String_Node_Str");
      args.add(String.format(ERROR_MESSAGE_FORMAT,m_pendingCommand,0,FacebookException.CONNECTION_ABORTED));
      endClientCommand(0,m_pendingCommand,args);
    }
  }
}

Fixed version (ground truth):
@Override protected void onConnectionAborted(int endpoint){
  if (isServer()) {
  }
 else {
    String pendingCommand;
    if ((pendingCommand=this._commandQueue.peek()) != null) {
      Vector<String> args=new Vector<String>();
      args.add("String_Node_Str");
      args.add(String.format(ERROR_MESSAGE_FORMAT,pendingCommand,0,FacebookException.CONNECTION_ABORTED));
      endClientCommand(0,pendingCommand,args);
    }
  }
}
Program: 98672
Project: 98672
Buggy source:
/** 
 * API: login()
 * @param username
 * @param password
 * @return
 * @throws FacebookException
 */
public String login(String username,String password) throws FacebookException {
  if (this.isValidUser(username)) {
    String token=username;
    this.m_activeSessions.put(token,username);
    this.info("String_Node_Str" + username + "String_Node_Str"+ token);
    return token;
  }
 else {
    throw new FacebookException(FacebookException.USER_DONT_EXIST);
  }
}

Fixed version (ground truth):
/** 
 * API: login()
 * @param username
 * @param password
 * @return
 * @throws FacebookException
 */
public String login(String username,String password) throws FacebookException {
  if (this.isValidUser(username)) {
    String token=nextSessionId();
    this.m_activeSessions.put(token,username);
    this.info("String_Node_Str" + username + "String_Node_Str"+ token);
    return token;
  }
 else {
    throw new FacebookException(FacebookException.USER_DONT_EXIST);
  }
}
Program: 98673
Project: 98673
Buggy source:
public void save(File file){
  Path path=Paths.get(file.getAbsolutePath());
  if (Files.isWritable(path)) {
    try {
      save(Files.newOutputStream(path));
    }
 catch (    IOException ioe) {
      throw Throwables.propagate(ioe);
    }
  }
 else {
    throw new IllegalStateException(String.format("String_Node_Str",path));
  }
}

Fixed version (ground truth):
public void save(File file){
  Path path=Paths.get(file.getAbsolutePath());
  if (Files.exists(path) && !Files.isWritable(path)) {
    throw new IllegalStateException(String.format("String_Node_Str",path));
  }
  try {
    save(Files.newOutputStream(path));
  }
 catch (  IOException ioe) {
    throw Throwables.propagate(ioe);
  }
}
Program: 98674
Project: 98674
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  controller.setMode(mode.get().name());
  controller.setRender(render.get().name());
  controller.setPaletteFile(paletteFile.get());
  controller.setPaletteSize(paletteSize.get());
  controller.setSeed(seed.get());
  controller.setThreads(threads.get());
  controller.setDebug(debug.get());
  controller.loadColours();
  controller.getViewer().reset();
  if (controller.getViewer().isVisible()) {
    controller.getViewer().start();
  }
  setVisible(false);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  setVisible(false);
  controller.getViewer().stop();
  controller.setMode(mode.get().name());
  controller.setRender(render.get().name());
  controller.setPaletteFile(paletteFile.get());
  controller.setPaletteSize(paletteSize.get());
  controller.setSeed(seed.get());
  controller.setThreads(threads.get());
  controller.setDebug(debug.get());
  controller.loadColours();
  controller.getViewer().reset();
  if (controller.getViewer().isVisible()) {
    controller.getViewer().start();
  }
}
Program: 98679
Project: 98679
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  controller.setMode(mode.get().name());
  controller.setRender(render.get().name());
  controller.setPaletteFile(paletteFile.get());
  controller.setPaletteSize(paletteSize.get());
  controller.setSeed(seed.get());
  controller.setThreads(threads.get());
  controller.setDebug(debug.get());
  controller.loadColours();
  bus.post(controller.getIFS());
  setVisible(false);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  controller.setMode(mode.get().name());
  controller.setRender(render.get().name());
  controller.setPaletteFile(paletteFile.get());
  controller.setPaletteSize(paletteSize.get());
  controller.setSeed(seed.get());
  controller.setThreads(threads.get());
  controller.setDebug(debug.get());
  controller.loadColours();
  controller.getViewer().reset();
  setVisible(false);
}
Program: 98681
Project: 98681
Buggy source:
public void save(File file){
  try (FileWriter writer=new FileWriter(file)){
    JAXBContext context=JAXBContext.newInstance(IFS.class);
    Marshaller marshaller=context.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
    marshaller.marshal(ifs,writer);
    Closeables.close(writer,true);
    cwd=file.getParentFile();
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
public void save(File file){
  try (FileWriter writer=new FileWriter(file)){
    JAXBContext context=JAXBContext.newInstance(IFS.class);
    Marshaller marshaller=context.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
    marshaller.marshal(ifs,writer);
    cwd=file.getParentFile();
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 98683
Project: 98683
Buggy source:
@Override public int compare(Transform left,Transform right){
  return ComparisonChain.start().compare(left.getZIndex(),right.getZIndex()).result();
}

Fixed version (ground truth):
@Override public int compare(Transform left,Transform right){
  return ComparisonChain.start().compare(left.getZIndex(),right.getZIndex()).compare(left.getId(),right.getId()).result();
}
Program: 98684
Project: 98684
Buggy source:
@Subscribe public void update(IFS ifs){
  this.ifs=ifs;
}

Fixed version (ground truth):
@Subscribe public void update(IFS ifs){
  this.ifs=ifs;
  reset();
}
Program: 98686
Project: 98686
Buggy source:
@POST @Produces(MediaType.TEXT_PLAIN) @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) public String newAlarm(Trip newTrip){
  DAO.insertUserTrip(userName,newTrip);
  return "String_Node_Str";
}

Fixed version (ground truth):
@POST @Produces(MediaType.TEXT_PLAIN) @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) public String newAlarm(Trip newTrip){
  return String.valueOf(DAO.insertUserTrip(userName,newTrip));
}
Program: 98687
Project: 98687
Buggy source:
/** 
 * Adds a new trip to the specified User.
 * @param tripId Trip to add data to
 * @param position data to add
 */
public static void insertUserTrip(String userName,Trip trip){
  Session session=getSession();
  User user=(User)session.bySimpleNaturalId(User.class).load(userName);
  user.addTrip(trip);
  session.beginTransaction();
  session.save(user);
  commitAndClose(session);
}

Fixed version (ground truth):
/** 
 * Adds a new trip to the specified User.
 * @param tripId Trip to add data to
 * @param position data to add
 */
public static long insertUserTrip(String userName,Trip trip){
  Session session=getSession();
  User user=(User)session.bySimpleNaturalId(User.class).load(userName);
  user.addTrip(trip);
  session.beginTransaction();
  session.save(user);
  commitAndClose(session);
  return trip.getId();
}
Program: 98688
Project: 98688
Buggy source:
@OneToMany(cascade=CascadeType.ALL) public List<AccData> getAccData(){
  return accData;
}

Fixed version (ground truth):
@XmlTransient @OneToMany(cascade=CascadeType.ALL) public List<AccData> getAccData(){
  return accData;
}
Program: 98689
Project: 98689
Buggy source:
@OneToMany(cascade=CascadeType.ALL) public List<Position> getLocData(){
  return locData;
}

Fixed version (ground truth):
@XmlTransient @OneToMany(cascade=CascadeType.ALL) public List<Position> getLocData(){
  return locData;
}
Program: 98690
Project: 98690
Buggy source:
public void addTrip(Trip trip){
  trip.setUser(this);
  this.trips.add(trip);
}

Fixed version (ground truth):
public void addTrip(Trip trip){
  this.trips.add(trip);
}
Program: 98691
Project: 98691
Buggy source:
public static Trip getLastSourceId(String userName){
  Session session=getSession();
  Long userId=getByNaturalId(session,User.class,userName).getId();
  Criteria crit=session.createCriteria(Trip.class);
  crit.add(Restrictions.eq("String_Node_Str",userId));
  crit.addOrder(Order.desc("String_Node_Str"));
  Trip trip=(Trip)crit.uniqueResult();
  session.close();
  return trip;
}

Fixed version (ground truth):
public static Trip getLastSourceId(String userName){
  Session session=getSession();
  Long userId=getByNaturalId(session,User.class,userName).getId();
  Query q=session.createQuery("String_Node_Str");
  Trip trip=(Trip)q.uniqueResult();
  session.close();
  return trip;
}
Program: 98692
Project: 98692
Buggy source:
@POST @Produces(MediaType.TEXT_HTML) @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) public void newAccData(AccData newAccData){
  DAO.insertTripAccData(tripId,newAccData);
}

Fixed version (ground truth):
@POST @Produces(MediaType.TEXT_HTML) @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) public String newAccData(AccData newAccData){
  DAO.insertTripAccData(tripId,newAccData);
  return "String_Node_Str";
}