nus-yam/ex-repair huggingface dataset:
Program: 80050
Project: 80050
Buggy source:
/** 
 * Escape special chars form String including /
 * @param s - Must not be null.
 * @param sb
 */
public void escape(String s,Appendable sb){
  try {
    for (int i=0; i < s.length(); i++) {
      char ch=s.charAt(i);
switch (ch) {
case '"':
        sb.append("String_Node_Str");
      break;
case '\\':
    sb.append("String_Node_Str");
  break;
case '\b':
sb.append("String_Node_Str");
break;
case '\f':
sb.append("String_Node_Str");
break;
case '\n':
sb.append("String_Node_Str");
break;
case '\r':
sb.append("String_Node_Str");
break;
case '\t':
sb.append("String_Node_Str");
break;
case '/':
sb.append("String_Node_Str");
break;
default :
if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
sb.append("String_Node_Str");
String hex="String_Node_Str";
sb.append(hex.charAt(ch >> 12 & 0x0F));
sb.append(hex.charAt(ch >> 8 & 0x0F));
sb.append(hex.charAt(ch >> 4 & 0x0F));
sb.append(hex.charAt(ch >> 0 & 0x0F));
}
 else {
sb.append(ch);
}
}
}
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Escape special chars form String including /
 * @param s - Must not be null.
 * @param sb
 */
public void escape(String s,Appendable sb){
  try {
    int len=s.length();
    for (int i=0; i < len; i++) {
      char ch=s.charAt(i);
switch (ch) {
case '"':
        sb.append("String_Node_Str");
      break;
case '\\':
    sb.append("String_Node_Str");
  break;
case '\b':
sb.append("String_Node_Str");
break;
case '\f':
sb.append("String_Node_Str");
break;
case '\n':
sb.append("String_Node_Str");
break;
case '\r':
sb.append("String_Node_Str");
break;
case '\t':
sb.append("String_Node_Str");
break;
case '/':
sb.append("String_Node_Str");
break;
default :
if ((ch >= '\u0000' && ch <= '\u001F') || (ch >= '\u007F' && ch <= '\u009F') || (ch >= '\u2000' && ch <= '\u20FF')) {
sb.append("String_Node_Str");
String hex="String_Node_Str";
sb.append(hex.charAt(ch >> 12 & 0x0F));
sb.append(hex.charAt(ch >> 8 & 0x0F));
sb.append(hex.charAt(ch >> 4 & 0x0F));
sb.append(hex.charAt(ch >> 0 & 0x0F));
}
 else {
sb.append(ch);
}
}
}
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str");
}
}
Program: 80052
Project: 80052
Buggy source:
/** 
 * use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory
 */
public <T>T parse(InputStream in,AMapper<T> mapper) throws ParseException {
  if (pBinStream == null)   pBinStream=new JSONParserInputStream(mode);
  return pBinStream.parse(in,mapper);
}

Fixed version (ground truth):
/** 
 * use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory
 */
public <T>T parse(String in,Class<T> mapTo) throws ParseException {
  return getPString().parse(in,Mapper.getMapper(mapTo));
}
Program: 80053
Project: 80053
Buggy source:
protected void extractString(int beginIndex,int endIndex){
  xs=new String(in,beginIndex,endIndex);
}

Fixed version (ground truth):
protected void extractString(int beginIndex,int endIndex){
  xs=new String(in,beginIndex,endIndex - beginIndex);
}
Program: 80054
Project: 80054
Buggy source:
protected void extractStringTrim(int start,int stop){
  extractString(start,stop);
  xs=xs.trim();
}

Fixed version (ground truth):
abstract protected void extractStringTrim(int start,int stop);
Program: 80055
Project: 80055
Buggy source:
/** 
 * Opens a connection.
 * @param connString
 * @return a working connection.
 * @throws SQLException
 */
public static Connection openConnection(String connString) throws SQLException {
  Connection conn=DriverManager.getConnection("String_Node_Str");
  return conn;
}

Fixed version (ground truth):
/** 
 * Opens a connection.
 * @param connString
 * @return a working connection.
 * @throws SQLException
 */
public static Connection openConnection(String connString) throws SQLException {
  Connection conn=DriverManager.getConnection(connString);
  return conn;
}
Program: 80057
Project: 80057
Buggy source:
public MutableConfiguration(){
  mode=Mode.CommandLine;
  rasteriserType=RasteriserType.Lwjgl;
  extractLwjglNatives=true;
  showSpawn=true;
  tileSize=512;
  maxTiles=-1;
  colourDepth=16;
  alphaBits=0;
  numSamples=0;
  numZoomLevels=8;
  signsInitiallyVisible=true;
  playersInitiallyVisible=true;
  portalsInitiallyVisible=true;
  bedsInitiallyVisible=true;
  spawnInitiallyVisible=true;
  viewsInitiallyVisible=true;
  logFile=new File("String_Node_Str");
  outputHtmlName="String_Node_Str";
  useOldColorPalette=false;
  defaultSkin="String_Node_Str";
  numDownsampleThreads=1;
  singlePlayerName="String_Node_Str";
  maps=new ArrayList<MutableMap>();
}

Fixed version (ground truth):
public MutableConfiguration(){
  mode=Mode.CommandLine;
  rasteriserType=RasteriserType.Lwjgl;
  extractLwjglNatives=true;
  showSpawn=true;
  tileSize=512;
  maxTiles=-1;
  colourDepth=16;
  alphaBits=8;
  numSamples=0;
  numZoomLevels=8;
  signsInitiallyVisible=true;
  playersInitiallyVisible=true;
  portalsInitiallyVisible=true;
  bedsInitiallyVisible=true;
  spawnInitiallyVisible=true;
  viewsInitiallyVisible=true;
  logFile=new File("String_Node_Str");
  outputHtmlName="String_Node_Str";
  useOldColorPalette=false;
  defaultSkin="String_Node_Str";
  numDownsampleThreads=1;
  singlePlayerName="String_Node_Str";
  maps=new ArrayList<MutableMap>();
}
Program: 80059
Project: 80059
Buggy source:
private void loadPlayerList(Path playerFile){
  System.out.println("String_Node_Str" + playerFile);
  playerList=new ArrayList<String>();
  try {
    if (playerFile.toString().toLowerCase().endsWith("String_Node_Str")) {
      JsonArray array=new JsonParser().parse(new String(Files.readAllBytes(playerFile))).getAsJsonArray();
      for (int i=0; i < array.size(); i++) {
        String name=array.get(i).getAsJsonObject().get("String_Node_Str").getAsString();
        playerList.add(name.toLowerCase());
      }
    }
 else     if (playerFile.toString().toLowerCase().endsWith("String_Node_Str")) {
      if (Files.exists(playerFile)) {
        List<String> lines=Files.readAllLines(playerFile);
        for (        String line : lines)         playerList.add(line.trim().toLowerCase());
      }
    }
    System.out.println("String_Node_Str" + playerList.size() + "String_Node_Str");
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + playerFile);
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void loadPlayerList(Path playerFile){
  System.out.println("String_Node_Str" + playerFile);
  playerList=new ArrayList<String>();
  try {
    if (playerFile.toString().toLowerCase().endsWith("String_Node_Str")) {
      JsonArray array=new JsonParser().parse(new String(Files.readAllBytes(playerFile))).getAsJsonArray();
      for (int i=0; i < array.size(); i++) {
        String name=array.get(i).getAsJsonObject().get("String_Node_Str").getAsString();
        playerList.add(name.toLowerCase());
      }
    }
 else     if (playerFile.toString().toLowerCase().endsWith("String_Node_Str")) {
      if (Files.exists(playerFile)) {
        List<String> lines=Files.readAllLines(playerFile,StandardCharsets.UTF_8);
        for (        String line : lines)         playerList.add(line.trim().toLowerCase());
      }
    }
    System.out.println("String_Node_Str" + playerList.size() + "String_Node_Str");
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + playerFile);
    e.printStackTrace();
  }
}
Program: 80060
Project: 80060
Buggy source:
public void deserializeBlockstates(){
  List<BlockVariant> blockVariants=new ArrayList<>();
  try (FileSystem fs=FileSystems.newFileSystem(Paths.get(zips.getBaseFileName()),null);DirectoryStream<Path> entries=Files.newDirectoryStream(fs.getPath("String_Node_Str"))){
    for (    Path entry : entries) {
      JsonObject json=new JsonParser().parse(Files.newBufferedReader(entry)).getAsJsonObject();
      JsonObject variants=json.get("String_Node_Str").getAsJsonObject();
      Set<Entry<String,JsonElement>> entrySet=variants.entrySet();
      for (      Map.Entry<String,JsonElement> e : entrySet) {
        String key=e.getKey();
        blockVariants.add(BlockVariant.deserializeVariant(key,variants.get(key)));
      }
      String name="String_Node_Str" + StringUtils.removeEnd(entry.getFileName().toString(),"String_Node_Str");
      blockStates.put(name,blockVariants);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void deserializeBlockstates(){
  List<BlockVariant> blockVariants=new ArrayList<>();
  try (FileSystem fs=FileSystems.newFileSystem(Paths.get(zips.getBaseFileName()),null);DirectoryStream<Path> entries=Files.newDirectoryStream(fs.getPath("String_Node_Str"))){
    for (    Path entry : entries) {
      JsonObject json=new JsonParser().parse(Files.newBufferedReader(entry,StandardCharsets.UTF_8)).getAsJsonObject();
      JsonObject variants=json.get("String_Node_Str").getAsJsonObject();
      Set<Entry<String,JsonElement>> entrySet=variants.entrySet();
      for (      Map.Entry<String,JsonElement> e : entrySet) {
        String key=e.getKey();
        blockVariants.add(BlockVariant.deserializeVariant(key,variants.get(key)));
      }
      String name="String_Node_Str" + StringUtils.removeEnd(entry.getFileName().toString(),"String_Node_Str");
      blockStates.put(name,blockVariants);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 80062
Project: 80062
Buggy source:
private static boolean passesFilter(RawSign s,SignFilter filter){
  if (s.text1.trim().isEmpty() && s.text2.trim().isEmpty() && s.text3.trim().isEmpty()&& s.text4.trim().isEmpty())   return false;
  if (s.text1.startsWith("String_Node_Str"))   return false;
  if (filter == SignFilter.None) {
    return false;
  }
 else   if (filter == SignFilter.All || filter == SignFilter.Obey) {
    return true;
  }
 else   if (filter == SignFilter.Special) {
    String line="String_Node_Str" + s.text1 + s.text2+ s.text3+ s.text4;
    line=line.trim();
    if (line.length() > 0) {
      final char first=line.charAt(0);
      final char last=line.charAt(line.length() - 1);
      final char[] special={'-','=','~','!'};
      return containedIn(special,first) && containedIn(special,last);
    }
 else     return false;
  }
 else {
    throw new RuntimeException("String_Node_Str" + filter);
  }
}

Fixed version (ground truth):
private static boolean passesFilter(RawSign s,SignFilter filter){
  if (s.text1.trim().isEmpty() && s.text2.trim().isEmpty() && s.text3.trim().isEmpty()&& s.text4.trim().isEmpty())   return false;
  if (s.text1.startsWith("String_Node_Str") || s.text2.startsWith("String_Node_Str") || s.text3.startsWith("String_Node_Str")|| s.text4.startsWith("String_Node_Str")) {
    return false;
  }
  if (filter == SignFilter.None) {
    return false;
  }
 else   if (filter == SignFilter.All || filter == SignFilter.Obey) {
    return true;
  }
 else   if (filter == SignFilter.Special) {
    String line="String_Node_Str" + s.text1 + s.text2+ s.text3+ s.text4;
    line=line.trim();
    if (line.length() > 0) {
      final char first=line.charAt(0);
      final char last=line.charAt(line.length() - 1);
      final char[] special={'-','=','~','!'};
      return containedIn(special,first) && containedIn(special,last);
    }
 else     return false;
  }
 else {
    throw new RuntimeException("String_Node_Str" + filter);
  }
}
Program: 80063
Project: 80063
Buggy source:
private void outputViews(File viewsFile,HddObjectListReader<Sign> views,tectonicus.configuration.Map map,ImageFormat imageFormat){
  System.out.println("String_Node_Str");
  if (viewsFile.exists())   viewsFile.delete();
  JsArrayWriter jsWriter=null;
  try {
    jsWriter=new JsArrayWriter(viewsFile,map.getId() + "String_Node_Str");
    Sign sign=new Sign();
    while (views.hasNext()) {
      views.read(sign);
      HashMap<String,String> args=new HashMap<String,String>();
      final float worldX=sign.getX() + 0.5f;
      final float worldY=sign.getY();
      final float worldZ=sign.getZ() + 0.5f;
      String posStr="String_Node_Str" + worldX + "String_Node_Str"+ worldY+ "String_Node_Str"+ worldZ+ "String_Node_Str";
      args.put("String_Node_Str",posStr);
      String text="String_Node_Str";
      for (int i=1; i < 4; i++) {
        if (!sign.getText(i).startsWith("String_Node_Str")) {
          text=text + sign.getText(i);
        }
      }
      text=text.trim();
      args.put("String_Node_Str","String_Node_Str" + jsEscape(text) + "String_Node_Str");
      String filename=map.getId() + "String_Node_Str" + sign.getX()+ "String_Node_Str"+ sign.getY()+ "String_Node_Str"+ sign.getZ()+ "String_Node_Str"+ imageFormat.getExtension();
      args.put("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
      jsWriter.write(args);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (jsWriter != null)     jsWriter.close();
  }
}

Fixed version (ground truth):
private void outputViews(File viewsFile,HddObjectListReader<Sign> views,tectonicus.configuration.Map map,ImageFormat imageFormat){
  System.out.println("String_Node_Str");
  if (viewsFile.exists())   viewsFile.delete();
  JsArrayWriter jsWriter=null;
  try {
    jsWriter=new JsArrayWriter(viewsFile,map.getId() + "String_Node_Str");
    Sign sign=new Sign();
    while (views.hasNext()) {
      views.read(sign);
      HashMap<String,String> args=new HashMap<String,String>();
      final float worldX=sign.getX() + 0.5f;
      final float worldY=sign.getY();
      final float worldZ=sign.getZ() + 0.5f;
      String posStr="String_Node_Str" + worldX + "String_Node_Str"+ worldY+ "String_Node_Str"+ worldZ+ "String_Node_Str";
      args.put("String_Node_Str",posStr);
      String text="String_Node_Str";
      for (int i=0; i < 4; i++) {
        if (!sign.getText(i).startsWith("String_Node_Str")) {
          text=text + sign.getText(i) + "String_Node_Str";
        }
      }
      text=text.trim();
      args.put("String_Node_Str","String_Node_Str" + jsEscape(text) + "String_Node_Str");
      String filename=map.getId() + "String_Node_Str" + sign.getX()+ "String_Node_Str"+ sign.getY()+ "String_Node_Str"+ sign.getZ()+ "String_Node_Str"+ imageFormat.getExtension();
      args.put("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
      jsWriter.write(args);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (jsWriter != null)     jsWriter.close();
  }
}
Program: 80064
Project: 80064
Buggy source:
private static Set<String> extractSettings(Sign sign){
  String toParse=sign.getText(0);
  if (sign.getText(1).startsWith("String_Node_Str") && sign.getText(1).length() > 1)   toParse+="String_Node_Str" + sign.getText(1).substring(1);
  if (sign.getText(2).startsWith("String_Node_Str") && sign.getText(2).length() > 1)   toParse+="String_Node_Str" + sign.getText(2).substring(1);
  if (sign.getText(3).startsWith("String_Node_Str") && sign.getText(3).length() > 1)   toParse+="String_Node_Str" + sign.getText(3).substring(1);
  Set<String> settings=new HashSet<String>();
  StringTokenizer tokeniser=new StringTokenizer(toParse);
  while (tokeniser.hasMoreTokens()) {
    String token=tokeniser.nextToken();
    if (token != null) {
      token=token.trim().toLowerCase();
      settings.add(token);
    }
  }
  return settings;
}

Fixed version (ground truth):
private static Set<String> extractSettings(Sign sign){
  String toParse="String_Node_Str";
  if (sign.getText(0).startsWith("String_Node_Str") && sign.getText(0).length() > 1)   toParse+="String_Node_Str" + sign.getText(0).substring(1);
  if (sign.getText(1).startsWith("String_Node_Str") && sign.getText(1).length() > 1)   toParse+="String_Node_Str" + sign.getText(1).substring(1);
  if (sign.getText(2).startsWith("String_Node_Str") && sign.getText(2).length() > 1)   toParse+="String_Node_Str" + sign.getText(2).substring(1);
  if (sign.getText(3).startsWith("String_Node_Str") && sign.getText(3).length() > 1)   toParse+="String_Node_Str" + sign.getText(3).substring(1);
  Set<String> settings=new HashSet<String>();
  StringTokenizer tokeniser=new StringTokenizer(toParse);
  while (tokeniser.hasMoreTokens()) {
    String token=tokeniser.nextToken();
    if (token != null) {
      token=token.trim().toLowerCase();
      settings.add(token);
    }
  }
  return settings;
}
Program: 80065
Project: 80065
Buggy source:
public boolean passesFilter(RawSign sign){
  if (type == ViewFilterType.All) {
    String start=sign.text1.trim();
    return start.startsWith("String_Node_Str");
  }
 else   return false;
}

Fixed version (ground truth):
public boolean passesFilter(RawSign sign){
  if (type == ViewFilterType.All) {
    String text1=sign.text1.trim();
    String text2=sign.text2.trim();
    String text3=sign.text3.trim();
    String text4=sign.text4.trim();
    return (text1.startsWith("String_Node_Str") || text2.startsWith("String_Node_Str") || text3.startsWith("String_Node_Str")|| text4.startsWith("String_Node_Str")) ? true : false;
  }
 else   return false;
}
Program: 80069
Project: 80069
Buggy source:
public static String jsEscape(String text){
  text=text.replace("String_Node_Str","String_Node_Str");
  text=text.replace("String_Node_Str","String_Node_Str");
  text=text.replace("String_Node_Str","String_Node_Str");
  text=text.replace("String_Node_Str","String_Node_Str");
  return text;
}

Fixed version (ground truth):
public static String jsEscape(String text){
  text=text.replace("String_Node_Str","String_Node_Str");
  return text;
}
Program: 80070
Project: 80070
Buggy source:
private void outputViews(File viewsFile,HddObjectListReader<Sign> views,tectonicus.configuration.Map map,ImageFormat imageFormat){
  System.out.println("String_Node_Str");
  if (viewsFile.exists())   viewsFile.delete();
  JsArrayWriter jsWriter=null;
  try {
    jsWriter=new JsArrayWriter(viewsFile,map.getId() + "String_Node_Str");
    Sign sign=new Sign();
    while (views.hasNext()) {
      views.read(sign);
      HashMap<String,String> args=new HashMap<String,String>();
      final float worldX=sign.getX() + 0.5f;
      final float worldY=sign.getY();
      final float worldZ=sign.getZ() + 0.5f;
      String posStr="String_Node_Str" + worldX + "String_Node_Str"+ worldY+ "String_Node_Str"+ worldZ+ "String_Node_Str";
      args.put("String_Node_Str",posStr);
      String text=sign.getText(1) + "String_Node_Str" + sign.getText(2)+ "String_Node_Str"+ sign.getText(3);
      text=text.trim();
      args.put("String_Node_Str","String_Node_Str" + jsEscape(text) + "String_Node_Str");
      String filename=map.getId() + "String_Node_Str" + sign.getX()+ "String_Node_Str"+ sign.getY()+ "String_Node_Str"+ sign.getZ()+ "String_Node_Str"+ imageFormat.getExtension();
      args.put("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
      jsWriter.write(args);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (jsWriter != null)     jsWriter.close();
  }
}

Fixed version (ground truth):
private void outputViews(File viewsFile,HddObjectListReader<Sign> views,tectonicus.configuration.Map map,ImageFormat imageFormat){
  System.out.println("String_Node_Str");
  if (viewsFile.exists())   viewsFile.delete();
  JsArrayWriter jsWriter=null;
  try {
    jsWriter=new JsArrayWriter(viewsFile,map.getId() + "String_Node_Str");
    Sign sign=new Sign();
    while (views.hasNext()) {
      views.read(sign);
      HashMap<String,String> args=new HashMap<String,String>();
      final float worldX=sign.getX() + 0.5f;
      final float worldY=sign.getY();
      final float worldZ=sign.getZ() + 0.5f;
      String posStr="String_Node_Str" + worldX + "String_Node_Str"+ worldY+ "String_Node_Str"+ worldZ+ "String_Node_Str";
      args.put("String_Node_Str",posStr);
      String text="String_Node_Str";
      for (int i=1; i < 4; i++) {
        if (!sign.getText(i).startsWith("String_Node_Str")) {
          text=text + sign.getText(i);
        }
      }
      text=text.trim();
      args.put("String_Node_Str","String_Node_Str" + jsEscape(text) + "String_Node_Str");
      String filename=map.getId() + "String_Node_Str" + sign.getX()+ "String_Node_Str"+ sign.getY()+ "String_Node_Str"+ sign.getZ()+ "String_Node_Str"+ imageFormat.getExtension();
      args.put("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
      jsWriter.write(args);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (jsWriter != null)     jsWriter.close();
  }
}
Program: 80071
Project: 80071
Buggy source:
private static Set<String> extractSettings(Sign sign){
  String toParse=sign.getText(0);
  if (sign.getText(1).startsWith("String_Node_Str"))   toParse+="String_Node_Str" + sign.getText(1);
  if (sign.getText(2).startsWith("String_Node_Str"))   toParse+="String_Node_Str" + sign.getText(2);
  Set<String> settings=new HashSet<String>();
  StringTokenizer tokeniser=new StringTokenizer(toParse);
  while (tokeniser.hasMoreTokens()) {
    String token=tokeniser.nextToken();
    if (token != null) {
      token=token.trim().toLowerCase();
      settings.add(token);
    }
  }
  return settings;
}

Fixed version (ground truth):
private static Set<String> extractSettings(Sign sign){
  String toParse=sign.getText(0);
  if (sign.getText(1).startsWith("String_Node_Str") && sign.getText(1).length() > 1)   toParse+="String_Node_Str" + sign.getText(1).substring(1);
  if (sign.getText(2).startsWith("String_Node_Str") && sign.getText(2).length() > 1)   toParse+="String_Node_Str" + sign.getText(2).substring(1);
  if (sign.getText(3).startsWith("String_Node_Str") && sign.getText(3).length() > 1)   toParse+="String_Node_Str" + sign.getText(3).substring(1);
  Set<String> settings=new HashSet<String>();
  StringTokenizer tokeniser=new StringTokenizer(toParse);
  while (tokeniser.hasMoreTokens()) {
    String token=tokeniser.nextToken();
    if (token != null) {
      token=token.trim().toLowerCase();
      settings.add(token);
    }
  }
  return settings;
}
Program: 80073
Project: 80073
Buggy source:
public InteractiveRenderer(Configuration args,final int displayWidth,final int displayHeight) throws LWJGLException {
  rasteriser=RasteriserFactory.createRasteriser(args.getRasteriserType(),DisplayType.Window,displayWidth,displayHeight,24,8,8,4);
  System.out.println("String_Node_Str" + rasteriser);
  rasteriser.printInfo();
  viewMode=ViewMode.OrthoView;
  orthoCamPosition=new Vector3f();
  orthoCamera=new OrthoCamera(rasteriser,displayWidth,displayHeight);
  perspectiveCamera=new PerspectiveCamera(rasteriser,displayWidth,displayHeight);
  views=new ArrayList<RawSign>();
}

Fixed version (ground truth):
public InteractiveRenderer(Configuration args,final int displayWidth,final int displayHeight) throws LWJGLException {
  rasteriser=RasteriserFactory.createRasteriser(args.getRasteriserType(),DisplayType.Window,displayWidth,displayHeight,24,8,24,4);
  System.out.println("String_Node_Str" + rasteriser);
  rasteriser.printInfo();
  viewMode=ViewMode.OrthoView;
  orthoCamPosition=new Vector3f();
  orthoCamera=new OrthoCamera(rasteriser,displayWidth,displayHeight);
  perspectiveCamera=new PerspectiveCamera(rasteriser,displayWidth,displayHeight);
  views=new ArrayList<RawSign>();
}
Program: 80074
Project: 80074
Buggy source:
public TileRenderer(Configuration args,ProgressListener listener,MessageDigest hashAlgorithm) throws Exception {
  this.args=args;
  this.hashAlgorithm=hashAlgorithm;
  this.progressListener=listener;
  this.tileWidth=args.tileSize();
  this.tileHeight=args.tileSize();
  this.numZoomLevels=args.numZoomLevels();
  this.exportDir=args.outputDir();
  playerSkinCache=new PlayerSkinCache(args,hashAlgorithm);
  hddTileListFactory=new HddTileListFactory(new File(args.cacheDir(),"String_Node_Str"));
  System.out.println("String_Node_Str");
  playerIconAssembler=new PlayerIconAssembler(playerSkinCache);
  memoryMonitor=new MemoryMonitor();
{
    System.out.println("String_Node_Str");
    rasteriser=RasteriserFactory.createRasteriser(args.getRasteriserType(),DisplayType.Offscreen,2048,2048,args.colourDepth(),args.alphaBits(),16,args.numSamples());
    if (rasteriser != null) {
      System.out.println("String_Node_Str" + rasteriser);
      rasteriser.printInfo();
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  System.out.println("String_Node_Str");
  camera=new OrthoCamera(rasteriser,tileWidth,tileHeight);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public TileRenderer(Configuration args,ProgressListener listener,MessageDigest hashAlgorithm) throws Exception {
  this.args=args;
  this.hashAlgorithm=hashAlgorithm;
  this.progressListener=listener;
  this.tileWidth=args.tileSize();
  this.tileHeight=args.tileSize();
  this.numZoomLevels=args.numZoomLevels();
  this.exportDir=args.outputDir();
  playerSkinCache=new PlayerSkinCache(args,hashAlgorithm);
  hddTileListFactory=new HddTileListFactory(new File(args.cacheDir(),"String_Node_Str"));
  System.out.println("String_Node_Str");
  playerIconAssembler=new PlayerIconAssembler(playerSkinCache);
  memoryMonitor=new MemoryMonitor();
{
    System.out.println("String_Node_Str");
    rasteriser=RasteriserFactory.createRasteriser(args.getRasteriserType(),DisplayType.Offscreen,2048,2048,args.colourDepth(),args.alphaBits(),24,args.numSamples());
    if (rasteriser != null) {
      System.out.println("String_Node_Str" + rasteriser);
      rasteriser.printInfo();
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  System.out.println("String_Node_Str");
  camera=new OrthoCamera(rasteriser,tileWidth,tileHeight);
  System.out.println("String_Node_Str");
}
Program: 80076
Project: 80076
Buggy source:
public void lookAt(float x,float y,float z,final float zoom,final float angleOffsetRads,final float elevationAngleRads){
  this.lookAt.set(x,y,z);
  this.zoom=zoom;
  eye=calcEyePosition(lookAt,angleOffsetRads,elevationAngleRads);
{
    Vector3f forward=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    forward.normalise();
    if (elevationAngleRads >= Math.PI / 2f) {
      Vector3f dummyEye=calcEyePosition(lookAt,angleOffsetRads,(float)Math.PI / 4.0f);
      Vector3f dummyForward=new Vector3f(lookAt.x - dummyEye.x,lookAt.y - dummyEye.y,lookAt.z - dummyEye.z);
      dummyForward.normalise();
      up=new Vector3f(dummyForward.x,dummyForward.y + 1,dummyForward.z);
    }
 else {
      up=new Vector3f(0,1,0);
    }
    Vector3f dir=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    dir.normalise();
    Vector3f.cross(dir,up,right);
    Vector3f.cross(right,dir,up);
    right.normalise();
    up.normalise();
  }
  final float size=this.zoom / 2;
  projectionMatrix=MatrixUtil.createOrthoMatrix(-size,size,-size,size,-10000,10000);
  cameraMatrix=MatrixUtil.createLookAt(eye,lookAt,up);
  frustum.extract(projectionMatrix,cameraMatrix,windowWidth,windowHeight,viewport);
}

Fixed version (ground truth):
public void lookAt(float x,float y,float z,final float zoom,final float angleOffsetRads,final float elevationAngleRads){
  this.lookAt.set(x,y,z);
  this.zoom=zoom;
  eye=calcEyePosition(lookAt,angleOffsetRads,elevationAngleRads);
{
    Vector3f forward=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    forward.normalise();
    if (elevationAngleRads >= Math.PI / 2f) {
      Vector3f dummyEye=calcEyePosition(lookAt,angleOffsetRads,(float)Math.PI / 4.0f);
      Vector3f dummyForward=new Vector3f(lookAt.x - dummyEye.x,lookAt.y - dummyEye.y,lookAt.z - dummyEye.z);
      dummyForward.normalise();
      up=new Vector3f(dummyForward.x,dummyForward.y + 1,dummyForward.z);
    }
 else {
      up=new Vector3f(0,1,0);
    }
    Vector3f dir=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    dir.normalise();
    Vector3f.cross(dir,up,right);
    Vector3f.cross(right,dir,up);
    right.normalise();
    up.normalise();
  }
  final float size=this.zoom / 2;
  projectionMatrix=MatrixUtil.createOrthoMatrix(-size,size,-size,size,1000,2000);
  cameraMatrix=MatrixUtil.createLookAt(eye,lookAt,up);
  frustum.extract(projectionMatrix,cameraMatrix,windowWidth,windowHeight,viewport);
}
Program: 80081
Project: 80081
Buggy source:
public void lookAt(float x,float y,float z,final float zoom,final float angleOffsetRads,final float elevationAngleRads){
  this.lookAt.set(x,y,z);
  this.zoom=zoom;
  eye=calcEyePosition(lookAt,angleOffsetRads,elevationAngleRads);
{
    Vector3f forward=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    forward.normalise();
    if (elevationAngleRads >= Math.PI / 2f) {
      Vector3f dummyEye=calcEyePosition(lookAt,angleOffsetRads,(float)Math.PI / 4.0f);
      Vector3f dummyForward=new Vector3f(lookAt.x - dummyEye.x,lookAt.y - dummyEye.y,lookAt.z - dummyEye.z);
      dummyForward.normalise();
      up=new Vector3f(dummyForward.x,dummyForward.y + 1,dummyForward.z);
    }
 else {
      up=new Vector3f(0,1,0);
    }
    Vector3f dir=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    dir.normalise();
    Vector3f.cross(dir,up,right);
    Vector3f.cross(right,dir,up);
    right.normalise();
    up.normalise();
  }
  final float size=this.zoom / 2;
  projectionMatrix=MatrixUtil.createOrthoMatrix(-size,size,-size,size,1000,2000);
  cameraMatrix=MatrixUtil.createLookAt(eye,lookAt,up);
  frustum.extract(projectionMatrix,cameraMatrix,windowWidth,windowHeight,viewport);
}

Fixed version (ground truth):
public void lookAt(float x,float y,float z,final float zoom,final float angleOffsetRads,final float elevationAngleRads){
  this.lookAt.set(x,y,z);
  this.zoom=zoom;
  eye=calcEyePosition(lookAt,angleOffsetRads,elevationAngleRads);
{
    Vector3f forward=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    forward.normalise();
    if (elevationAngleRads >= Math.PI / 2f) {
      Vector3f dummyEye=calcEyePosition(lookAt,angleOffsetRads,(float)Math.PI / 4.0f);
      Vector3f dummyForward=new Vector3f(lookAt.x - dummyEye.x,lookAt.y - dummyEye.y,lookAt.z - dummyEye.z);
      dummyForward.normalise();
      up=new Vector3f(dummyForward.x,dummyForward.y + 1,dummyForward.z);
    }
 else {
      up=new Vector3f(0,1,0);
    }
    Vector3f dir=new Vector3f(lookAt.x - eye.x,lookAt.y - eye.y,lookAt.z - eye.z);
    dir.normalise();
    Vector3f.cross(dir,up,right);
    Vector3f.cross(right,dir,up);
    right.normalise();
    up.normalise();
  }
  final float size=this.zoom / 2;
  projectionMatrix=MatrixUtil.createOrthoMatrix(-size,size,-size,size,1000,7000);
  cameraMatrix=MatrixUtil.createLookAt(eye,lookAt,up);
  frustum.extract(projectionMatrix,cameraMatrix,windowWidth,windowHeight,viewport);
}
Program: 80083
Project: 80083
Buggy source:
public static File findPlayersDir(File worldDir){
  if (worldDir == null)   return null;
  return new File(worldDir,"String_Node_Str");
}

Fixed version (ground truth):
public static File findPlayersDir(File worldDir){
  if (worldDir == null)   return null;
  File oldDir=new File(worldDir,"String_Node_Str");
  if (oldDir.exists())   return oldDir;
 else   return new File(worldDir,"String_Node_Str");
}
Program: 80085
Project: 80085
Buggy source:
public Sign(RawSign rawSign){
  blockId=rawSign.blockId;
  blockData=rawSign.data;
  position=new Vector3l(rawSign.x,rawSign.y,rawSign.z);
  text=new String[4];
  text[0]=rawSign.text1;
  text[1]=rawSign.text2;
  text[2]=rawSign.text3;
  text[3]=rawSign.text4;
}

Fixed version (ground truth):
public Sign(RawSign rawSign){
  blockId=rawSign.blockId;
  blockData=rawSign.blockData;
  position=new Vector3l(rawSign.x,rawSign.y,rawSign.z);
  text=new String[4];
  text[0]=rawSign.text1;
  text[1]=rawSign.text2;
  text[2]=rawSign.text3;
  text[3]=rawSign.text4;
}
Program: 80089
Project: 80089
Buggy source:
private void outputPortals(File portalFile,HddObjectListReader<Portal> portalPositions,tectonicus.configuration.Map map){
  System.out.println("String_Node_Str");
  if (portalFile.exists())   portalFile.delete();
  JsArrayWriter jsWriter=null;
  try {
    jsWriter=new JsArrayWriter(portalFile,map.getId() + "String_Node_Str");
    Portal portal=new Portal();
    while (portalPositions.hasNext()) {
      portalPositions.read(portal);
      HashMap<String,String> args=new HashMap<String,String>();
      final float worldX=portal.getX() + 0.5f;
      final float worldY=portal.getY();
      final float worldZ=portal.getZ() + 0.5f;
      String posStr="String_Node_Str" + worldX + "String_Node_Str"+ worldY+ "String_Node_Str"+ worldZ+ "String_Node_Str";
      args.put("String_Node_Str",posStr);
      jsWriter.write(args);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (jsWriter != null)     jsWriter.close();
  }
}

Fixed version (ground truth):
private int outputPortals(File portalFile,HddObjectListReader<Portal> portalPositions,tectonicus.configuration.Map map){
  System.out.println("String_Node_Str");
  if (portalFile.exists())   portalFile.delete();
  int numPortals=0;
  JsArrayWriter jsWriter=null;
  try {
    jsWriter=new JsArrayWriter(portalFile,map.getId() + "String_Node_Str");
    ArrayList<Portal> portals=new ArrayList<Portal>();
    long prevX, prevY, prevZ, firstX, firstZ;
    Portal portal=new Portal();
    portalPositions.read(portal);
    firstX=portal.getX();
    firstZ=portal.getZ();
    prevX=portal.getX();
    prevY=portal.getY();
    prevZ=portal.getZ();
    while (portalPositions.hasNext()) {
      portalPositions.read(portal);
      if ((portal.getX() == prevX && portal.getZ() == prevZ + 1) || (portal.getX() == prevX + 1 && portal.getZ() == prevZ)) {
        prevX=portal.getX();
        prevY=portal.getY();
        prevZ=portal.getZ();
      }
 else {
        portals.add(new Portal(prevX + (firstX - prevX) / 2,prevY,prevZ + (firstZ - prevZ) / 2));
        numPortals++;
        prevX=portal.getX();
        prevY=portal.getY();
        prevZ=portal.getZ();
        firstX=portal.getX();
        firstZ=portal.getZ();
      }
    }
    portals.add(new Portal(portal.getX() + ((firstX - prevX) / 2),portal.getY(),portal.getZ() + (firstZ - prevZ) / 2));
    numPortals++;
    for (    Portal p : portals) {
      final float worldX=p.getX();
      final float worldY=p.getY();
      final float worldZ=p.getZ();
      HashMap<String,String> args=new HashMap<String,String>();
      String posStr="String_Node_Str" + worldX + "String_Node_Str"+ worldY+ "String_Node_Str"+ worldZ+ "String_Node_Str";
      args.put("String_Node_Str",posStr);
      jsWriter.write(args);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (jsWriter != null)     jsWriter.close();
  }
  return numPortals;
}
Program: 80090
Project: 80090
Buggy source:
private static void findPortals(RawChunk chunk,HddObjectListWriter<Portal> portals,PortalFilter filter,WorldStats stats){
  try {
    for (int x=0; x < RawChunk.WIDTH; x++) {
      for (int y=1; y < RawChunk.HEIGHT - 1; y++) {
        for (int z=0; z < RawChunk.DEPTH; z++) {
          final int id=chunk.getBlockId(x,y,z);
          final int above=chunk.getBlockId(x,y + 1,z);
          final int below=chunk.getBlockId(x,y - 1,z);
          if (id == BlockIds.PORTAL && above == BlockIds.PORTAL && below == BlockIds.PORTAL) {
            final int sum=x + z;
            if (sum % 2 == 0) {
              stats.incNumPortals();
              ChunkCoord coord=chunk.getChunkCoord();
              Vector3l pos=new Vector3l(coord.x * RawChunk.WIDTH + x,y,coord.z * RawChunk.DEPTH + z);
              if (filter.passesFilter(coord,pos)) {
                portals.add(new Portal(pos.x,pos.y,pos.z));
              }
            }
          }
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private static void findPortals(RawChunk chunk,HddObjectListWriter<Portal> portals,PortalFilter filter,WorldStats stats){
  try {
    for (int x=0; x < RawChunk.WIDTH; x++) {
      for (int y=1; y < RawChunk.HEIGHT - 1; y++) {
        for (int z=0; z < RawChunk.DEPTH; z++) {
          final int id=chunk.getBlockId(x,y,z);
          final int above=chunk.getBlockId(x,y + 1,z);
          int below=chunk.getBlockId(x,y - 1,z);
          if (id == BlockIds.PORTAL && above != BlockIds.PORTAL) {
            ChunkCoord coord=chunk.getChunkCoord();
            int tempY=y;
            while (below == BlockIds.PORTAL) {
              tempY-=1;
              below=chunk.getBlockId(x,tempY,z);
            }
            Vector3l pos=new Vector3l(coord.x * RawChunk.WIDTH + x,y - Math.round((y - (tempY + 1)) / 2),coord.z * RawChunk.DEPTH + z);
            if (filter.passesFilter(coord,pos)) {
              portals.add(new Portal(pos.x,pos.y,pos.z));
            }
          }
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 80092
Project: 80092
Buggy source:
@Override public void onBound(IOpenPgpService service){
  Log.d(OpenPgpApi.TAG,"String_Node_Str");
  Intent data=new Intent();
  data.setAction(OpenPgpApi.ACTION_GET_SIGN_KEY_ID);
  data.putExtra(OpenPgpApi.EXTRA_USER_ID,mDefaultUserId);
  OpenPgpApi api=new OpenPgpApi(getContext(),mServiceConnection.getService());
  api.executeApiAsync(data,null,null,new MyCallback(REQUEST_CODE_KEY_PREFERENCE));
}

Fixed version (ground truth):
@Override public void onBound(IOpenPgpService service){
  getSignKeyId(new Intent());
}
Program: 80093
Project: 80093
Buggy source:
private void setAndPersist(long newValue){
  mKeyId=newValue;
  persistLong(mKeyId);
  notifyChanged();
}

Fixed version (ground truth):
private void setAndPersist(long newValue){
  mKeyId=newValue;
  persistLong(mKeyId);
  notifyChanged();
  setSummary(getSummary());
}
Program: 80094
Project: 80094
Buggy source:
@Override protected void onClick(){
  mServiceConnection=new OpenPgpServiceConnection(getContext().getApplicationContext(),mOpenPgpProvider,new OpenPgpServiceConnection.OnBound(){
    @Override public void onBound(    IOpenPgpService service){
      Log.d(OpenPgpApi.TAG,"String_Node_Str");
      Intent data=new Intent();
      data.setAction(OpenPgpApi.ACTION_GET_SIGN_KEY_ID);
      data.putExtra(OpenPgpApi.EXTRA_USER_ID,mDefaultUserId);
      OpenPgpApi api=new OpenPgpApi(getContext(),mServiceConnection.getService());
      api.executeApiAsync(data,null,null,new MyCallback(REQUEST_CODE_KEY_PREFERENCE));
    }
    @Override public void onError(    Exception e){
      Log.e(OpenPgpApi.TAG,"String_Node_Str",e);
    }
  }
);
  mServiceConnection.bindToService();
}

Fixed version (ground truth):
@Override protected void onClick(){
  mServiceConnection=new OpenPgpServiceConnection(getContext().getApplicationContext(),mOpenPgpProvider,new OpenPgpServiceConnection.OnBound(){
    @Override public void onBound(    IOpenPgpService service){
      getSignKeyId(new Intent());
    }
    @Override public void onError(    Exception e){
      Log.e(OpenPgpApi.TAG,"String_Node_Str",e);
    }
  }
);
  mServiceConnection.bindToService();
}
Program: 80095
Project: 80095
Buggy source:
@Override public CharSequence getSummary(){
  return (mKeyId == 0) ? getContext().getString(R.string.openpgp_no_key_selected) : getContext().getString(R.string.openpgp_key_selected);
}

Fixed version (ground truth):
@Override public CharSequence getSummary(){
  return (mKeyId == NO_KEY) ? getContext().getString(R.string.openpgp_no_key_selected) : getContext().getString(R.string.openpgp_key_selected);
}
Program: 80096
Project: 80096
Buggy source:
@Override public void onReturn(Intent result){
switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,OpenPgpApi.RESULT_CODE_ERROR)) {
case OpenPgpApi.RESULT_CODE_SUCCESS:
{
      Log.e(OpenPgpApi.TAG,"String_Node_Str");
      break;
    }
case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
{
    PendingIntent pi=result.getParcelableExtra(OpenPgpApi.RESULT_INTENT);
    try {
      Activity act=(Activity)getContext();
      act.startIntentSenderFromChild(act,pi.getIntentSender(),requestCode,null,0,0,0);
    }
 catch (    IntentSender.SendIntentException e) {
      Log.e(OpenPgpApi.TAG,"String_Node_Str",e);
    }
    break;
  }
case OpenPgpApi.RESULT_CODE_ERROR:
{
  OpenPgpError error=result.getParcelableExtra(OpenPgpApi.RESULT_ERROR);
  Log.e(OpenPgpApi.TAG,"String_Node_Str" + error.getMessage());
  break;
}
}
}

Fixed version (ground truth):
@Override public void onReturn(Intent result){
switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,OpenPgpApi.RESULT_CODE_ERROR)) {
case OpenPgpApi.RESULT_CODE_SUCCESS:
{
      long keyId=result.getLongExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID,NO_KEY);
      save(keyId);
      break;
    }
case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
{
    PendingIntent pi=result.getParcelableExtra(OpenPgpApi.RESULT_INTENT);
    try {
      Activity act=(Activity)getContext();
      act.startIntentSenderFromChild(act,pi.getIntentSender(),requestCode,null,0,0,0);
    }
 catch (    IntentSender.SendIntentException e) {
      Log.e(OpenPgpApi.TAG,"String_Node_Str",e);
    }
    break;
  }
case OpenPgpApi.RESULT_CODE_ERROR:
{
  OpenPgpError error=result.getParcelableExtra(OpenPgpApi.RESULT_ERROR);
  Log.e(OpenPgpApi.TAG,"String_Node_Str" + error.getMessage());
  break;
}
}
}
Program: 80097
Project: 80097
Buggy source:
public boolean handleOnActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == REQUEST_CODE_KEY_PREFERENCE && resultCode == Activity.RESULT_OK) {
    long keyId=data.getLongExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID,0);
    save(keyId);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean handleOnActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == REQUEST_CODE_KEY_PREFERENCE && resultCode == Activity.RESULT_OK) {
    getSignKeyId(data);
    return true;
  }
 else {
    return false;
  }
}
Program: 80098
Project: 80098
Buggy source:
@Override protected Object onGetDefaultValue(TypedArray a,int index){
  return (long)a.getInteger(index,0);
}

Fixed version (ground truth):
@Override protected Object onGetDefaultValue(TypedArray a,int index){
  return (long)a.getInteger(index,NO_KEY);
}
Program: 80099
Project: 80099
Buggy source:
@Override public synchronized void addAfterChild(final T parent,final T newChild,final T afterChild){
  expectNodeNotInTreeYet(newChild);
  final InMemoryTreeNode<T> node=getNodeFromTreeOrThrowAllowRoot(parent);
  final boolean visibility=getChildrenVisibility(node);
  if (afterChild == null) {
    final InMemoryTreeNode<T> added=node.add(node.getChildrenListSize(),newChild,visibility);
    allNodes.put(newChild,added);
  }
 else {
    final int index=node.indexOf(afterChild);
    final InMemoryTreeNode<T> added=node.add(index == -1 ? node.getChildrenListSize() : index,newChild,visibility);
    allNodes.put(newChild,added);
  }
  if (visibility) {
    internalDataSetChanged();
  }
}

Fixed version (ground truth):
@Override public synchronized void addAfterChild(final T parent,final T newChild,final T afterChild){
  expectNodeNotInTreeYet(newChild);
  final InMemoryTreeNode<T> node=getNodeFromTreeOrThrowAllowRoot(parent);
  final boolean visibility=getChildrenVisibility(node);
  if (afterChild == null) {
    final InMemoryTreeNode<T> added=node.add(node.getChildrenListSize(),newChild,visibility);
    allNodes.put(newChild,added);
  }
 else {
    final int index=node.indexOf(afterChild);
    final InMemoryTreeNode<T> added=node.add(index == -1 ? node.getChildrenListSize() : index + 1,newChild,visibility);
    allNodes.put(newChild,added);
  }
  if (visibility) {
    internalDataSetChanged();
  }
}
Program: 80100
Project: 80100
Buggy source:
private Drawable getDrawable(final TreeNodeInfo<T> nodeInfo){
  if (!nodeInfo.isWithChildren() || !collapsible) {
    return getDrawableOrDefaultBackground(indicatorBackgroundDrawable);
  }
  if (nodeInfo.isExpanded()) {
    return expandedDrawable;
  }
 else {
    return collapsedDrawable;
  }
}

Fixed version (ground truth):
protected Drawable getDrawable(final TreeNodeInfo<T> nodeInfo){
  if (!nodeInfo.isWithChildren() || !collapsible) {
    return getDrawableOrDefaultBackground(indicatorBackgroundDrawable);
  }
  if (nodeInfo.isExpanded()) {
    return expandedDrawable;
  }
 else {
    return collapsedDrawable;
  }
}
Program: 80101
Project: 80101
Buggy source:
@Override public synchronized T getPreviousSibling(final T id){
  final T parent=getParent(id);
  final InMemoryTreeNode<T> parentNode=getNodeFromTreeOrThrowAllowRoot(parent);
  final T previousSibling=null;
  for (  final InMemoryTreeNode<T> child : parentNode.getChildren()) {
    if (child.getId().equals(id)) {
      return previousSibling;
    }
    previousSibling=child.getId();
  }
  return null;
}

Fixed version (ground truth):
@Override public synchronized T getPreviousSibling(final T id){
  final T parent=getParent(id);
  final InMemoryTreeNode<T> parentNode=getNodeFromTreeOrThrowAllowRoot(parent);
  T previousSibling=null;
  for (  final InMemoryTreeNode<T> child : parentNode.getChildren()) {
    if (child.getId().equals(id)) {
      return previousSibling;
    }
    previousSibling=child.getId();
  }
  return null;
}
Program: 80102
Project: 80102
Buggy source:
@Override public synchronized TreeNodeInfo<T> getNodeInfo(final T id){
  final InMemoryTreeNode<T> node=getNodeFromTreeOrThrow(id);
  final List<InMemoryTreeNode<T>> children=node.getChildren();
  boolean expanded=false;
  if (children.size() > 0 && children.get(0).isVisible()) {
    expanded=true;
  }
  return new TreeNodeInfo<T>(id,node.getLevel(),children.size() > 0,node.isVisible(),expanded);
}

Fixed version (ground truth):
@Override public synchronized TreeNodeInfo<T> getNodeInfo(final T id){
  final InMemoryTreeNode<T> node=getNodeFromTreeOrThrow(id);
  final List<InMemoryTreeNode<T>> children=node.getChildren();
  boolean expanded=false;
  if (!children.isEmpty() && children.get(0).isVisible()) {
    expanded=true;
  }
  return new TreeNodeInfo<T>(id,node.getLevel(),!children.isEmpty(),node.isVisible(),expanded);
}
Program: 80103
Project: 80103
Buggy source:
private boolean getChildrenVisibility(final InMemoryTreeNode<T> node){
  boolean visibility;
  final List<InMemoryTreeNode<T>> children=node.getChildren();
  if (children.size() > 0) {
    visibility=children.get(0).isVisible();
  }
 else {
    visibility=visibleByDefault;
  }
  return visibility;
}

Fixed version (ground truth):
private boolean getChildrenVisibility(final InMemoryTreeNode<T> node){
  boolean visibility;
  final List<InMemoryTreeNode<T>> children=node.getChildren();
  if (children.isEmpty()) {
    visibility=visibleByDefault;
  }
 else {
    visibility=children.get(0).isVisible();
  }
  return visibility;
}
Program: 80104
Project: 80104
Buggy source:
public synchronized T getNextVisible(final T id){
  final InMemoryTreeNode<T> node=getNodeFromTreeOrThrowAllowRoot(id);
  if (!node.isVisible()) {
    return null;
  }
  final List<InMemoryTreeNode<T>> children=node.getChildren();
  if (children.size() > 0) {
    final InMemoryTreeNode<T> firstChild=children.get(0);
    if (firstChild.isVisible()) {
      return firstChild.getId();
    }
  }
  final T sibl=getNextSibling(id);
  if (sibl != null) {
    return sibl;
  }
  T parent=node.getParent();
  do {
    if (parent == null) {
      return null;
    }
    final T parentSibling=getNextSibling(parent);
    if (parentSibling != null) {
      return parentSibling;
    }
    parent=getNodeFromTreeOrThrow(parent).getParent();
  }
 while (true);
}

Fixed version (ground truth):
public synchronized T getNextVisible(final T id){
  final InMemoryTreeNode<T> node=getNodeFromTreeOrThrowAllowRoot(id);
  if (!node.isVisible()) {
    return null;
  }
  final List<InMemoryTreeNode<T>> children=node.getChildren();
  if (!children.isEmpty()) {
    final InMemoryTreeNode<T> firstChild=children.get(0);
    if (firstChild.isVisible()) {
      return firstChild.getId();
    }
  }
  final T sibl=getNextSibling(id);
  if (sibl != null) {
    return sibl;
  }
  T parent=node.getParent();
  do {
    if (parent == null) {
      return null;
    }
    final T parentSibling=getNextSibling(parent);
    if (parentSibling != null) {
      return parentSibling;
    }
    parent=getNodeFromTreeOrThrow(parent).getParent();
  }
 while (true);
}