nus-yam/ex-repair huggingface dataset:
Program: 19084
Project: 19084
Buggy source:
public boolean runCommand(){
  if (args.length < 1) {
    return false;
  }
  String name=this.getPlayerName(args[0]);
  if (this.isPlayerOnline(name)) {
    String reason=MCBouncerUtil.getReasonOrDefault(args,MCBouncerUtil.implodeWithoutFirstElement(args,"String_Node_Str"),MCBConfiguration.getDefaultKickMessage());
    this.sendMessageToMods(ChatColor.RED + name + "String_Node_Str"+ reason);
    MCBouncer.log.info(this.getSenderName() + "String_Node_Str" + name+ "String_Node_Str"+ reason);
    this.kickPlayer(name,"String_Node_Str" + reason);
    return true;
  }
 else {
    this.sendMessageToSender(ChatColor.RED + "String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
public boolean runCommand(){
  if (args.length < 1) {
    return false;
  }
  String name=this.getPlayerName(args[0]);
  if (name != null && this.isPlayerOnline(name)) {
    String reason=MCBouncerUtil.getReasonOrDefault(args,MCBouncerUtil.implodeWithoutFirstElement(args,"String_Node_Str"),MCBConfiguration.getDefaultKickMessage());
    this.sendMessageToMods(ChatColor.RED + name + "String_Node_Str"+ reason);
    MCBouncer.log.info(this.getSenderName() + "String_Node_Str" + name+ "String_Node_Str"+ reason);
    this.kickPlayer(name,"String_Node_Str" + reason);
    return true;
  }
 else {
    this.sendMessageToSender(ChatColor.RED + "String_Node_Str");
  }
  return true;
}
Program: 19085
Project: 19085
Buggy source:
public String getPlayerName(String name){
  if (parent.getServer().getPlayer(name) != null) {
    return parent.getServer().getPlayer(name).getName();
  }
  return name;
}

Fixed version (ground truth):
public String getPlayerName(String name){
  if (parent.getServer().getPlayer(name) != null) {
    return parent.getServer().getPlayer(name).getName();
  }
  return null;
}
Program: 19086
Project: 19086
Buggy source:
public String getPlayerNameFromArgs(String arg){
  Player player=parent.getServer().getPlayer(arg);
  if (player != null) {
    return player.getName();
  }
 else {
    return arg;
  }
}

Fixed version (ground truth):
public String getPlayerNameFromArgs(String arg){
  Player player=parent.getServer().getPlayer(arg);
  if (player != null) {
    return player.getName();
  }
 else {
    return null;
  }
}
Program: 19087
Project: 19087
Buggy source:
private static String getUrl(String site){
  MCBouncer.log.info("String_Node_Str" + site);
  try {
    URL url=new URL(site.toString());
    BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
    String inputLine, result="String_Node_Str";
    while ((inputLine=in.readLine()) != null) {
      result=result.concat(inputLine);
    }
    in.close();
    return result;
  }
 catch (  IOException e) {
    e.printStackTrace();
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
private static String getUrl(String site){
  MCBouncer.log.debug("String_Node_Str" + site);
  try {
    URL url=new URL(site.toString());
    BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
    String inputLine, result="String_Node_Str";
    while ((inputLine=in.readLine()) != null) {
      result=result.concat(inputLine);
    }
    in.close();
    return result;
  }
 catch (  IOException e) {
    e.printStackTrace();
    return "String_Node_Str";
  }
}
Program: 19088
Project: 19088
Buggy source:
@Override public void run(){
  parent.isBannedLogic(player);
  player.getServer().broadcastMessage(message);
}

Fixed version (ground truth):
@Override public void run(){
  parent.isBannedLogic(player,message);
}
Program: 19089
Project: 19089
Buggy source:
private void isBannedLogic(Player player){
  String playerName=player.getName();
  String IP=player.getAddress().getAddress().getHostAddress();
  MCBouncerUtil.updateUser(playerName,IP);
  if (MCBouncerUtil.isBanned(playerName)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getBanReason(playerName));
    return;
  }
  if (MCBouncerUtil.isIPBanned(IP)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getIPBanReason(IP));
    return;
  }
  int numBans=MCBouncerUtil.getBanCount(playerName,IP);
  int numNotes=MCBouncerUtil.getNoteCount(playerName);
  if (numBans > 0 || numNotes > 0) {
    String response=playerName + "String_Node_Str";
    if (numNotes == 0) {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str");
    }
 else     if (numBans == 0) {
      response+=numNotes + "String_Node_Str" + MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
 else {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str")+ "String_Node_Str"+ numNotes+ "String_Node_Str"+ MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
    parent.messageMods(ChatColor.GREEN + response);
  }
}

Fixed version (ground truth):
private void isBannedLogic(Player player,String message){
  String playerName=player.getName();
  String IP=player.getAddress().getAddress().getHostAddress();
  MCBouncerUtil.updateUser(playerName,IP);
  if (MCBouncerUtil.isBanned(playerName)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getBanReason(playerName));
    return;
  }
  if (MCBouncerUtil.isIPBanned(IP)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getIPBanReason(IP));
    return;
  }
  int numBans=MCBouncerUtil.getBanCount(playerName,IP);
  int numNotes=MCBouncerUtil.getNoteCount(playerName);
  if (numBans > 0 || numNotes > 0) {
    String response=playerName + "String_Node_Str";
    if (numNotes == 0) {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str");
    }
 else     if (numBans == 0) {
      response+=numNotes + "String_Node_Str" + MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
 else {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str")+ "String_Node_Str"+ numNotes+ "String_Node_Str"+ MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
    parent.messageMods(ChatColor.GREEN + response);
  }
 else {
    player.getServer().broadcastMessage(message);
  }
}
Program: 19090
Project: 19090
Buggy source:
@Override public void run(){
  parent.isBannedLogic(player);
  player.getServer().broadcastMessage(message);
}

Fixed version (ground truth):
@Override public void run(){
  parent.isBannedLogic(player,message);
}
Program: 19091
Project: 19091
Buggy source:
private void isBannedLogic(Player player){
  String playerName=player.getName();
  String IP=player.getAddress().getAddress().getHostAddress();
  MCBouncerUtil.updateUser(playerName,IP);
  if (MCBouncerUtil.isBanned(playerName)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getBanReason(playerName));
    return;
  }
  if (MCBouncerUtil.isIPBanned(IP)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getIPBanReason(IP));
    return;
  }
  int numBans=MCBouncerUtil.getBanCount(playerName,IP);
  int numNotes=MCBouncerUtil.getNoteCount(playerName);
  if (numBans > 0 || numNotes > 0) {
    String response=playerName + "String_Node_Str";
    if (numNotes == 0) {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str");
    }
 else     if (numBans == 0) {
      response+=numNotes + "String_Node_Str" + MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
 else {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str")+ "String_Node_Str"+ numNotes+ "String_Node_Str"+ MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
    parent.messageMods(ChatColor.GREEN + response);
  }
}

Fixed version (ground truth):
private void isBannedLogic(Player player,String message){
  String playerName=player.getName();
  String IP=player.getAddress().getAddress().getHostAddress();
  MCBouncerUtil.updateUser(playerName,IP);
  if (MCBouncerUtil.isBanned(playerName)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getBanReason(playerName));
    return;
  }
  if (MCBouncerUtil.isIPBanned(IP)) {
    player.kickPlayer("String_Node_Str" + MCBouncerUtil.getIPBanReason(IP));
    return;
  }
  int numBans=MCBouncerUtil.getBanCount(playerName,IP);
  int numNotes=MCBouncerUtil.getNoteCount(playerName);
  if (numBans > 0 || numNotes > 0) {
    String response=playerName + "String_Node_Str";
    if (numNotes == 0) {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str");
    }
 else     if (numBans == 0) {
      response+=numNotes + "String_Node_Str" + MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
 else {
      response+=numBans + "String_Node_Str" + MCBouncerUtil.plural(numBans,"String_Node_Str","String_Node_Str")+ "String_Node_Str"+ numNotes+ "String_Node_Str"+ MCBouncerUtil.plural(numNotes,"String_Node_Str","String_Node_Str");
    }
    parent.messageMods(ChatColor.GREEN + response);
  }
 else {
    player.getServer().broadcastMessage(message);
  }
}
Program: 19092
Project: 19092
Buggy source:
public PlayerJoinThread(Player player,MCBPlayerListener parent,String message){
  this.player=player;
  this.parent=parent;
}

Fixed version (ground truth):
public PlayerJoinThread(Player player,MCBPlayerListener parent,String message){
  this.player=player;
  this.parent=parent;
  this.message=message;
}
Program: 19093
Project: 19093
Buggy source:
public PlayerJoinThread(Player player,MCBPlayerListener parent,String message){
  this.player=player;
  this.parent=parent;
}

Fixed version (ground truth):
public PlayerJoinThread(Player player,MCBPlayerListener parent,String message){
  this.player=player;
  this.parent=parent;
  this.message=message;
}
Program: 19095
Project: 19095
Buggy source:
private static JSONObject parseJson(String jsonin){
  JSONObject json=null;
  try {
    json=(JSONObject)new JSONParser().parse(jsonin);
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  return json;
}

Fixed version (ground truth):
public static JSONObject parseJson(String jsonin){
  JSONObject json=null;
  try {
    json=(JSONObject)new JSONParser().parse(jsonin);
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  return json;
}
Program: 19096
Project: 19096
Buggy source:
public static boolean removeNote(int noteid,String key){
  JSONObject result=(MCBouncerAPI.parseJson(MCBouncerAPI.getUrl("String_Node_Str" + key + "String_Node_Str"+ noteid)));
  if ((Boolean)result.get("String_Node_Str"))   return true;
  MCBouncerAPI.setError((String)result.get("String_Node_Str"));
  return false;
}

Fixed version (ground truth):
public static boolean removeNote(int noteid,String key){
  JSONObject result=(MCBouncerAPI.parseJson(MCBouncerAPI.getUrl("String_Node_Str" + key + "String_Node_Str"+ noteid)));
  if ((Boolean)result.get("String_Node_Str")) {
    return true;
  }
  MCBouncerAPI.setError((String)result.get("String_Node_Str"));
  return false;
}
Program: 19097
Project: 19097
Buggy source:
private static void setSettings(){
  debugMode=config.getBoolean("String_Node_Str",debugMode);
  apiKey=config.getString("String_Node_Str",apiKey);
  numBansDisallow=config.getInt("String_Node_Str",numBansDisallow);
  showBanMessages=config.getBoolean("String_Node_Str",showBanMessages);
  defaultReason=config.getString("String_Node_Str","String_Node_Str");
  defaultKickMessage=config.getString("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private static void setSettings(){
  debugMode=config.getBoolean("String_Node_Str",debugMode);
  apiKey=config.getString("String_Node_Str",apiKey);
  numBansDisallow=config.getInt("String_Node_Str",numBansDisallow);
  showBanMessages=config.getBoolean("String_Node_Str",showBanMessages);
  defaultReason=config.getString("String_Node_Str","String_Node_Str");
  defaultKickMessage=config.getString("String_Node_Str","String_Node_Str");
  mcBansKey=config.getString("String_Node_Str","String_Node_Str");
}
Program: 19098
Project: 19098
Buggy source:
public static void appropriateNotify(String string){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public static void appropriateNotify(String string){
  return;
}
Program: 19100
Project: 19100
Buggy source:
private static JSONObject parseJson(String jsonin){
  JSONObject json=null;
  try {
    json=(JSONObject)new JSONParser().parse(jsonin);
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  return json;
}

Fixed version (ground truth):
public static JSONObject parseJson(String jsonin){
  JSONObject json=null;
  try {
    json=(JSONObject)new JSONParser().parse(jsonin);
  }
 catch (  ParseException ex) {
    ex.printStackTrace();
  }
  return json;
}
Program: 19101
Project: 19101
Buggy source:
public static boolean removeNote(int noteid,String key){
  JSONObject result=(MCBouncerAPI.parseJson(MCBouncerAPI.getUrl("String_Node_Str" + key + "String_Node_Str"+ noteid)));
  if ((Boolean)result.get("String_Node_Str"))   return true;
  MCBouncerAPI.setError((String)result.get("String_Node_Str"));
  return false;
}

Fixed version (ground truth):
public static boolean removeNote(int noteid,String key){
  JSONObject result=(MCBouncerAPI.parseJson(MCBouncerAPI.getUrl("String_Node_Str" + key + "String_Node_Str"+ noteid)));
  if ((Boolean)result.get("String_Node_Str")) {
    return true;
  }
  MCBouncerAPI.setError((String)result.get("String_Node_Str"));
  return false;
}
Program: 19102
Project: 19102
Buggy source:
private static void setSettings(){
  debugMode=config.getBoolean("String_Node_Str",debugMode);
  apiKey=config.getString("String_Node_Str",apiKey);
  numBansDisallow=config.getInt("String_Node_Str",numBansDisallow);
  showBanMessages=config.getBoolean("String_Node_Str",showBanMessages);
  defaultReason=config.getString("String_Node_Str","String_Node_Str");
  defaultKickMessage=config.getString("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private static void setSettings(){
  debugMode=config.getBoolean("String_Node_Str",debugMode);
  apiKey=config.getString("String_Node_Str",apiKey);
  numBansDisallow=config.getInt("String_Node_Str",numBansDisallow);
  showBanMessages=config.getBoolean("String_Node_Str",showBanMessages);
  defaultReason=config.getString("String_Node_Str","String_Node_Str");
  defaultKickMessage=config.getString("String_Node_Str","String_Node_Str");
  mcBansKey=config.getString("String_Node_Str","String_Node_Str");
}
Program: 19103
Project: 19103
Buggy source:
public static void appropriateNotify(String string){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public static void appropriateNotify(String string){
  return;
}
Program: 19104
Project: 19104
Buggy source:
@Override public List<IPoint<Float>> computeCentroids(List<ICPoint<Float>> points){
  Logger.logTrace(CLAZZ,"String_Node_Str" + points.size() + "String_Node_Str");
  StopWatch sw=new StopWatch("String_Node_Str","String_Node_Str");
  sw.start();
  HashMap<IPoint<Float>,List<ICPoint<Float>>> clusters=new HashMap<IPoint<Float>,List<ICPoint<Float>>>();
  for (  ICPoint<Float> p : points) {
    if (!clusters.containsKey(p.getCentroid())) {
      clusters.put(p.getCentroid(),new LinkedList<ICPoint<Float>>());
    }
    clusters.get(p.getCentroid()).add(p);
  }
  IPoint<Float> newCentroid=null;
  List<IPoint<Float>> newCentroids=new ArrayList<IPoint<Float>>(this.k);
  for (  IPoint<Float> centroid : clusters.keySet()) {
    newCentroid=this.computeCentroid(clusters.get(centroid));
    newCentroids.add(newCentroid);
  }
  sw.stop();
  Logger.logDebug(CLAZZ,sw.getTimeString());
  return newCentroids;
}

Fixed version (ground truth):
@Override public List<IPoint<Float>> computeCentroids(List<ICPoint<Float>> points){
  Logger.logTrace(CLAZZ,"String_Node_Str" + points.size() + "String_Node_Str");
  StopWatch sw=new StopWatch("String_Node_Str","String_Node_Str");
  sw.start();
  HashMap<IPoint<Float>,List<ICPoint<Float>>> clusters=new HashMap<IPoint<Float>,List<ICPoint<Float>>>();
  for (  ICPoint<Float> p : points) {
    if (!clusters.containsKey(p.getCentroid())) {
      clusters.put(p.getCentroid(),new LinkedList<ICPoint<Float>>());
    }
    clusters.get(p.getCentroid()).add(p);
  }
  Logger.logDebug(CLAZZ,"String_Node_Str" + clusters.size());
  IPoint<Float> newCentroid=null;
  List<IPoint<Float>> newCentroids=new ArrayList<IPoint<Float>>(this.k);
  for (  IPoint<Float> centroid : clusters.keySet()) {
    newCentroid=this.computeCentroid(clusters.get(centroid));
    newCentroids.add(newCentroid);
  }
  sw.stop();
  Logger.logDebug(CLAZZ,sw.getTimeString());
  return newCentroids;
}
Program: 19105
Project: 19105
Buggy source:
@Override public List<IPoint<Float>> computeCentroids(List<ICPoint<Float>> points){
  Logger.logTrace(CLAZZ,"String_Node_Str" + points.size() + "String_Node_Str");
  StopWatch sw=new StopWatch("String_Node_Str","String_Node_Str");
  sw.start();
  HashMap<IPoint<Float>,List<ICPoint<Float>>> clusters=new HashMap<IPoint<Float>,List<ICPoint<Float>>>();
  for (  ICPoint<Float> p : points) {
    if (!clusters.containsKey(p.getCentroid())) {
      clusters.put(p.getCentroid(),new LinkedList<ICPoint<Float>>());
    }
    clusters.get(p.getCentroid()).add(p);
  }
  IPoint<Float> newCentroid=null;
  List<IPoint<Float>> newCentroids=new ArrayList<IPoint<Float>>(this.k);
  for (  IPoint<Float> centroid : clusters.keySet()) {
    newCentroid=this.computeCentroid(clusters.get(centroid));
    newCentroids.add(newCentroid);
  }
  sw.stop();
  Logger.logDebug(CLAZZ,sw.getTimeString());
  return newCentroids;
}

Fixed version (ground truth):
@Override public List<IPoint<Float>> computeCentroids(List<ICPoint<Float>> points){
  Logger.logTrace(CLAZZ,"String_Node_Str" + points.size() + "String_Node_Str");
  StopWatch sw=new StopWatch("String_Node_Str","String_Node_Str");
  sw.start();
  HashMap<IPoint<Float>,List<ICPoint<Float>>> clusters=new HashMap<IPoint<Float>,List<ICPoint<Float>>>();
  for (  ICPoint<Float> p : points) {
    if (!clusters.containsKey(p.getCentroid())) {
      clusters.put(p.getCentroid(),new LinkedList<ICPoint<Float>>());
    }
    clusters.get(p.getCentroid()).add(p);
  }
  Logger.logDebug(CLAZZ,"String_Node_Str" + clusters.size());
  IPoint<Float> newCentroid=null;
  List<IPoint<Float>> newCentroids=new ArrayList<IPoint<Float>>(this.k);
  for (  IPoint<Float> centroid : clusters.keySet()) {
    newCentroid=this.computeCentroid(clusters.get(centroid));
    newCentroids.add(newCentroid);
  }
  sw.stop();
  Logger.logDebug(CLAZZ,sw.getTimeString());
  return newCentroids;
}
Program: 19106
Project: 19106
Buggy source:
public synchronized void write(PointWritable key,PointWritable value) throws IOException {
  String s;
  if (key != null) {
    s=Points.createString(key);
    out.write(s.getBytes(utf8));
  }
  if (key != null && value != null)   out.write(keyValueSeparator);
  if (value != null) {
    s=Points.createString(key);
    out.write(s.getBytes(utf8));
  }
  out.write(newline);
}

Fixed version (ground truth):
public synchronized void write(PointWritable key,PointWritable value) throws IOException {
  String s;
  if (key != null) {
    s=Points.createString(key);
    out.write(s.getBytes(utf8));
  }
  if (key != null && value != null)   out.write(keyValueSeparator);
  if (value != null) {
    s=Points.createString(value);
    out.write(s.getBytes(utf8));
  }
  out.write(newline);
}
Program: 19108
Project: 19108
Buggy source:
public void addNewGameListener(NewGameListener newGamelistener){
  newGamelisteners.add(newGamelistener);
}

Fixed version (ground truth):
public void addNewGameListener(NewGameListener newGamelistener){
  newGamelisteners.add(newGamelistener);
  uiTexts.updateNewGameListeners(newGamelisteners.size());
}
Program: 19109
Project: 19109
Buggy source:
private void newGame(){
  ArrayList<NewGameListener> listenersToRemove=new ArrayList<NewGameListener>();
  for (  NewGameListener listener : new ArrayList<NewGameListener>(newGamelisteners)) {
    boolean remove=listener.onNewGame();
    if (remove) {
      listenersToRemove.add(listener);
    }
  }
  newGamelisteners.removeAll(listenersToRemove);
  listenersToRemove.clear();
  paddle.resetPosition();
  score=0;
  uiTexts.resetAll();
  if (piece != null) {
    piece.destroy();
  }
  piece=pieceFactory.newRandomPiece();
  for (  Ball ball : balls) {
    entityEngine.remove(ball);
  }
  balls.clear();
  uiTexts.updateNumberOfBalls(balls.size());
  wall.fillRandomly(5);
  createBallOnPaddle();
}

Fixed version (ground truth):
private void newGame(){
  ArrayList<NewGameListener> listenersToRemove=new ArrayList<NewGameListener>();
  for (  NewGameListener listener : new ArrayList<NewGameListener>(newGamelisteners)) {
    boolean remove=listener.onNewGame();
    if (remove) {
      listenersToRemove.add(listener);
    }
  }
  newGamelisteners.removeAll(listenersToRemove);
  uiTexts.updateNewGameListeners(newGamelisteners.size());
  listenersToRemove.clear();
  paddle.resetPosition();
  score=0;
  uiTexts.resetAll();
  if (piece != null) {
    piece.destroy();
  }
  piece=pieceFactory.newRandomPiece();
  for (  Ball ball : balls) {
    entityEngine.remove(ball);
  }
  balls.clear();
  uiTexts.updateNumberOfBalls(balls.size());
  wall.fillRandomly(5);
  createBallOnPaddle();
}
Program: 19110
Project: 19110
Buggy source:
public void removeNewGameListener(NewGameListener newGamelistener){
  newGamelisteners.remove(newGamelistener);
}

Fixed version (ground truth):
public void removeNewGameListener(NewGameListener newGamelistener){
  newGamelisteners.remove(newGamelistener);
  uiTexts.updateNewGameListeners(newGamelisteners.size());
}
Program: 19111
Project: 19111
Buggy source:
public void mayRedrawTexts(){
  if (textDataChanged) {
    textDataChanged=false;
    Canvas canvas=textLayer.canvas();
    canvas.clear();
    canvas.drawText("String_Node_Str" + score,550,50);
    canvas.drawText("String_Node_Str" + numberOfBalls,550,70);
    canvas.drawText("String_Node_Str" + frameRate,550,90);
  }
}

Fixed version (ground truth):
public void mayRedrawTexts(){
  if (textDataChanged) {
    textDataChanged=false;
    Canvas canvas=textLayer.canvas();
    canvas.clear();
    canvas.drawText("String_Node_Str" + score,550,60);
    canvas.drawText("String_Node_Str" + numberOfBalls,550,80);
    canvas.drawText("String_Node_Str" + frameRate,550,100);
    canvas.drawText("String_Node_Str" + newGameListeners,550,120);
  }
}
Program: 19112
Project: 19112
Buggy source:
@Override public void contact(PhysicsEntity other){
  listener.hit();
}

Fixed version (ground truth):
@Override public void contact(PhysicsEntity other){
  if (other instanceof Ball) {
    listener.hit();
  }
}
Program: 19113
Project: 19113
Buggy source:
@Override protected final void outOfGame(){
  activate();
}

Fixed version (ground truth):
@Override protected final void outOfGame(){
}
Program: 19114
Project: 19114
Buggy source:
@Override protected final void touchedPaddle(){
}

Fixed version (ground truth):
@Override protected final void touchedPaddle(){
  activate();
}
Program: 19115
Project: 19115
Buggy source:
public void dropDown(){
  int newY=y;
  boolean free=true;
  do {
    newY=newY + 1;
    for (    BrickHolder brickHolder : bricks) {
      if (!wall.isFreeOrUp(x + brickHolder.getX(),newY + brickHolder.getY())) {
        free=false;
        break;
      }
    }
  }
 while (free);
  newY=newY - 1;
  if (newY != y) {
    moveTo(x,newY - 1);
  }
  freeze();
}

Fixed version (ground truth):
public void dropDown(){
  int newY=y;
  boolean free=true;
  do {
    newY=newY + 1;
    for (    BrickHolder brickHolder : bricks) {
      if (!wall.isFreeOrUp(x + brickHolder.getX(),newY + brickHolder.getY())) {
        free=false;
        break;
      }
    }
  }
 while (free);
  newY=newY - 1;
  if (newY != y) {
    moveTo(x,newY);
  }
  freeze();
}
Program: 19116
Project: 19116
Buggy source:
public static void update(){
  double currentTime=currentTime();
  for (  Timer timer : timers) {
    if (currentTime > timer.nextExecution) {
      if (timer.periodMillis > 0) {
        timer.nextExecution=currentTime() + timer.periodMillis;
      }
 else {
        timer.cancel();
      }
      timer.run();
    }
  }
}

Fixed version (ground truth):
public static void update(){
  double currentTime=currentTime();
  for (  Timer timer : new ArrayList<Timer>(timers)) {
    if (currentTime > timer.nextExecution) {
      if (timer.periodMillis > 0) {
        timer.nextExecution=currentTime() + timer.periodMillis;
      }
 else {
        timer.cancel();
      }
      timer.run();
    }
  }
}
Program: 19117
Project: 19117
Buggy source:
public boolean isFreeOrUp(int x,int y){
  if (x < 0 || x >= Constants.WALL_WIDTH || y > Constants.WALL_HEIGHT) {
    return false;
  }
  if (y < 0) {
    return true;
  }
  return isFreeUnchecked(x,y);
}

Fixed version (ground truth):
public boolean isFreeOrUp(int x,int y){
  if (x < 0 || x >= Constants.WALL_WIDTH || y >= Constants.WALL_HEIGHT) {
    return false;
  }
  if (y < 0) {
    return true;
  }
  return isFreeUnchecked(x,y);
}
Program: 19118
Project: 19118
Buggy source:
private boolean isFree(int x,int y){
  if (x < 0 || x >= Constants.WALL_WIDTH || y < 0 || y > Constants.WALL_HEIGHT) {
    return false;
  }
  return isFreeUnchecked(x,y);
}

Fixed version (ground truth):
private boolean isFree(int x,int y){
  if (x < 0 || x >= Constants.WALL_WIDTH || y < 0 || y >= Constants.WALL_HEIGHT) {
    return false;
  }
  return isFreeUnchecked(x,y);
}
Program: 19120
Project: 19120
Buggy source:
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState){
  return new MaterialDialog.Builder(getActivity()).content(R.string.progress_import_geocache).negativeText(R.string.button_cancel).progress(true,0).build();
}

Fixed version (ground truth):
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState){
  return new MaterialDialog.Builder(getActivity()).content(R.string.progress_download_geocache).negativeText(R.string.button_cancel).progress(true,0).build();
}
Program: 19121
Project: 19121
Buggy source:
private OAuth10aService createOAuthService(){
  ServiceBuilder serviceBuilder=new ServiceBuilder().apiKey(BuildConfig.GEOCACHING_API_KEY).apiSecret(BuildConfig.GEOCACHING_API_SECRET).callback(AppConstants.OAUTH_CALLBACK_URL).httpClient(new OkHttpHttpClient(GeocachingApiFactory.getOkHttpClient())).debug();
  if (BuildConfig.GEOCACHING_API_STAGING) {
    return serviceBuilder.build(new GeocachingOAuthProvider.Staging());
  }
 else {
    return serviceBuilder.build(new GeocachingOAuthProvider());
  }
}

Fixed version (ground truth):
private OAuth10aService createOAuthService(){
  ServiceBuilder serviceBuilder=new ServiceBuilder(BuildConfig.GEOCACHING_API_KEY).apiSecret(BuildConfig.GEOCACHING_API_SECRET).callback(AppConstants.OAUTH_CALLBACK_URL).httpClient(new OkHttpHttpClient(GeocachingApiFactory.getOkHttpClient())).debug();
  if (BuildConfig.GEOCACHING_API_STAGING) {
    return serviceBuilder.build(new GeocachingOAuthProvider.Staging());
  }
 else {
    return serviceBuilder.build(new GeocachingOAuthProvider());
  }
}
Program: 19122
Project: 19122
Buggy source:
public IntentBuilder setMessage(String message,Object... params){
  this.message=HtmlUtil.fromHtml(String.format(message,params));
  return this;
}

Fixed version (ground truth):
public IntentBuilder setMessage(CharSequence message,Object... params){
  this.message=SpanFormatter.format(message,params);
  return this;
}
Program: 19125
Project: 19125
Buggy source:
protected CharSequence preparePreferenceSummary(CharSequence value,int resId){
  String summary="String_Node_Str";
  if (resId != 0)   summary=getString(resId);
  if (value != null && value.length() > 0)   return HtmlUtil.fromHtml("String_Node_Str" + value.toString() + "String_Node_Str"+ StringUtils.defaultString(summary));
  return HtmlUtil.fromHtml(StringUtils.defaultString(summary));
}

Fixed version (ground truth):
protected CharSequence preparePreferenceSummary(CharSequence value,int resId){
  CharSequence summary=null;
  if (resId != 0)   summary=getString(resId);
  if (value != null && value.length() > 0)   return SpanFormatter.format("String_Node_Str",stylizedValue(value),StringUtils.defaultIfEmpty(summary,"String_Node_Str"));
  return StringUtils.defaultIfEmpty(summary,"String_Node_Str");
}
Program: 19126
Project: 19126
Buggy source:
private CharSequence prepareAccountSummary(CharSequence value){
  String summary=getString(R.string.pref_account_logout_summary);
  return HtmlUtil.fromHtml(String.format(summary,"String_Node_Str" + value.toString() + "String_Node_Str"));
}

Fixed version (ground truth):
private CharSequence prepareAccountSummary(CharSequence value){
  return ResourcesUtil.getText(getActivity(),R.string.pref_account_logout_summary,stylizedValue(value));
}
Program: 19127
Project: 19127
Buggy source:
/** 
 * Returns formatted text from string resources
 * @param context application context
 * @param id string resource id
 * @param args arguments for String.format(...)
 * @return formatted SpannedString
 */
public static CharSequence getText(@NonNull Context context,@StringRes int id,Object... args){
  return HtmlUtil.fromHtml(getHtmlString(context,id,args));
}

Fixed version (ground truth):
/** 
 * Returns formatted text from string resources
 * @param context application context
 * @param id string resource id
 * @param args arguments for String.format(...)
 * @return formatted SpannedString
 */
public static CharSequence getText(@NonNull Context context,@StringRes int id,Object... args){
  return HtmlUtil.applyFix(SpanFormatter.format(context.getResources().getConfiguration().locale,context.getText(id),args));
}
Program: 19128
Project: 19128
Buggy source:
private static void createJsonDownloader(){
  if (jsonDownloader == null) {
    jsonDownloader=new OkHttpClientJsonDownloader(client);
  }
}

Fixed version (ground truth):
public static JsonDownloader createJsonDownloader(){
  if (jsonDownloader == null) {
    jsonDownloader=new OkHttpClientJsonDownloader(client);
  }
  return jsonDownloader;
}
Program: 19129
Project: 19129
Buggy source:
public static WherigoService create(){
  GeocachingApiConfiguration apiConfiguration=new DefaultProductionGeocachingApiConfiguration();
  JsonDownloader jsonDownloader=new OkHttpClientJsonDownloader(apiConfiguration,new OkHttpClient());
  return new WherigoServiceImpl(jsonDownloader);
}

Fixed version (ground truth):
public static WherigoService create(){
  return new WherigoServiceImpl(GeocachingApiFactory.createJsonDownloader());
}
Program: 19130
Project: 19130
Buggy source:
@Override public void onLoginFinished(Intent errorIntent){
  AuthenticatorHelper helper=App.get(this).getAuthenticatorHelper();
  boolean result=helper.hasAccount();
  if (result) {
    Crashlytics.setUserName(helper.getAccount().name);
  }
  AnalyticsUtil.actionLogin(result);
  if (errorIntent != null)   startActivity(errorIntent);
  setResult(result ? RESULT_OK : RESULT_CANCELED);
  if (helper.getRestrictions().isPremiumMember()) {
    finish();
    return;
  }
  BasicMembershipWarningDialogFragment.newInstance().show(getFragmentManager(),BasicMembershipWarningDialogFragment.FRAGMENT_TAG);
}

Fixed version (ground truth):
@Override public void onLoginFinished(Intent errorIntent){
  AuthenticatorHelper helper=App.get(this).getAuthenticatorHelper();
  boolean result=helper.hasAccount();
  if (result) {
    Crashlytics.setUserName(helper.getAccount().name);
  }
  AnalyticsUtil.actionLogin(result);
  setResult(result ? RESULT_OK : RESULT_CANCELED);
  if (errorIntent != null) {
    startActivity(errorIntent);
    finish();
    return;
  }
  if (helper.getRestrictions().isPremiumMember()) {
    finish();
    return;
  }
  BasicMembershipWarningDialogFragment.newInstance().show(getFragmentManager(),BasicMembershipWarningDialogFragment.FRAGMENT_TAG);
}
Program: 19131
Project: 19131
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setRetainInstance(true);
  setCancelable(false);
  UpdateTaskData data=(UpdateTaskData)getArguments().getSerializable(PARAM_UPDATE_DATA);
  mTask=new UpdateTask(getActivity(),this);
  mTask.execute(data);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setRetainInstance(true);
  setCancelable(false);
  UpdateTaskData data=getArguments().getParcelable(PARAM_UPDATE_DATA);
  mTask=new UpdateTask(getActivity(),this);
  mTask.execute(data);
}
Program: 19132
Project: 19132
Buggy source:
public static UpdateDialogFragment newInstance(String cacheId,Waypoint oldPoint,boolean updateLogs){
  Bundle args=new Bundle();
  args.putSerializable(PARAM_UPDATE_DATA,new UpdateTaskData(cacheId,oldPoint,updateLogs));
  UpdateDialogFragment fragment=new UpdateDialogFragment();
  fragment.setArguments(args);
  return fragment;
}

Fixed version (ground truth):
public static UpdateDialogFragment newInstance(String cacheId,Waypoint oldPoint,boolean updateLogs){
  Bundle args=new Bundle();
  args.putParcelable(PARAM_UPDATE_DATA,new UpdateTaskData(cacheId,oldPoint,updateLogs));
  UpdateDialogFragment fragment=new UpdateDialogFragment();
  fragment.setArguments(args);
  return fragment;
}
Program: 19133
Project: 19133
Buggy source:
@OnClick(R.id.fab) public void onDownloadClick(){
  if (App.get(this).getAuthenticatorHelper().requestSignOn(this,REQUEST_SIGN_ON)) {
    return;
  }
  Timber.i("String_Node_Str" + mLatitudeEditText.getText() + "String_Node_Str"+ mLongitudeEditText.getText());
  mLatitude=Coordinates.convertDegToDouble(mLatitudeEditText.getText().toString());
  mLongitude=Coordinates.convertDegToDouble(mLongitudeEditText.getText().toString());
  if (Double.isNaN(mLatitude) || Double.isNaN(mLongitude)) {
    showError(R.string.wrong_coordinates,null);
  }
  mPrefs.edit().putFloat(PrefConstants.LAST_LATITUDE,(float)mLatitude).putFloat(PrefConstants.LAST_LONGITUDE,(float)mLongitude).apply();
  int count=mPrefs.getInt(PrefConstants.DOWNLOADING_COUNT_OF_CACHES,AppConstants.DOWNLOADING_COUNT_OF_CACHES_DEFAULT);
  AnalyticsUtil.actionSearchNearest(mCoordinatesSource,mUseFilter,count);
  DownloadNearestDialogFragment.newInstance(mLatitude,mLongitude,count).show(getFragmentManager(),DownloadNearestDialogFragment.FRAGMENT_TAG);
}

Fixed version (ground truth):
@OnClick(R.id.fab) public void onDownloadClick(){
  if (App.get(this).getAuthenticatorHelper().requestSignOn(this,REQUEST_SIGN_ON)) {
    return;
  }
  Timber.i("String_Node_Str" + mLatitudeEditText.getText() + "String_Node_Str"+ mLongitudeEditText.getText());
  mLatitude=Coordinates.convertDegToDouble(mLatitudeEditText.getText().toString());
  mLongitude=Coordinates.convertDegToDouble(mLongitudeEditText.getText().toString());
  if (Double.isNaN(mLatitude) || Double.isNaN(mLongitude)) {
    showError(R.string.wrong_coordinates,null);
    return;
  }
  mPrefs.edit().putFloat(PrefConstants.LAST_LATITUDE,(float)mLatitude).putFloat(PrefConstants.LAST_LONGITUDE,(float)mLongitude).apply();
  int count=mPrefs.getInt(PrefConstants.DOWNLOADING_COUNT_OF_CACHES,AppConstants.DOWNLOADING_COUNT_OF_CACHES_DEFAULT);
  AnalyticsUtil.actionSearchNearest(mCoordinatesSource,mUseFilter,count);
  DownloadNearestDialogFragment.newInstance(mLatitude,mLongitude,count).show(getFragmentManager(),DownloadNearestDialogFragment.FRAGMENT_TAG);
}
Program: 19136
Project: 19136
Buggy source:
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState){
  Bundle args=getArguments();
  return new MaterialDialog.Builder(getActivity()).title(args.getInt(PARAM_TITLE)).content(SpannedFix.fromHtml(getString(args.getInt(PARAM_ERROR_MESSAGE),StringUtils.defaultString(args.getString(PARAM_ADDITIONAL_MESSAGE))))).positiveText(R.string.ok_button).callback(new MaterialDialog.ButtonCallback(){
    @Override public void onPositive(    MaterialDialog dialog){
      onPositiveButtonClick();
    }
  }
).build();
}

Fixed version (ground truth):
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState){
  Bundle args=getArguments();
  MaterialDialog.Builder builder=new MaterialDialog.Builder(getActivity()).content(SpannedFix.fromHtml(getString(args.getInt(PARAM_ERROR_MESSAGE),StringUtils.defaultString(args.getString(PARAM_ADDITIONAL_MESSAGE))))).positiveText(R.string.ok_button).callback(new MaterialDialog.ButtonCallback(){
    @Override public void onPositive(    MaterialDialog dialog){
      onPositiveButtonClick();
    }
  }
);
  int title=args.getInt(PARAM_TITLE);
  if (title != 0) {
    builder.title(title);
  }
  return builder.build();
}
Program: 19137
Project: 19137
Buggy source:
protected void prepareDialog(int resTitle,int resErrorMessage,String additionalMessage){
  Bundle args=new Bundle();
  args.putInt(PARAM_TITLE,resTitle);
  args.putInt(PARAM_ERROR_MESSAGE,resErrorMessage);
  args.putString(PARAM_ADDITIONAL_MESSAGE,additionalMessage);
  setArguments(args);
}

Fixed version (ground truth):
protected void prepareDialog(@StringRes int resTitle,@StringRes int resErrorMessage,@Nullable String additionalMessage){
  Bundle args=new Bundle();
  args.putInt(PARAM_TITLE,resTitle);
  args.putInt(PARAM_ERROR_MESSAGE,resErrorMessage);
  args.putString(PARAM_ADDITIONAL_MESSAGE,additionalMessage);
  setArguments(args);
}
Program: 19138
Project: 19138
Buggy source:
public static LocusTestingErrorDialogFragment newInstance(Context context){
  LocusTestingErrorDialogFragment fragment=new LocusTestingErrorDialogFragment();
  fragment.prepareDialog(R.string.error_title,LocusUtils.isLocusAvailable(context) ? R.string.error_locus_old : R.string.error_locus_not_found,AppConstants.LOCUS_MIN_VERSION.toString());
  return fragment;
}

Fixed version (ground truth):
public static LocusTestingErrorDialogFragment newInstance(Context context){
  LocusTestingErrorDialogFragment fragment=new LocusTestingErrorDialogFragment();
  fragment.prepareDialog(0,LocusUtils.isLocusAvailable(context) ? R.string.error_locus_old : R.string.error_locus_not_found,AppConstants.LOCUS_MIN_VERSION.toString());
  return fragment;
}
Program: 19139
Project: 19139
Buggy source:
public static NoLocationPermissionErrorDialogFragment newInstance(){
  NoLocationPermissionErrorDialogFragment fragment=new NoLocationPermissionErrorDialogFragment();
  fragment.prepareDialog(R.string.error_title,R.string.error_no_location_permission,null);
  return fragment;
}

Fixed version (ground truth):
public static NoLocationPermissionErrorDialogFragment newInstance(){
  NoLocationPermissionErrorDialogFragment fragment=new NoLocationPermissionErrorDialogFragment();
  fragment.prepareDialog(0,R.string.error_no_location_permission,null);
  return fragment;
}
Program: 19140
Project: 19140
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setRetainInstance(true);
  setHasOptionsMenu(true);
  if (adapter.getItemCount() == 0) {
    mTask=new BookmarkCachesRetrieveTask(getActivity(),this);
    mTask.execute(getArguments().getString(PARAM_GUID));
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setHasOptionsMenu(true);
}
Program: 19141
Project: 19141
Buggy source:
@Override public void onTaskFinished(List<Bookmark> bookmarks){
  adapter.setBookmarks(bookmarks);
  setListShown(true);
}

Fixed version (ground truth):
@Override public void onTaskFinished(List<Bookmark> bookmarkList){
  mBookmarkList=new ArrayList<>(bookmarkList);
  adapter.setBookmarks(mBookmarkList);
  setListShown(true);
}
Program: 19142
Project: 19142
Buggy source:
@Override public void onTaskFinished(List<BookmarkList> bookmarkLists){
  adapter.setBookmarkLists(bookmarkLists);
  setListShown(true);
}

Fixed version (ground truth):
@Override public void onTaskFinished(List<BookmarkList> bookmarkLists){
  mBookmarkLists=new ArrayList<>(bookmarkLists);
  adapter.setBookmarkLists(mBookmarkLists);
  setListShown(true);
}
Program: 19143
Project: 19143
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  if (!onIsMultiPane() && !getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
    setPreferenceScreen(getPrefernceScreenFromHeader(R.xml.preference_header));
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  if (!onIsMultiPane() && !getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
    setPreferenceScreen(getPreferenceScreenFromHeader(R.xml.preference_header));
  }
}
Program: 19144
Project: 19144
Buggy source:
/** 
 * Runs on the UI thread after   {@link #doInBackground(Object[])}. The specified result is the value returned by   {@link #doInBackground(Object[])}or null if the task was cancelled or an exception occured.
 * @param result The result of the operation computed by {@link #doInBackground(Object[])}.
 * @see #onPreExecute()
 * @see #doInBackground(Object[])
 */
protected void onPostExecute(Result result){
}

Fixed version (ground truth):
/** 
 * Runs on the UI thread after   {@link #doInBackground(Object[])}. The specified result is the value returned by   {@link #doInBackground(Object[])}or null if the task was cancelled or an exception occurred.
 * @param result The result of the operation computed by {@link #doInBackground(Object[])}.
 * @see #onPreExecute()
 * @see #doInBackground(Object[])
 */
protected void onPostExecute(Result result){
}
Program: 19145
Project: 19145
Buggy source:
public void updateLimits(CacheLimits cacheLimits){
  if (cacheLimits == null)   return;
  maxFullGeocacheLimit=cacheLimits.getMaxCacheCount();
  Editor editor=mPrefs.edit();
  if (currentFullGeocacheLimit > cacheLimits.getCurrentCacheCount() || (currentFullGeocacheLimit == 0 && cacheLimits.getCurrentCacheCount() > 0)) {
    currentFullGeocacheLimit=cacheLimits.getCurrentCacheCount();
    Calendar c=Calendar.getInstance();
    c.add(Calendar.MINUTE,(int)fullGeocacheLimitPeriod);
    renewFullGeocacheLimit=c.getTime();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__RENEW_FULL_GEOCACHE_LIMIT,renewFullGeocacheLimit.getTime());
  }
 else {
    currentFullGeocacheLimit=cacheLimits.getCurrentCacheCount();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
  }
  editor.apply();
}

Fixed version (ground truth):
public void updateLimits(GeocacheLimits cacheLimits){
  if (cacheLimits == null)   return;
  maxFullGeocacheLimit=cacheLimits.getMaxGeocacheCount();
  Editor editor=mPrefs.edit();
  if (currentFullGeocacheLimit > cacheLimits.getCurrentGeocacheCount() || (currentFullGeocacheLimit == 0 && cacheLimits.getCurrentGeocacheCount() > 0)) {
    currentFullGeocacheLimit=cacheLimits.getCurrentGeocacheCount();
    Calendar c=Calendar.getInstance();
    c.add(Calendar.MINUTE,(int)fullGeocacheLimitPeriod);
    renewFullGeocacheLimit=c.getTime();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__RENEW_FULL_GEOCACHE_LIMIT,renewFullGeocacheLimit.getTime());
  }
 else {
    currentFullGeocacheLimit=cacheLimits.getCurrentGeocacheCount();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
  }
  editor.apply();
}
Program: 19146
Project: 19146
Buggy source:
public void updateLimits(CacheLimits cacheLimits){
  if (cacheLimits == null)   return;
  maxFullGeocacheLimit=cacheLimits.getMaxCacheCount();
  Editor editor=mPreferences.edit();
  if (currentFullGeocacheLimit > cacheLimits.getCurrentCacheCount() || (currentFullGeocacheLimit == 0 && cacheLimits.getCurrentCacheCount() > 0)) {
    currentFullGeocacheLimit=cacheLimits.getCurrentCacheCount();
    Calendar c=Calendar.getInstance();
    c.add(Calendar.MINUTE,(int)fullGeocacheLimitPeriod);
    renewFullGeocacheLimit=c.getTime();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__RENEW_FULL_GEOCACHE_LIMIT,renewFullGeocacheLimit.getTime());
  }
 else {
    currentFullGeocacheLimit=cacheLimits.getCurrentCacheCount();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
  }
  editor.putBoolean(PrefConstants.RESTRICTION__PREMIUM_MEMBER,maxFullGeocacheLimit > 1000);
  editor.apply();
}

Fixed version (ground truth):
public void updateLimits(GeocacheLimits cacheLimits){
  if (cacheLimits == null)   return;
  maxFullGeocacheLimit=cacheLimits.getMaxGeocacheCount();
  Editor editor=mPreferences.edit();
  if (currentFullGeocacheLimit > cacheLimits.getCurrentGeocacheCount() || (currentFullGeocacheLimit == 0 && cacheLimits.getCurrentGeocacheCount() > 0)) {
    currentFullGeocacheLimit=cacheLimits.getCurrentGeocacheCount();
    Calendar c=Calendar.getInstance();
    c.add(Calendar.MINUTE,(int)fullGeocacheLimitPeriod);
    renewFullGeocacheLimit=c.getTime();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__RENEW_FULL_GEOCACHE_LIMIT,renewFullGeocacheLimit.getTime());
  }
 else {
    currentFullGeocacheLimit=cacheLimits.getCurrentGeocacheCount();
    editor.putLong(PrefConstants.RESTRICTION__MAX_FULL_GEOCACHE_LIMIT,maxFullGeocacheLimit);
    editor.putLong(PrefConstants.RESTRICTION__CURRENT_FULL_GEOCACHE_LIMIT,currentFullGeocacheLimit);
  }
  editor.putBoolean(PrefConstants.RESTRICTION__PREMIUM_MEMBER,maxFullGeocacheLimit > 1000);
  editor.apply();
}
Program: 19147
Project: 19147
Buggy source:
@Override public void retrieveGeocache(String gcCode,CallbackListener listener) throws ProviderException {
  GeocachingApi api=createApi();
  try {
    Geocache cache=api.getCache(gcCode,configuration.getGeocacheLogCount(),0);
    listener.onCallback(new DataReceivedCallback(new Waypoint[]{LocusDataMapper.toLocusPoint(context,cache)}));
  }
 catch (  GeocachingApiException e) {
    throw mapException(e);
  }
}

Fixed version (ground truth):
@Override public void retrieveGeocache(String gcCode,CallbackListener listener) throws ProviderException {
  GeocachingApi api=createApi();
  try {
    Geocache cache=api.getGeocache(GeocachingApi.ResultQuality.FULL,gcCode,configuration.getGeocacheLogCount(),0);
    listener.onCallback(new DataReceivedCallback(new Waypoint[]{LocusDataMapper.toLocusPoint(context,cache)}));
  }
 catch (  GeocachingApiException e) {
    throw mapException(e);
  }
}