nus-yam/ex-repair huggingface dataset:
Program: 98959
Project: 98959
Buggy source:
private Square findCharsStartingAt(Square square){
  square.setColor(Color.GREY);
  char topOfStack=stack.pop();
  if (square.getValue() == topOfStack) {
    if (stack.isEmpty()) {
      return square;
    }
    for (    Square neighbor : grid.getNeighbors(square)) {
      if (Color.WHITE.equals(neighbor.getColor())) {
        neighbor.setParent(square);
        Square solution=findCharsStartingAt(neighbor);
        if (solution != null) {
          return solution;
        }
      }
    }
  }
  stack.push(topOfStack);
  square.setColor(Color.BLACK);
  return null;
}

Fixed version (ground truth):
private Square findCharsStartingAt(Square square){
  square.setColor(Color.GREY);
  char topOfStack=stack.pop();
  if (square.getValue() == topOfStack) {
    if (stack.isEmpty()) {
      return square;
    }
    for (    Square neighbor : grid.getNeighbors(square)) {
      if (Color.WHITE.equals(neighbor.getColor()) || Color.BLACK.equals(neighbor.getColor())) {
        neighbor.setParent(square);
        Square solution=findCharsStartingAt(neighbor);
        if (solution != null) {
          return solution;
        }
      }
    }
  }
  stack.push(topOfStack);
  square.setColor(Color.BLACK);
  return null;
}
Program: 98960
Project: 98960
Buggy source:
@Test public void testFindWord() throws Exception {
  String[] wordsToFind={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (  String wordToFind : wordsToFind) {
    List<Square> solution=wordSearcher.findWord(wordToFind);
    assertSquaresEqual(wordToFind,solution);
  }
}

Fixed version (ground truth):
@Test public void testFindWord() throws Exception {
  String[] wordsToFind={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (  String wordToFind : wordsToFind) {
    List<Square> solution=wordSearcher.findWord(wordToFind);
    assertSquaresEqual(wordToFind,solution);
  }
}
Program: 98962
Project: 98962
Buggy source:
public void update(long elapsedTime){
  EventManager.getEventManager().update(elapsedTime);
  playfield.update(elapsedTime);
  HUD.update(elapsedTime);
  timeStat.update(elapsedTime);
}

Fixed version (ground truth):
public void update(long elapsedTime){
  EventManager.getEventManager().update(elapsedTime);
  playfield.update(elapsedTime);
  HUD.update(elapsedTime);
  timeStat.update(elapsedTime);
  generalTime.update(elapsedTime);
}
Program: 98963
Project: 98963
Buggy source:
public GraphicItem(BufferedImage image,int x,int y,Stat stat){
  myImage=image;
  myStat=stat;
  myX=x;
  myY=y;
  HUDactive=true;
  myFlashTimer=new Timer(50);
}

Fixed version (ground truth):
public GraphicItem(BufferedImage image,int x,int y,Stat stat){
  myImage=image;
  myStat=stat;
  myX=x;
  myY=y;
  HUDactive=true;
  myFlashTimer=new Timer(50);
  myOriginalWidth=image.getWidth();
}
Program: 98964
Project: 98964
Buggy source:
public void findNewSize(){
  int newImageWidth;
  if ((int)(getMyImage().getWidth() * (myStat.getValue() / myStat.getStartValue())) == 0)   newImageWidth=2;
 else   if (myStat.getValue() / myStat.getStartValue() > .97)   newImageWidth=100;
 else   newImageWidth=(int)(getMyImage().getWidth() * (myStat.getValue() / myStat.getStartValue()));
  Image scaledImage=getMyImage().getScaledInstance(newImageWidth,getMyImage().getHeight(),1);
  myImage=convertToBufferedImage(scaledImage);
}

Fixed version (ground truth):
public void findNewSize(){
  int newImageWidth;
  if ((int)(getMyImage().getWidth() * (myStat.getValue() / myStat.getStartValue())) == 0)   newImageWidth=2;
 else   if (myStat.getValue() / myStat.getStartValue() > .97)   newImageWidth=myOriginalWidth;
 else   newImageWidth=(int)(getMyImage().getWidth() * (myStat.getValue() / myStat.getStartValue()));
  Image scaledImage=getMyImage().getScaledInstance(newImageWidth,getMyImage().getHeight(),1);
  myImage=convertToBufferedImage(scaledImage);
}
Program: 98965
Project: 98965
Buggy source:
public void update(long elapsedTime){
  EventManager.getEventManager().update(elapsedTime);
  playfield.update(elapsedTime);
  if (keyDown(KeyEvent.VK_LEFT)) {
    HUD.update(elapsedTime);
  }
  if (keyDown(KeyEvent.VK_LEFT)) {
    EventManager.getEventManager().sendEvent("String_Node_Str");
  }
  if (keyDown(KeyEvent.VK_RIGHT)) {
  }
  if (keyDown(KeyEvent.VK_RIGHT)) {
    EventManager.getEventManager().sendEvent("String_Node_Str");
  }
  if (keyDown(KeyEvent.VK_UP)) {
    s1.move(0,1);
    EventManager.getEventManager().sendEvent("String_Node_Str");
  }
}

Fixed version (ground truth):
public void update(long elapsedTime){
  EventManager.getEventManager().update(elapsedTime);
  playfield.update(elapsedTime);
  HUD.update(elapsedTime);
  if (keyDown(KeyEvent.VK_LEFT)) {
    HUD.update(elapsedTime);
  }
  if (keyDown(KeyEvent.VK_LEFT)) {
    EventManager.getEventManager().sendEvent("String_Node_Str");
  }
  if (keyDown(KeyEvent.VK_RIGHT)) {
  }
  if (keyDown(KeyEvent.VK_RIGHT)) {
    EventManager.getEventManager().sendEvent("String_Node_Str");
  }
  if (keyDown(KeyEvent.VK_UP)) {
    s1.move(0,1);
    EventManager.getEventManager().sendEvent("String_Node_Str");
  }
}
Program: 98966
Project: 98966
Buggy source:
@Override public void actionPerformed(Object object){
}

Fixed version (ground truth):
@Override public void actionPerformed(Object object){
  mySprite.changeScore("String_Node_Str",-3);
  mySprite.changeScore("String_Node_Str",20);
}
Program: 98968
Project: 98968
Buggy source:
private EventManager(){
  mapEventToEventListnerList=new HashMap<String,ArrayList<EventListener>>();
  mapEventConditionToEvent=new HashMap<EventCondition,String>();
}

Fixed version (ground truth):
public EventManager(){
  myEventManager=this;
  mapEventConditionToEvent=new HashMap<EventCondition,String>();
}
Program: 98969
Project: 98969
Buggy source:
public void sendEvent(String e){
  for (  String event : mapEventToEventListnerList.keySet()) {
    if (event.equals(e)) {
      for (      EventListener listener : mapEventToEventListnerList.get(event)) {
        listener.actionPerformed(event);
      }
    }
  }
}

Fixed version (ground truth):
public void sendEvent(String e){
  for (  String event : myEventQueue.getEventListenerMap().keySet()) {
    if (event.equals(e)) {
      for (      EventListener listener : myEventQueue.getEventListenerMap().get(event)) {
        listener.actionPerformed(event);
      }
    }
  }
}
Program: 98970
Project: 98970
Buggy source:
public void unregisterEventListener(String e,EventListener listener){
  myEventQueue.unregisterEventListener(e,listener);
  ArrayList<EventListener> list=mapEventToEventListnerList.get(e);
  list.remove(listener);
}

Fixed version (ground truth):
public void unregisterEventListener(String e,EventListener listener){
  myEventQueue.unregisterEventListener(e,listener);
}
Program: 98971
Project: 98971
Buggy source:
public static String format(double amount){
  return roundToDecimals(amount,2) + "String_Node_Str" + moneyname;
}

Fixed version (ground truth):
public static String format(double amount){
  return SpAEconomy.formatMoney(amount);
}
Program: 98972
Project: 98972
Buggy source:
@Override public void onEnable(){
  Server=this.getServer();
  plugin=(SpAEconomy)getServer().getPluginManager().getPlugin("String_Node_Str");
  moneyname=plugin.getMoneyName();
  info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEnable(){
  info("String_Node_Str");
}
Program: 98973
Project: 98973
Buggy source:
public boolean exists(String name){
  Player player=Bukkit.getPlayer(name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  if (account != null) {
    return iConomy.plugin.accounts.exists(name,account,false);
  }
  return false;
}

Fixed version (ground truth):
public boolean exists(String name){
  Player player=Bukkit.getPlayer(name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  if (account != null) {
    return SpAEconomy.instance.accounts.exists(name,account);
  }
  return false;
}
Program: 98974
Project: 98974
Buggy source:
public boolean create(String name,Double balance,Integer status){
  Player player=Bukkit.getPlayer(name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  if (account != null) {
    iConomy.plugin.accounts.create(name,account,balance);
    iConomy.plugin.accounts.setHidden(name,account,status <= 0 ? false : true);
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean create(String name,Double balance,Integer status){
  Player player=Bukkit.getPlayer(name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  if (account != null) {
    SpAEconomy.instance.accounts.create(name,account,balance);
    SpAEconomy.instance.accounts.setHidden(name,account,status <= 0 ? false : true);
    return true;
  }
  return false;
}
Program: 98975
Project: 98975
Buggy source:
public void add(double amount){
  double balance=getBalance().doubleValue();
  double ending=balance + amount;
  math(amount,balance,ending);
}

Fixed version (ground truth):
public void add(double amount){
  double balance=this.getBalance();
  double ending=balance + amount;
  this.math(amount,balance,ending);
}
Program: 98976
Project: 98976
Buggy source:
public boolean isNegative(){
  return getBalance().doubleValue() < 0.0D;
}

Fixed version (ground truth):
public boolean isNegative(){
  return this.getBalance() < 0.0D;
}
Program: 98977
Project: 98977
Buggy source:
public Double getBalance(){
  Player player=Bukkit.getPlayer(name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  if (account != null) {
    return iConomy.plugin.accounts.getBalance(name,account);
  }
  return 0.0D;
}

Fixed version (ground truth):
public Double getBalance(){
  Player player=Bukkit.getPlayer(this.name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  Double result=0.0D;
  if (account != null) {
    result=SpAEconomy.instance.accounts.getBalance(this.name,account);
  }
  return result == null ? 0.0D : result;
}
Program: 98978
Project: 98978
Buggy source:
public boolean hasEnough(double amount){
  return amount <= getBalance().doubleValue();
}

Fixed version (ground truth):
public boolean hasEnough(double amount){
  return amount <= this.getBalance();
}
Program: 98979
Project: 98979
Buggy source:
public boolean hasOver(double amount){
  return amount < getBalance().doubleValue();
}

Fixed version (ground truth):
public boolean hasOver(double amount){
  return amount < this.getBalance();
}
Program: 98980
Project: 98980
Buggy source:
public void subtract(double amount){
  double balance=getBalance().doubleValue();
  double ending=balance - amount;
  math(amount,balance,ending);
}

Fixed version (ground truth):
public void subtract(double amount){
  double balance=this.getBalance();
  double ending=balance - amount;
  this.math(amount,balance,ending);
}
Program: 98981
Project: 98981
Buggy source:
public void divide(double amount){
  double balance=getBalance().doubleValue();
  double ending=balance / amount;
  math(amount,balance,ending);
}

Fixed version (ground truth):
public void divide(double amount){
  double balance=this.getBalance();
  double ending=balance / amount;
  this.math(amount,balance,ending);
}
Program: 98982
Project: 98982
Buggy source:
private void math(double amount,double balance,double ending){
  setBalance(ending);
}

Fixed version (ground truth):
private void math(double amount,double balance,double ending){
  this.setBalance(ending);
}
Program: 98983
Project: 98983
Buggy source:
public boolean hasUnder(double amount){
  return amount > getBalance().doubleValue();
}

Fixed version (ground truth):
public boolean hasUnder(double amount){
  return amount > this.getBalance();
}
Program: 98984
Project: 98984
Buggy source:
public void setBalance(double balance){
  Player player=Bukkit.getPlayer(name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  if (account != null) {
    iConomy.plugin.accounts.setBalance(name,account,balance);
  }
}

Fixed version (ground truth):
public void setBalance(double balance){
  Player player=Bukkit.getPlayer(this.name);
  String account=SpAEconomy.defaultAccountName;
  if (player != null) {
    account=SpAEconomy.getAccountForWorld(player.getWorld());
  }
  if (account != null) {
    SpAEconomy.instance.accounts.setBalance(this.name,account,balance);
  }
}
Program: 98985
Project: 98985
Buggy source:
public void multiply(double amount){
  double balance=getBalance().doubleValue();
  double ending=balance * amount;
  math(amount,balance,ending);
}

Fixed version (ground truth):
public void multiply(double amount){
  double balance=this.getBalance();
  double ending=balance * amount;
  this.math(amount,balance,ending);
}
Program: 98986
Project: 98986
Buggy source:
/** 
 * to get the categories of commodity
 * @throws UnsupportedEncodingException
 */
public String getItemCats() throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",0);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  return result;
}

Fixed version (ground truth):
/** 
 * to get the categories of commodity
 * @throws UnsupportedEncodingException
 */
public String getItemCats() throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",0);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}
Program: 98987
Project: 98987
Buggy source:
/** 
 * to get the information of shop
 * @param sid
 * @throws UnsupportedEncodingException
 */
public String getShopInfo(int sid) throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",sid);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  return result;
}

Fixed version (ground truth):
/** 
 * to get the information of shop
 * @param sid
 * @throws UnsupportedEncodingException
 */
public String getShopInfo(int sid) throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",sid);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}
Program: 98988
Project: 98988
Buggy source:
public static void main(String[] args){
  FiftyNineSecondConfig fnc=new FiftyNineSecondConfig();
  try {
    fnc.init();
    FiftyNineSecondsService fnss=new FiftyNineSecondsService(fnc);
    System.out.println(fnss.getShopInfo(1004));
  }
 catch (  UnsupportedEncodingException e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  FiftyNineSecondConfig fnc=new FiftyNineSecondConfig();
  try {
    fnc.init();
    FiftyNineSecondsService fnss=new FiftyNineSecondsService(fnc);
    String xmlCats=fnss.getItemCats();
    List<Integer> cats=DBParserUtil.getAllCats(xmlCats);
    System.out.println(cats);
    for (    int i : cats) {
      fnc.init();
      System.out.println(fnss.getItemListByCats(i,1));
    }
  }
 catch (  UnsupportedEncodingException e1) {
    e1.printStackTrace();
  }
}
Program: 98989
Project: 98989
Buggy source:
/** 
 * to get the commodity list according to categories
 * @param category id
 * @throws UnsupportedEncodingException
 */
public String getItemListByCats(int cid,int pageNo) throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",cid);
  fnc.getMap().put("String_Node_Str",40);
  fnc.getMap().put("String_Node_Str",pageNo);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  return result;
}

Fixed version (ground truth):
/** 
 * to get the commodity list according to categories
 * @param category id
 * @throws UnsupportedEncodingException
 */
public String getItemListByCats(int cid,int pageNo) throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",cid);
  fnc.getMap().put("String_Node_Str",40);
  fnc.getMap().put("String_Node_Str",pageNo);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}
Program: 98990
Project: 98990
Buggy source:
public String getMalesRanking(){
  url.append("String_Node_Str");
  return YoubuyService.handleGet(YoubuyService.handleArguments(url,vc));
}

Fixed version (ground truth):
public String getMalesRanking(){
  url.append("String_Node_Str");
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,vc));
  url=new StringBuffer(url.substring(0,21));
  return result;
}
Program: 98991
Project: 98991
Buggy source:
public String getWeeklyranking(){
  url.append("String_Node_Str");
  return YoubuyService.handleGet(YoubuyService.handleArguments(url,vc));
}

Fixed version (ground truth):
public String getWeeklyranking(){
  url.append("String_Node_Str");
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,vc));
  url=new StringBuffer(url.substring(0,21));
  return result;
}
Program: 98992
Project: 98992
Buggy source:
public String getLadiesRanking(){
  url.append("String_Node_Str");
  return YoubuyService.handleGet(YoubuyService.handleArguments(url,vc));
}

Fixed version (ground truth):
public String getLadiesRanking(){
  url.append("String_Node_Str");
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,vc));
  url=new StringBuffer(url.substring(0,21));
  return result;
}
Program: 98993
Project: 98993
Buggy source:
/** 
 * to get the categories of commodity
 * @throws UnsupportedEncodingException
 */
public String getItemCats() throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",0);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}

Fixed version (ground truth):
/** 
 * to get the categories of commodity
 * @throws UnsupportedEncodingException
 */
public String getItemCats() throws UnsupportedEncodingException {
  fnc.init();
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",0);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}
Program: 98994
Project: 98994
Buggy source:
/** 
 * to get the information of shop
 * @param sid
 * @throws UnsupportedEncodingException
 */
public String getShopInfo(int sid) throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",sid);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}

Fixed version (ground truth):
/** 
 * to get the information of shop
 * @param sid
 * @throws UnsupportedEncodingException
 */
public String getShopInfo(int sid) throws UnsupportedEncodingException {
  fnc.init();
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",sid);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}
Program: 98995
Project: 98995
Buggy source:
public static void main(String[] args){
  FiftyNineSecondConfig fnc=new FiftyNineSecondConfig();
  try {
    fnc.init();
    FiftyNineSecondsService fnss=new FiftyNineSecondsService(fnc);
    String xmlCats=fnss.getItemCats();
    List<Integer> cats=DBParserUtil.getAllCats(xmlCats);
    System.out.println(cats);
    for (    int i : cats) {
      for (int n=1; n <= 99; n++) {
        fnc.init();
        System.out.println(fnss.getItemListByCats(i,n));
      }
    }
  }
 catch (  UnsupportedEncodingException e1) {
    e1.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  FiftyNineSecondConfig fnc=new FiftyNineSecondConfig();
  try {
    FiftyNineSecondsService fnss=new FiftyNineSecondsService(fnc);
    String xmlCats=fnss.getPromoCats();
    List<Integer> cats=DBParserUtil.getAllCats(xmlCats);
    System.out.println(cats);
  }
 catch (  UnsupportedEncodingException e1) {
    e1.printStackTrace();
  }
}
Program: 98996
Project: 98996
Buggy source:
/** 
 * to get the commodity list according to categories
 * @param category id
 * @throws UnsupportedEncodingException
 */
public String getItemListByCats(int cid,int pageNo) throws UnsupportedEncodingException {
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",cid);
  fnc.getMap().put("String_Node_Str",40);
  fnc.getMap().put("String_Node_Str",pageNo);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}

Fixed version (ground truth):
/** 
 * to get the commodity list according to categories
 * @param category id
 * @throws UnsupportedEncodingException
 */
public String getItemListByCats(int cid,int pageNo) throws UnsupportedEncodingException {
  fnc.init();
  fnc.setMethod("String_Node_Str");
  fnc.getMap().put("String_Node_Str",cid);
  fnc.getMap().put("String_Node_Str",40);
  fnc.getMap().put("String_Node_Str",pageNo);
  fnc.getMap().put("String_Node_Str","String_Node_Str");
  fnc.setSign();
  String result=YoubuyService.handleGet(YoubuyService.handleArguments(url,fnc));
  url=new StringBuffer("String_Node_Str");
  fnc.getMap().clear();
  return result;
}
Program: 98997
Project: 98997
Buggy source:
@Override public void start(){
  super.start();
  if (addr == CLIENT_ID) {
    getDataLocations(null);
  }
}

Fixed version (ground truth):
@Override public void start(){
  super.start();
  if (addr == CLIENT_ID) {
    getDataLocations(null);
  }
  pingServers();
}
Program: 98998
Project: 98998
Buggy source:
/** 
 * Tests if the given protocol is valid for a RIOPacket. Note that the current implementation of RIOPacket actually uses this to test validity of packets.
 * @param protocol The protocol to be checked
 * @return True if protocol is valid, else false
 */
public static boolean isRIOProtocolValid(int protocol){
  return protocol == RIOTEST_PKT || protocol == RPC_REQUEST_PKT || protocol == RPC_RESULT_PKT || protocol == PAXOS_PKT;
}

Fixed version (ground truth):
/** 
 * Tests if the given protocol is valid for a RIOPacket. Note that the current implementation of RIOPacket actually uses this to test validity of packets.
 * @param protocol The protocol to be checked
 * @return True if protocol is valid, else false
 */
public static boolean isRIOProtocolValid(int protocol){
  return protocol == RIOTEST_PKT || protocol == RPC_REQUEST_PKT || protocol == RPC_RESULT_PKT || protocol == PAXOS_PKT || protocol == TEST;
}
Program: 98999
Project: 98999
Buggy source:
private void handleDecisionMessage(int instNum,byte[] payload){
  PaxosState state=this.rounds.get(instNum);
  if (state == null) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    state=new PaxosState(instNum,payload,false,Arrays.asList(REPLICA_ADDRS));
    this.rounds.put(instNum,state);
  }
  if (state.executed) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    catchUpExecution();
    checkAndHandleGaps();
    return;
  }
  if (!state.decided) {
    state.decidedValue=payload;
    state.decided=true;
    logKnownCommands();
  }
  catchUpExecution();
  checkAndHandleGaps();
}

Fixed version (ground truth):
private void handleDecisionMessage(int instNum,byte[] payload){
  PaxosState state=this.rounds.get(instNum);
  if (state == null) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    state=new PaxosState(instNum,payload,false,Arrays.asList(REPLICA_ADDRS));
    this.rounds.put(instNum,state);
  }
  if (state.executed) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    catchUpExecution();
    checkAndHandleGaps();
    return;
  }
  if (!state.decided) {
    state.decidedValue=payload;
    state.decided=true;
    logKnownCommands();
    logKnownStates();
  }
  catchUpExecution();
  checkAndHandleGaps();
}
Program: 99000
Project: 99000
Buggy source:
public void updateFromStateLogString(String s){
  String[] parts=s.split(LOG_SEPERATOR,4);
  this.promisedPropNum=Integer.parseInt(parts[1]);
  this.acceptedPropNum=Integer.parseInt(parts[2]);
  this.acceptedValue=parts[3].equals("String_Node_Str") ? PaxosNode.noopMarker : Utility.stringToByteArray(parts[3]);
}

Fixed version (ground truth):
public void updateFromStateLogString(String s){
  String[] parts=s.split(LOG_SEPERATOR,4);
  this.promisedPropNum=Integer.parseInt(parts[1]);
  this.acceptedPropNum=Integer.parseInt(parts[2]);
}
Program: 99001
Project: 99001
Buggy source:
public void proposeCommand(List<Integer> addrs,Integer instNum,byte[] payload,Integer backoff){
  PaxosState state=this.rounds.get(instNum);
  if (!state.decided) {
    int propNum=this.rounds.get(instNum).propNum;
    for (    Integer nodeAddr : addrs) {
      PaxosPacket prepare=PaxosPacket.makePrepareMessage(instNum,propNum,payload);
      noteOutput("String_Node_Str" + instNum + "String_Node_Str"+ propNum+ "String_Node_Str"+ nodeAddr+ "String_Node_Str"+ (payload != null ? Utility.byteArrayToString(payload) : "String_Node_Str"));
      RIOSend(nodeAddr,Protocol.PAXOS_PKT,prepare.pack());
    }
    try {
      Method m=Callback.getMethod("String_Node_Str",this,new String[]{List.class.getName(),Integer.class.getName(),byte[].class.getName(),Integer.class.getName()});
      Callback retry=new Callback(m,this,new Object[]{addrs,instNum,payload,backoff * 2 + r.nextInt() % RANDOM_BACKOFF_MAX});
      addTimeout(retry,backoff);
    }
 catch (    Exception e) {
      noteError("String_Node_Str" + instNum + "String_Node_Str");
      e.printStackTrace();
      fail();
    }
  }
 else {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    retryPaxosCommand(state.participants,state.instNum,state.value);
  }
}

Fixed version (ground truth):
public void proposeCommand(List<Integer> addrs,Integer instNum,byte[] payload,Integer backoff){
  PaxosState state=this.rounds.get(instNum);
  if (!state.decided) {
    int propNum=this.rounds.get(instNum).propNum;
    for (    Integer nodeAddr : addrs) {
      PaxosPacket prepare=PaxosPacket.makePrepareMessage(instNum,propNum,payload);
      noteOutput("String_Node_Str" + instNum + "String_Node_Str"+ propNum+ "String_Node_Str"+ nodeAddr+ "String_Node_Str"+ (payload != null ? Utility.byteArrayToString(payload) : "String_Node_Str"));
      RIOSend(nodeAddr,Protocol.PAXOS_PKT,prepare.pack());
    }
    try {
      Method m=Callback.getMethod("String_Node_Str",this,new String[]{List.class.getName(),Integer.class.getName(),byte[].class.getName(),Integer.class.getName()});
      Callback retry=new Callback(m,this,new Object[]{addrs,instNum,payload,backoff * 2 + r.nextInt() % RANDOM_BACKOFF_MAX});
      addTimeout(retry,backoff);
    }
 catch (    Exception e) {
      noteError("String_Node_Str" + instNum + "String_Node_Str");
      e.printStackTrace();
      fail();
    }
  }
 else   if (!Arrays.equals(state.value,state.decidedValue)) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    retryPaxosCommand(state.participants,state.instNum,state.value);
  }
 else {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
  }
}
Program: 99002
Project: 99002
Buggy source:
public void retryPaxosCommand(List<Integer> addrs,Integer instNum,byte[] payload){
  proposeCommand(addrs,instNum,payload);
}

Fixed version (ground truth):
public void retryPaxosCommand(List<Integer> addrs,Integer instNum,byte[] payload){
  replicateCommand(addrs,payload);
}
Program: 99003
Project: 99003
Buggy source:
private void handleDecisionMessage(int instNum,byte[] payload){
  PaxosState state=this.rounds.get(instNum);
  if (state == null) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    state=new PaxosState(instNum,payload,false);
    this.rounds.put(instNum,state);
  }
  state.value=payload;
  state.decided=true;
  if (instNum == highestExecutedNum + 1) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    if (state.value != null) {
      handlePaxosCommand(state.instNum,state.value);
    }
 else {
      noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    }
    state.executed=true;
    this.highestExecutedNum=instNum;
  }
 else {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    int gapLength=instNum - this.highestExecutedNum - 1;
    for (int i=0; i < gapLength; i++) {
      List<Integer> addrs=Arrays.asList(REPLICA_ADDRS);
      learnCommand(addrs,highestExecutedNum + i);
    }
  }
  logKnownCommands();
}

Fixed version (ground truth):
private void handleDecisionMessage(int instNum,byte[] payload){
  PaxosState state=this.rounds.get(instNum);
  if (state == null) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    state=new PaxosState(instNum,payload,false);
    this.rounds.put(instNum,state);
  }
  state.decidedValue=payload;
  state.decided=true;
  if (instNum == highestExecutedNum + 1) {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    if (state.decidedValue != null) {
      handlePaxosCommand(state.instNum,state.decidedValue);
    }
 else {
      noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    }
    state.executed=true;
    this.highestExecutedNum=instNum;
  }
 else {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
    int gapLength=instNum - this.highestExecutedNum - 1;
    for (int i=0; i < gapLength; i++) {
      learnCommand(state.participants,highestExecutedNum + i);
    }
  }
  logKnownCommands();
}
Program: 99005
Project: 99005
Buggy source:
/** 
 * Set failure/recovery/delay/drop rates based on command line options, default == 0% 
 */
public static double getFailureRate(){
  return .1 / 100.0;
}

Fixed version (ground truth):
/** 
 * Set failure/recovery/delay/drop rates based on command line options, default == 0% 
 */
public static double getFailureRate(){
  return .6 / 100.0;
}
Program: 99006
Project: 99006
Buggy source:
public TxnPacket receiveTxnDecisionRequest(TxnPacket pkt){
  if (!participantTxns.containsKey(pkt.getID())) {
    return null;
  }
  TxnState txnState=participantTxns.get(pkt.getID());
  if (txnState != null) {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    if (txnState.status == TxnState.TxnStatus.ABORTED) {
      writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
      return TxnPacket.getAbortPacket(this,txnState.txnID,txnState.request);
    }
 else     if (txnState.status == TxnState.TxnStatus.COMMITTED) {
      writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
      return TxnPacket.getCommitPacket(this,txnState.txnID,txnState.request,txnState.args);
    }
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ txnState.status);
  }
 else {
    writeOutput("String_Node_Str" + pkt.getID() + "String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
public TxnPacket receiveTxnDecisionRequest(TxnPacket pkt){
  if (!participantTxns.containsKey(pkt.getID())) {
    return null;
  }
  TxnState txnState=participantTxns.get(pkt.getID());
  if (txnState != null) {
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
    if (txnState.status == TxnState.TxnStatus.ABORTED) {
      writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
      return TxnPacket.getAbortPacket(this,txnState.txnID,txnState.request);
    }
 else     if (txnState.status == TxnState.TxnStatus.COMMITTED) {
      writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
      return TxnPacket.getCommitPacket(this,txnState.txnID,txnState.request,txnState.args);
    }
 else     if (txnState.status == TxnState.TxnStatus.DONE) {
      if (txnState.wasCommitted) {
        writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
        return TxnPacket.getCommitPacket(this,txnState.txnID,txnState.request,txnState.args);
      }
 else {
        writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
        return TxnPacket.getAbortPacket(this,txnState.txnID,txnState.request);
      }
    }
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str"+ txnState.status);
  }
 else {
    writeOutput("String_Node_Str" + pkt.getID() + "String_Node_Str");
  }
  return null;
}
Program: 99008
Project: 99008
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.util.UUID.class,java.lang.String.class);
    handler.invoke(this,txnState.txnID,pkt.getPayload());
    txnLogger.logDone(txnState);
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
  }
 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());
  txnState.wasCommitted=true;
  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);
    writeOutput("String_Node_Str" + txnState.txnID + "String_Node_Str");
  }
 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: 99010
Project: 99010
Buggy source:
private void proposeCommand(List<Integer> addrs,int instNum,byte[] payload,int backoff){
  if (!this.rounds.get(instNum).decided) {
    int propNum=this.rounds.get(instNum).propNum;
    for (    Integer nodeAddr : addrs) {
      PaxosPacket prepare=PaxosPacket.makePrepareMessage(instNum,propNum,payload);
      noteOutput("String_Node_Str" + instNum + "String_Node_Str"+ propNum+ "String_Node_Str"+ nodeAddr+ "String_Node_Str"+ (payload != null ? Utility.byteArrayToString(payload) : "String_Node_Str"));
      RIOSend(nodeAddr,Protocol.PAXOS_PKT,prepare.pack());
    }
    try {
      Method m=Callback.getMethod("String_Node_Str",this,new String[]{List.class.getName(),Integer.class.getName(),byte[].class.getName(),Integer.class.getName()});
      Callback retry=new Callback(m,this,new Object[]{addrs,instNum,payload,backoff * 2 + r.nextInt() % RANDOM_BACKOFF_MAX});
      addTimeout(retry,backoff);
    }
 catch (    Exception e) {
      noteError("String_Node_Str" + instNum + "String_Node_Str");
      e.printStackTrace();
      fail();
    }
  }
 else {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void proposeCommand(List<Integer> addrs,Integer instNum,byte[] payload,Integer backoff){
  if (!this.rounds.get(instNum).decided) {
    int propNum=this.rounds.get(instNum).propNum;
    for (    Integer nodeAddr : addrs) {
      PaxosPacket prepare=PaxosPacket.makePrepareMessage(instNum,propNum,payload);
      noteOutput("String_Node_Str" + instNum + "String_Node_Str"+ propNum+ "String_Node_Str"+ nodeAddr+ "String_Node_Str"+ (payload != null ? Utility.byteArrayToString(payload) : "String_Node_Str"));
      RIOSend(nodeAddr,Protocol.PAXOS_PKT,prepare.pack());
    }
    try {
      Method m=Callback.getMethod("String_Node_Str",this,new String[]{List.class.getName(),Integer.class.getName(),byte[].class.getName(),Integer.class.getName()});
      Callback retry=new Callback(m,this,new Object[]{addrs,instNum,payload,backoff * 2 + r.nextInt() % RANDOM_BACKOFF_MAX});
      addTimeout(retry,backoff);
    }
 catch (    Exception e) {
      noteError("String_Node_Str" + instNum + "String_Node_Str");
      e.printStackTrace();
      fail();
    }
  }
 else {
    noteOutput("String_Node_Str" + instNum + "String_Node_Str");
  }
}
Program: 99011
Project: 99011
Buggy source:
@Override public void onReceive(Integer from,int protocol,byte[] msg){
  if (protocol == Protocol.DATA) {
    RIOLayer.RIODataReceive(from,msg);
  }
 else   if (protocol == Protocol.ACK) {
    RIOLayer.RIOAckReceive(from,msg);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Integer from,int protocol,byte[] msg){
  if (protocol == Protocol.DATA) {
    RIOLayer.RIODataReceive(from,msg);
  }
 else   if (protocol == Protocol.ACK) {
    RIOLayer.RIOAckReceive(from,msg);
  }
 else   if (protocol == Protocol.SYNC) {
    RIOLayer.RIOSyncReceive(from,msg);
  }
}
Program: 99012
Project: 99012
Buggy source:
/** 
 * Constructing a new RIO packet.
 * @param type The type of packet. Either SYN, ACK, FIN, or DATA
 * @param seqNum The sequence number of the packet
 * @param payload The payload of the packet.
 */
public RIOPacket(int protocol,int seqNum,byte[] payload) throws IllegalArgumentException {
  if (!Protocol.isRIOProtocolValid(protocol) || payload.length > MAX_PAYLOAD_SIZE) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.protocol=protocol;
  this.seqNum=seqNum;
  this.payload=payload;
}

Fixed version (ground truth):
/** 
 * Constructing a new RIO packet.
 * @param type The type of packet. Either SYN, ACK, FIN, or DATA
 * @param seqNum The sequence number of the packet
 * @param payload The payload of the packet.
 */
public RIOPacket(int protocol,int seqNum,int sessionId,byte[] payload) throws IllegalArgumentException {
  if (!Protocol.isRIOProtocolValid(protocol) || payload.length > MAX_PAYLOAD_SIZE) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.protocol=protocol;
  this.seqNum=seqNum;
  this.sessionId=sessionId;
  this.payload=payload;
}
Program: 99013
Project: 99013
Buggy source:
/** 
 * Convert the RIOPacket packet object into a byte array for sending over the wire. Format: protocol = 1 byte sequence number = 4 bytes payload <= MAX_PAYLOAD_SIZE bytes
 * @return A byte[] for transporting over the wire. Null if failed to pack for some reason
 */
public byte[] pack(){
  try {
    ByteArrayOutputStream byteStream=new ByteArrayOutputStream();
    DataOutputStream out=new DataOutputStream(byteStream);
    out.writeByte(protocol);
    out.writeInt(seqNum);
    out.write(payload,0,payload.length);
    out.flush();
    out.close();
    return byteStream.toByteArray();
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Convert the RIOPacket packet object into a byte array for sending over the wire. Format: protocol = 1 byte sequence number = 4 bytes payload <= MAX_PAYLOAD_SIZE bytes
 * @return A byte[] for transporting over the wire. Null if failed to pack for some reason
 */
public byte[] pack(){
  try {
    ByteArrayOutputStream byteStream=new ByteArrayOutputStream();
    DataOutputStream out=new DataOutputStream(byteStream);
    out.writeByte(protocol);
    out.writeInt(seqNum);
    out.writeInt(sessionId);
    out.write(payload,0,payload.length);
    out.flush();
    out.close();
    return byteStream.toByteArray();
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 99014
Project: 99014
Buggy source:
@Override public void onRIOReceive(Integer from,int protocol,byte[] msg){
  if (protocol != Protocol.RIOTEST_PKT) {
    logError("String_Node_Str" + protocol);
    return;
  }
  Integer i=Integer.parseInt(Utility.byteArrayToString(msg));
  Integer receivedNum=receivedNums.get(from);
  if (i == receivedNum + 1) {
    correctReceive(from,i);
  }
 else {
    failure(from,i);
  }
}

Fixed version (ground truth):
@Override public void onRIOReceive(Integer from,int protocol,byte[] msg){
  if (protocol != Protocol.RIOTEST_PKT) {
    logError("String_Node_Str" + protocol);
    return;
  }
  Integer i=Integer.parseInt(Utility.byteArrayToString(msg));
  Integer receivedNum=receivedNums.get(from);
  if (i <= receivedNum) {
    failure(from,i);
  }
}
Program: 99015
Project: 99015
Buggy source:
/** 
 * Called when we have received a packet from the underlying layer out of order.
 * @param from The address of the sender
 * @param i The number of the packet received.
 */
public void failure(int from,int i){
  logError("String_Node_Str" + i + "String_Node_Str"+ receivedNums.get(from)+ "String_Node_Str"+ from);
  receivedNums.put(from,i);
  failed=true;
  fail();
}

Fixed version (ground truth):
/** 
 * Called when we have received a packet from the underlying layer out of order.
 * @param from The address of the sender
 * @param i The number of the packet received.
 */
public void failure(int from,int i){
  logError("String_Node_Str" + i + "String_Node_Str"+ (receivedNums.get(from) + 1)+ "String_Node_Str"+ from);
  receivedNums.put(from,i);
  failed=true;
  fail();
}
Program: 99016
Project: 99016
Buggy source:
public void acceptedFriendSuccess(String username){
  doingWork=false;
  printOutput("String_Node_Str" + username + "String_Node_Str");
}

Fixed version (ground truth):
public void acceptedFriendSuccess(Integer from,byte[] results,String username){
  doingWork=false;
  printOutput("String_Node_Str" + username + "String_Node_Str");
}
Program: 99017
Project: 99017
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,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)) {
    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: 99018
Project: 99018
Buggy source:
public void getRequestList(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[] goodParamTypes={"String_Node_Str","String_Node_Str"};
  Method continueMethod=Callback.getMethod("String_Node_Str",this,goodParamTypes);
  Object[] goodParams={null,username};
  Callback continuationCallback=new Callback(continueMethod,this,goodParams);
  String filename=REQUESTS_PREFIX + loggedInUser;
  get(userDataLocations.get(loggedInUser),filename,continuationCallback,tryAgainCallback);
}

Fixed version (ground truth):
public void getRequestList(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[] 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;
  get(userDataLocations.get(loggedInUser),filename,continuationCallback,tryAgainCallback);
}