nus-yam/ex-repair huggingface dataset:
Program: 58173
Project: 58173
Buggy source:
/** 
 * Kill all entities on roads
 */
@SuppressWarnings("String_Node_Str") public static void killAllEntities(){
  Bukkit.getScheduler().scheduleAsyncRepeatingTask(getMain(),new Runnable(){
    World world;
    Location location;
    long ticked=0l;
    long error=0l;
    @Override public void run(){
      for (      String w : getPlotWorlds()) {
        World world=Bukkit.getWorld(w);
        try {
          if (world.getLoadedChunks().length < 1) {
            continue;
          }
          for (          Chunk chunk : world.getLoadedChunks()) {
            for (            Entity entity : chunk.getEntities()) {
              if (entity.getType() == EntityType.PLAYER)               continue;
              location=entity.getLocation();
              if (!PlayerEvents.isInPlot(location))               entity.remove();
            }
          }
        }
 catch (        Exception e) {
          ++error;
        }
 finally {
          ++ticked;
        }
      }
    }
  }
,0l,2l);
}

Fixed version (ground truth):
/** 
 * Kill all entities on roads
 */
@SuppressWarnings("String_Node_Str") public static void killAllEntities(){
  Bukkit.getScheduler().scheduleAsyncRepeatingTask(getMain(),new Runnable(){
    World world;
    Location location;
    long ticked=0l;
    long error=0l;
    @Override public void run(){
      for (      String w : getPlotWorlds()) {
        World world=Bukkit.getServer().getWorld(w);
        try {
          if (world.getLoadedChunks().length < 1) {
            continue;
          }
          for (          Chunk chunk : world.getLoadedChunks()) {
            Entity[] entities=chunk.getEntities();
            for (int i=entities.length - 1; i >= 0; i--) {
              Entity entity=entities[i];
              if (entity.getType() == EntityType.PLAYER)               continue;
              location=entity.getLocation();
              if (!PlayerEvents.isInPlot(location))               entity.remove();
            }
          }
        }
 catch (        Exception e) {
          ++error;
        }
 finally {
          ++ticked;
        }
      }
    }
  }
,0l,2l);
}
Program: 58174
Project: 58174
Buggy source:
/** 
 * TODO: Implement better system
 * @param plugin Plugin
 * @param async  Call async?
 */
private static void checkExpired(JavaPlugin plugin,boolean async){
  if (async) {
    Bukkit.getScheduler().runTaskAsynchronously(plugin,new Runnable(){
      @Override public void run(){
        for (        String world : getPlotWorldsString()) {
          if (plots.containsKey(world)) {
            for (            Plot plot : plots.get(world).values()) {
              if (plot.owner == null) {
                continue;
              }
              if (PlayerFunctions.hasExpired(plot)) {
                PlotDeleteEvent event=new PlotDeleteEvent(world,plot.id);
                Bukkit.getServer().getPluginManager().callEvent(event);
                if (!event.isCancelled()) {
                  event.setCancelled(true);
                }
 else {
                  DBFunc.delete(world,plot);
                }
              }
            }
          }
        }
      }
    }
);
  }
 else {
    for (    String world : getPlotWorldsString()) {
      if (PlotMain.plots.containsKey(world)) {
        for (        Plot plot : PlotMain.plots.get(world).values()) {
          if (PlayerFunctions.hasExpired(plot)) {
            PlotDeleteEvent event=new PlotDeleteEvent(world,plot.id);
            Bukkit.getServer().getPluginManager().callEvent(event);
            if (!event.isCancelled()) {
              event.setCancelled(true);
            }
 else {
              DBFunc.delete(world,plot);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * TODO: Implement better system
 * @param plugin Plugin
 * @param async  Call async?
 */
private static void checkExpired(JavaPlugin plugin,boolean async){
  if (async) {
    Bukkit.getScheduler().runTaskAsynchronously(plugin,new Runnable(){
      @Override public void run(){
        for (        String world : getPlotWorldsString()) {
          if (plots.containsKey(world)) {
            for (            Plot plot : plots.get(world).values()) {
              if (plot.owner == null) {
                continue;
              }
              if (PlayerFunctions.hasExpired(plot)) {
                PlotDeleteEvent event=new PlotDeleteEvent(world,plot.id);
                Bukkit.getServer().getPluginManager().callEvent(event);
                if (event.isCancelled()) {
                  event.setCancelled(true);
                }
 else {
                  DBFunc.delete(world,plot);
                }
              }
            }
          }
        }
      }
    }
);
  }
 else {
    for (    String world : getPlotWorldsString()) {
      if (PlotMain.plots.containsKey(world)) {
        for (        Plot plot : PlotMain.plots.get(world).values()) {
          if (PlayerFunctions.hasExpired(plot)) {
            PlotDeleteEvent event=new PlotDeleteEvent(world,plot.id);
            Bukkit.getServer().getPluginManager().callEvent(event);
            if (event.isCancelled()) {
              event.setCancelled(true);
            }
 else {
              DBFunc.delete(world,plot);
            }
          }
        }
      }
    }
  }
}
Program: 58175
Project: 58175
Buggy source:
public static boolean removePlot(String world,PlotId id){
  PlotDeleteEvent event=new PlotDeleteEvent(world,id);
  Bukkit.getServer().getPluginManager().callEvent(event);
  if (!event.isCancelled()) {
    event.setCancelled(true);
    return false;
  }
  plots.get(world).remove(id);
  return true;
}

Fixed version (ground truth):
public static boolean removePlot(String world,PlotId id){
  PlotDeleteEvent event=new PlotDeleteEvent(world,id);
  Bukkit.getServer().getPluginManager().callEvent(event);
  if (event.isCancelled()) {
    event.setCancelled(true);
    return false;
  }
  plots.get(world).remove(id);
  return true;
}
Program: 58178
Project: 58178
Buggy source:
public Flag(String key,String value){
  if (!StringUtils.isAlphanumeric(key) || !StringUtils.isAlphanumeric(ChatColor.stripColor(value)))   throw new IllegalArgumentException("String_Node_Str");
  if (key.length() > 16)   throw new IllegalArgumentException("String_Node_Str");
  if (value.length() > 48)   throw new IllegalArgumentException("String_Node_Str");
  this.key=key.toLowerCase();
  this.value=value;
}

Fixed version (ground truth):
public Flag(String key,String value){
  if (!StringUtils.isAlphanumeric(key) || !StringUtils.isAlphanumeric(ChatColor.stripColor(value).replace("String_Node_Str","String_Node_Str")))   throw new IllegalArgumentException("String_Node_Str");
  if (key.length() > 16)   throw new IllegalArgumentException("String_Node_Str");
  if (value.length() > 48)   throw new IllegalArgumentException("String_Node_Str");
  this.key=key.toLowerCase();
  this.value=value;
}
Program: 58179
Project: 58179
Buggy source:
public boolean execute(Player plr,String... args){
  World world;
  if (PlotMain.getPlotWorlds().length == 1)   world=Bukkit.getWorld(PlotMain.getPlotWorlds()[0]);
 else {
    if (PlotMain.isPlotWorld(plr.getWorld()))     world=plr.getWorld();
 else {
      if (args.length == 1) {
        world=Bukkit.getWorld(args[0]);
        if (world != null) {
          if (!PlotMain.isPlotWorld(world)) {
            PlayerFunctions.sendMessage(plr,C.NOT_VALID_PLOT_WORLD);
            return true;
          }
        }
 else {
          PlayerFunctions.sendMessage(plr,C.NOT_VALID_WORLD);
          return true;
        }
      }
 else {
        PlayerFunctions.sendMessage(plr,C.NOT_IN_PLOT_WORLD);
        return true;
      }
    }
  }
  if (PlayerFunctions.getPlayerPlotCount(world,plr) >= PlayerFunctions.getAllowedPlots(plr)) {
    PlayerFunctions.sendMessage(plr,C.CANT_CLAIM_MORE_PLOTS);
    return true;
  }
  boolean br=false;
  int x=0, z=0, q=100;
  PlotId id;
  while (!br) {
    id=new PlotId(x,z);
    if (PlotHelper.getPlot(world,id).owner == null) {
      Plot plot=PlotHelper.getPlot(world,id);
      Claim.claimPlot(plr,plot,true);
      br=true;
    }
    if (z < q && (z - x) < q) {
      z++;
    }
 else     if (x < q) {
      x++;
      z=q - 100;
    }
 else {
      q+=100;
      x=q;
      z=q;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(Player plr,String... args){
  World world;
  if (PlotMain.getPlotWorlds().length == 1)   world=Bukkit.getWorld(PlotMain.getPlotWorlds()[0]);
 else {
    if (PlotMain.isPlotWorld(plr.getWorld()))     world=plr.getWorld();
 else {
      if (args.length == 1) {
        world=Bukkit.getWorld(args[0]);
        if (world != null) {
          if (!PlotMain.isPlotWorld(world)) {
            PlayerFunctions.sendMessage(plr,C.NOT_VALID_PLOT_WORLD);
            return true;
          }
        }
 else {
          PlayerFunctions.sendMessage(plr,C.NOT_VALID_WORLD);
          return true;
        }
      }
 else {
        PlayerFunctions.sendMessage(plr,C.NOT_IN_PLOT_WORLD);
        return true;
      }
    }
  }
  if (PlayerFunctions.getPlayerPlotCount(world,plr) >= PlayerFunctions.getAllowedPlots(plr)) {
    PlayerFunctions.sendMessage(plr,C.CANT_CLAIM_MORE_PLOTS);
    return true;
  }
  boolean br=false;
  int x=0, z=0, q=100;
  PlotId id;
  while (!br) {
    id=new PlotId(x,z);
    if (PlotHelper.getPlot(world,id).owner == null) {
      Plot plot=PlotHelper.getPlot(world,id);
      boolean result=Claim.claimPlot(plr,plot,true);
      br=result;
    }
    if (z < q && (z - x) < q) {
      z++;
    }
 else     if (x < q) {
      x++;
      z=q - 100;
    }
 else {
      q+=100;
      x=q;
      z=q;
    }
  }
  return true;
}
Program: 58180
Project: 58180
Buggy source:
public static boolean claimPlot(Player player,Plot plot,boolean teleport){
  PlayerClaimPlotEvent event=new PlayerClaimPlotEvent(player,plot);
  Bukkit.getPluginManager().callEvent(event);
  if (!event.isCancelled()) {
    PlotHelper.createPlot(player,plot);
    PlotHelper.setSign(player,plot);
    PlayerFunctions.sendMessage(player,C.CLAIMED);
    if (teleport) {
      PlotMain.teleportPlayer(player,player.getLocation(),plot);
    }
    PlotWorld world=PlotMain.getWorldSettings(plot.getWorld());
    if (world.SCHEMATIC_ON_CLAIM) {
      SchematicHandler handler=new SchematicHandler();
      SchematicHandler.Schematic schematic=handler.getSchematic(world.SCHEMATIC_FILE);
      handler.paste(player.getLocation(),schematic,plot);
    }
  }
  return event.isCancelled();
}

Fixed version (ground truth):
public static boolean claimPlot(Player player,Plot plot,boolean teleport){
  PlayerClaimPlotEvent event=new PlayerClaimPlotEvent(player,plot);
  Bukkit.getPluginManager().callEvent(event);
  if (!event.isCancelled()) {
    PlotHelper.createPlot(player,plot);
    PlotHelper.setSign(player,plot);
    PlayerFunctions.sendMessage(player,C.CLAIMED);
    if (teleport) {
      PlotMain.teleportPlayer(player,player.getLocation(),plot);
    }
    PlotWorld world=PlotMain.getWorldSettings(plot.getWorld());
    if (world.SCHEMATIC_ON_CLAIM) {
      SchematicHandler handler=new SchematicHandler();
      SchematicHandler.Schematic schematic=handler.getSchematic(world.SCHEMATIC_FILE);
      handler.paste(player.getLocation(),schematic,plot);
    }
    plot.settings.setFlags(PlotMain.getWorldSettings(player.getWorld()).DEFAULT_FLAGS);
  }
  return event.isCancelled();
}
Program: 58181
Project: 58181
Buggy source:
@Override public boolean execute(Player plr,String... args){
  if (!PlayerFunctions.isInPlot(plr)) {
    PlayerFunctions.sendMessage(plr,C.NOT_IN_PLOT);
    return true;
  }
  if (PlayerFunctions.getPlayerPlotCount(plr.getWorld(),plr) >= PlayerFunctions.getAllowedPlots(plr)) {
    PlayerFunctions.sendMessage(plr,C.CANT_CLAIM_MORE_PLOTS);
    return true;
  }
  Plot plot=PlayerFunctions.getCurrentPlot(plr);
  if (plot.hasOwner()) {
    PlayerFunctions.sendMessage(plr,C.PLOT_IS_CLAIMED);
    return false;
  }
  claimPlot(plr,plot,false);
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(Player plr,String... args){
  if (!PlayerFunctions.isInPlot(plr)) {
    PlayerFunctions.sendMessage(plr,C.NOT_IN_PLOT);
    return true;
  }
  if (PlayerFunctions.getPlayerPlotCount(plr.getWorld(),plr) >= PlayerFunctions.getAllowedPlots(plr)) {
    PlayerFunctions.sendMessage(plr,C.CANT_CLAIM_MORE_PLOTS);
    return true;
  }
  Plot plot=PlayerFunctions.getCurrentPlot(plr);
  if (plot.hasOwner()) {
    PlayerFunctions.sendMessage(plr,C.PLOT_IS_CLAIMED);
    return false;
  }
  boolean result=claimPlot(plr,plot,false);
  if (!result) {
    PlayerFunctions.sendMessage(plr,C.PLOT_NOT_CLAIMED);
    return false;
  }
  return true;
}
Program: 58183
Project: 58183
Buggy source:
@SuppressWarnings("String_Node_Str") public static void setSign(Player plr,Plot p){
  PlotWorld plotworld=PlotMain.getWorldSettings(Bukkit.getWorld(p.world));
  Location pl=new Location(plr.getWorld(),getPlotBottomLoc(plr.getWorld(),p.id).getBlockX(),plotworld.ROAD_HEIGHT + 1,getPlotBottomLoc(plr.getWorld(),p.id).getBlockZ());
  Block bs=pl.add(0,0,-1).getBlock();
  bs.setType(Material.AIR);
  bs.setTypeIdAndData(Material.WALL_SIGN.getId(),(byte)2,false);
  String id=p.id.y + "String_Node_Str" + p.id.x;
  Sign sign=(Sign)bs.getState();
  sign.setLine(0,C.OWNER_SIGN_LINE_1.translated().replaceAll("String_Node_Str",id));
  sign.setLine(1,C.OWNER_SIGN_LINE_2.translated().replaceAll("String_Node_Str",id).replaceAll("String_Node_Str",plr.getName()));
  sign.setLine(2,C.OWNER_SIGN_LINE_3.translated().replaceAll("String_Node_Str",id).replaceAll("String_Node_Str",plr.getName()));
  sign.setLine(3,C.OWNER_SIGN_LINE_4.translated().replaceAll("String_Node_Str",id).replaceAll("String_Node_Str",plr.getName()));
  sign.update(true);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void setSign(Player plr,Plot p){
  World world=Bukkit.getWorld(p.world);
  PlotWorld plotworld=PlotMain.getWorldSettings(world);
  Location pl=new Location(world,getPlotBottomLoc(world,p.id).getBlockX(),plotworld.ROAD_HEIGHT + 1,getPlotBottomLoc(world,p.id).getBlockZ());
  Block bs=pl.add(0,0,-1).getBlock();
  bs.setType(Material.AIR);
  bs.setTypeIdAndData(Material.WALL_SIGN.getId(),(byte)2,false);
  String id=p.id.y + "String_Node_Str" + p.id.x;
  Sign sign=(Sign)bs.getState();
  sign.setLine(0,C.OWNER_SIGN_LINE_1.translated().replaceAll("String_Node_Str",id));
  sign.setLine(1,C.OWNER_SIGN_LINE_2.translated().replaceAll("String_Node_Str",id).replaceAll("String_Node_Str",plr.getName()));
  sign.setLine(2,C.OWNER_SIGN_LINE_3.translated().replaceAll("String_Node_Str",id).replaceAll("String_Node_Str",plr.getName()));
  sign.setLine(3,C.OWNER_SIGN_LINE_4.translated().replaceAll("String_Node_Str",id).replaceAll("String_Node_Str",plr.getName()));
  System.out.print(10);
  sign.update(true);
}
Program: 58184
Project: 58184
Buggy source:
@Override public void run(){
  for (  World w : getPlotWorlds()) {
    World world=w;
    try {
      if (world.getLoadedChunks().length < 1) {
        return;
      }
      for (      Chunk chunk : world.getLoadedChunks()) {
        for (        Entity entity : chunk.getEntities()) {
          if (entity.getType() == EntityType.PLAYER)           continue;
          location=entity.getLocation();
          if (!PlayerEvents.isInPlot(location))           entity.remove();
        }
      }
    }
 catch (    Exception e) {
      ++error;
    }
 finally {
      ++ticked;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  for (  String w : getPlotWorlds()) {
    World world=Bukkit.getWorld(w);
    try {
      if (world.getLoadedChunks().length < 1) {
        return;
      }
      for (      Chunk chunk : world.getLoadedChunks()) {
        for (        Entity entity : chunk.getEntities()) {
          if (entity.getType() == EntityType.PLAYER)           continue;
          location=entity.getLocation();
          if (!PlayerEvents.isInPlot(location))           entity.remove();
        }
      }
    }
 catch (    Exception e) {
      ++error;
    }
 finally {
      ++ticked;
    }
  }
}
Program: 58185
Project: 58185
Buggy source:
/** 
 * Replace the plot object with an updated version
 * @param plot plot object
 */
public static void updatePlot(Plot plot){
  String world=plot.world;
  if (!plots.containsKey(world))   plots.put(world,new HashMap<PlotId,Plot>());
  plot.hasChanged=true;
  plots.get(world).put(plot.id,plot);
}

Fixed version (ground truth):
/** 
 * Replace the plot object with an updated version
 * @param id   plot Id
 * @param plot plot object
 */
public static void updatePlot(Plot plot){
  String world=plot.world;
  if (!plots.containsKey(world))   plots.put(world,new HashMap<PlotId,Plot>());
  plot.hasChanged=true;
  plots.get(world).put(plot.id,plot);
}
Program: 58186
Project: 58186
Buggy source:
/** 
 * Kill all entities on roads
 */
@SuppressWarnings("String_Node_Str") public static void killAllEntities(){
  Bukkit.getScheduler().scheduleAsyncRepeatingTask(getMain(),new Runnable(){
    World world;
    Location location;
    long ticked=0l;
    long error=0l;
    @Override public void run(){
      for (      World w : getPlotWorlds()) {
        World world=w;
        try {
          if (world.getLoadedChunks().length < 1) {
            return;
          }
          for (          Chunk chunk : world.getLoadedChunks()) {
            for (            Entity entity : chunk.getEntities()) {
              if (entity.getType() == EntityType.PLAYER)               continue;
              location=entity.getLocation();
              if (!PlayerEvents.isInPlot(location))               entity.remove();
            }
          }
        }
 catch (        Exception e) {
          ++error;
        }
 finally {
          ++ticked;
        }
      }
    }
  }
,0l,2l);
}

Fixed version (ground truth):
/** 
 * Kill all entities on roads
 */
@SuppressWarnings("String_Node_Str") public static void killAllEntities(){
  Bukkit.getScheduler().scheduleAsyncRepeatingTask(getMain(),new Runnable(){
    World world;
    Location location;
    long ticked=0l;
    long error=0l;
    @Override public void run(){
      for (      String w : getPlotWorlds()) {
        World world=Bukkit.getWorld(w);
        try {
          if (world.getLoadedChunks().length < 1) {
            return;
          }
          for (          Chunk chunk : world.getLoadedChunks()) {
            for (            Entity entity : chunk.getEntities()) {
              if (entity.getType() == EntityType.PLAYER)               continue;
              location=entity.getLocation();
              if (!PlayerEvents.isInPlot(location))               entity.remove();
            }
          }
        }
 catch (        Exception e) {
          ++error;
        }
 finally {
          ++ticked;
        }
      }
    }
  }
,0l,2l);
}
Program: 58187
Project: 58187
Buggy source:
/** 
 * get all plot worlds
 */
public static World[] getPlotWorlds(){
  return (worlds.keySet().toArray(new World[0]));
}

Fixed version (ground truth):
/** 
 * get all plot worlds
 */
public static String[] getPlotWorlds(){
  return (worlds.keySet().toArray(new String[0]));
}
Program: 58189
Project: 58189
Buggy source:
/** 
 * Get all plot worlds
 * @return World[] - array of plot worlds
 */
public World[] getPlotWorlds(){
  return PlotMain.getPlotWorlds();
}

Fixed version (ground truth):
/** 
 * Get all plot worlds
 * @return World[] - array of plot worlds
 */
public String[] getPlotWorlds(){
  return PlotMain.getPlotWorlds();
}
Program: 58190
Project: 58190
Buggy source:
/** 
 * Get if plot world
 * @param world (to check if plot world)
 * @return boolean (if plot world or not)
 */
public boolean isPlotWorld(World world){
  for (  World w : PlotMain.getPlotWorlds()) {
    if (w.equals(world))     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Get if plot world
 * @param world (to check if plot world)
 * @return boolean (if plot world or not)
 */
public boolean isPlotWorld(World world){
  return PlotMain.isPlotWorld(world);
}
Program: 58191
Project: 58191
Buggy source:
public boolean execute(Player plr,String... args){
  World world;
  if (PlotMain.getPlotWorlds().length == 1)   world=PlotMain.getPlotWorlds()[0];
 else {
    if (PlotMain.isPlotWorld(plr.getWorld()))     world=plr.getWorld();
 else {
      PlayerFunctions.sendMessage(plr,C.NOT_IN_PLOT_WORLD);
      return true;
    }
  }
  if (PlayerFunctions.getPlayerPlotCount(world,plr) >= PlayerFunctions.getAllowedPlots(plr)) {
    PlayerFunctions.sendMessage(plr,C.CANT_CLAIM_MORE_PLOTS);
    return true;
  }
  boolean br=false;
  int x=0, z=0, q=100;
  PlotId id;
  while (!br) {
    id=new PlotId(x,z);
    if (PlotHelper.getPlot(world,id).owner == null) {
      Plot plot=PlotHelper.getPlot(world,id);
      Claim.claimPlot(plr,plot,true);
      br=true;
    }
    if (z < q && (z - x) < q) {
      z++;
    }
 else     if (x < q) {
      x++;
      z=q - 100;
    }
 else {
      q+=100;
      x=q;
      z=q;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(Player plr,String... args){
  World world;
  if (PlotMain.getPlotWorlds().length == 1)   world=Bukkit.getWorld(PlotMain.getPlotWorlds()[0]);
 else {
    if (PlotMain.isPlotWorld(plr.getWorld()))     world=plr.getWorld();
 else {
      if (args.length == 1) {
        world=Bukkit.getWorld(args[0]);
        if (world != null) {
          if (!PlotMain.isPlotWorld(world)) {
            PlayerFunctions.sendMessage(plr,C.NOT_VALID_PLOT_WORLD);
            return true;
          }
        }
 else {
          PlayerFunctions.sendMessage(plr,C.NOT_VALID_WORLD);
          return true;
        }
      }
 else {
        PlayerFunctions.sendMessage(plr,C.NOT_IN_PLOT_WORLD);
        return true;
      }
    }
  }
  if (PlayerFunctions.getPlayerPlotCount(world,plr) >= PlayerFunctions.getAllowedPlots(plr)) {
    PlayerFunctions.sendMessage(plr,C.CANT_CLAIM_MORE_PLOTS);
    return true;
  }
  boolean br=false;
  int x=0, z=0, q=100;
  PlotId id;
  while (!br) {
    id=new PlotId(x,z);
    if (PlotHelper.getPlot(world,id).owner == null) {
      Plot plot=PlotHelper.getPlot(world,id);
      Claim.claimPlot(plr,plot,true);
      br=true;
    }
    if (z < q && (z - x) < q) {
      z++;
    }
 else     if (x < q) {
      x++;
      z=q - 100;
    }
 else {
      q+=100;
      x=q;
      z=q;
    }
  }
  return true;
}
Program: 58193
Project: 58193
Buggy source:
@Override public String toString(){
  X509Certificate certificate=null;
  try {
    certificate=getAttestationCertificate();
  }
 catch (  CertificateException e) {
  }
catch (  NoSuchFieldException e) {
  }
  return MoreObjects.toStringHelper(this).omitNullValues().add("String_Node_Str",keyHandle).add("String_Node_Str",publicKey).add("String_Node_Str",counter).add("String_Node_Str",certificate).toString();
}

Fixed version (ground truth):
@Override public String toString(){
  X509Certificate certificate=null;
  try {
    certificate=getAttestationCertificate();
  }
 catch (  CertificateException e) {
  }
catch (  NoSuchFieldException e) {
  }
catch (  U2fBadInputException e) {
  }
  return MoreObjects.toStringHelper(this).omitNullValues().add("String_Node_Str",keyHandle).add("String_Node_Str",publicKey).add("String_Node_Str",counter).add("String_Node_Str",certificate).toString();
}
Program: 58194
Project: 58194
Buggy source:
public static RawAuthenticateResponse fromBase64(String rawDataBase64,Crypto crypto) throws U2fBadInputException {
  ByteInputStream bytes=new ByteInputStream(U2fB64Encoding.decode(rawDataBase64));
  return new RawAuthenticateResponse(bytes.readSigned(),bytes.readInteger(),bytes.readAll(),crypto);
}

Fixed version (ground truth):
public static RawAuthenticateResponse fromBase64(String rawDataBase64,Crypto crypto) throws U2fBadInputException {
  ByteInputStream bytes=new ByteInputStream(U2fB64Encoding.decode(rawDataBase64));
  try {
    return new RawAuthenticateResponse(bytes.readSigned(),bytes.readInteger(),bytes.readAll(),crypto);
  }
 catch (  IOException e) {
    throw new U2fBadInputException("String_Node_Str",e);
  }
}
Program: 58195
Project: 58195
Buggy source:
public static RawRegisterResponse fromBase64(String rawDataBase64,Crypto crypto) throws U2fBadInputException {
  ByteInputStream bytes=new ByteInputStream(U2fB64Encoding.decode(rawDataBase64));
  byte reservedByte=bytes.readSigned();
  if (reservedByte != REGISTRATION_RESERVED_BYTE_VALUE) {
    throw new U2fBadInputException("String_Node_Str" + REGISTRATION_RESERVED_BYTE_VALUE + "String_Node_Str"+ reservedByte);
  }
  try {
    return new RawRegisterResponse(bytes.read(65),bytes.read(bytes.readUnsigned()),CertificateParser.parseDer(bytes),bytes.readAll(),crypto);
  }
 catch (  CertificateException e) {
    throw new U2fBadInputException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static RawRegisterResponse fromBase64(String rawDataBase64,Crypto crypto) throws U2fBadInputException {
  ByteInputStream bytes=new ByteInputStream(U2fB64Encoding.decode(rawDataBase64));
  try {
    byte reservedByte=bytes.readSigned();
    if (reservedByte != REGISTRATION_RESERVED_BYTE_VALUE) {
      throw new U2fBadInputException("String_Node_Str" + REGISTRATION_RESERVED_BYTE_VALUE + "String_Node_Str"+ reservedByte);
    }
    return new RawRegisterResponse(bytes.read(65),bytes.read(bytes.readUnsigned()),CertificateParser.parseDer(bytes),bytes.readAll(),crypto);
  }
 catch (  CertificateException e) {
    throw new U2fBadInputException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new U2fBadInputException("String_Node_Str",e);
  }
}
Program: 58196
Project: 58196
Buggy source:
public byte[] read(int numberOfBytes){
  byte[] readBytes=new byte[numberOfBytes];
  try {
    readFully(readBytes);
  }
 catch (  IOException e) {
    throw new AssertionError();
  }
  return readBytes;
}

Fixed version (ground truth):
public byte[] read(int numberOfBytes) throws IOException {
  byte[] readBytes=new byte[numberOfBytes];
  readFully(readBytes);
  return readBytes;
}
Program: 58197
Project: 58197
Buggy source:
public int readUnsigned(){
  try {
    return readUnsignedByte();
  }
 catch (  IOException e) {
    throw new AssertionError();
  }
}

Fixed version (ground truth):
public int readUnsigned() throws IOException {
  return readUnsignedByte();
}
Program: 58198
Project: 58198
Buggy source:
public int readInteger(){
  try {
    return readInt();
  }
 catch (  IOException e) {
    throw new AssertionError();
  }
}

Fixed version (ground truth):
public int readInteger() throws IOException {
  return readInt();
}
Program: 58199
Project: 58199
Buggy source:
public byte readSigned(){
  try {
    return readByte();
  }
 catch (  IOException e) {
    throw new AssertionError();
  }
}

Fixed version (ground truth):
public byte readSigned() throws IOException {
  return readByte();
}
Program: 58200
Project: 58200
Buggy source:
public byte[] readAll(){
  try {
    byte[] readBytes=new byte[available()];
    readFully(readBytes);
    return readBytes;
  }
 catch (  IOException e) {
    throw new AssertionError();
  }
}

Fixed version (ground truth):
public byte[] readAll() throws IOException {
  byte[] readBytes=new byte[available()];
  readFully(readBytes);
  return readBytes;
}
Program: 58201
Project: 58201
Buggy source:
private byte[] stripMetaData(byte[] a){
  ByteInputStream bis=new ByteInputStream(a);
  bis.read(3);
  bis.read(bis.readUnsigned() + 1);
  int keyLength=bis.readUnsigned();
  bis.read(1);
  return bis.read(keyLength - 1);
}

Fixed version (ground truth):
private byte[] stripMetaData(byte[] a){
  ByteInputStream bis=new ByteInputStream(a);
  try {
    bis.read(3);
    bis.read(bis.readUnsigned() + 1);
    int keyLength=bis.readUnsigned();
    bis.read(1);
    return bis.read(keyLength - 1);
  }
 catch (  IOException e) {
    throw new AssertionError(e);
  }
}
Program: 58202
Project: 58202
Buggy source:
@Path("String_Node_Str") @GET public View startRegistration(@QueryParam("String_Node_Str") String username){
  RegisterRequestData registerRequestData=u2f.startRegistration(SERVER_ADDRESS,getRegistrations(username));
  storage.put(registerRequestData.getRequestId(),registerRequestData.toJson());
  return new RegistrationView(username,registerRequestData.toJson());
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public View startRegistration(@QueryParam("String_Node_Str") String username){
  RegisterRequestData registerRequestData=u2f.startRegistration(SERVER_ADDRESS,getRegistrations(username));
  storage.put(registerRequestData.getRequestId(),registerRequestData.toJson());
  return new RegistrationView(registerRequestData.toJson(),username);
}
Program: 58203
Project: 58203
Buggy source:
@Path("String_Node_Str") @POST public String finishAuthentication(@FormParam("String_Node_Str") String response,@FormParam("String_Node_Str") String username) throws U2fException {
  AuthenticateResponse authenticateResponse=AuthenticateResponse.fromJson(response);
  AuthenticateRequestData authenticateRequest=AuthenticateRequestData.fromJson(storage.get(authenticateResponse.getRequestId()));
  storage.remove(authenticateResponse.getRequestId());
  u2f.finishAuthentication(authenticateRequest,authenticateResponse,getRegistrations(username));
  return "String_Node_Str";
}

Fixed version (ground truth):
@Path("String_Node_Str") @POST public String finishAuthentication(@FormParam("String_Node_Str") String response,@FormParam("String_Node_Str") String username) throws U2fException {
  AuthenticateResponse authenticateResponse=AuthenticateResponse.fromJson(response);
  AuthenticateRequestData authenticateRequest=AuthenticateRequestData.fromJson(storage.get(authenticateResponse.getRequestId()));
  storage.remove(authenticateResponse.getRequestId());
  u2f.finishAuthentication(authenticateRequest,authenticateResponse,getRegistrations(username));
  return "String_Node_Str" + NAVIGATION_MENU;
}
Program: 58204
Project: 58204
Buggy source:
@Path("String_Node_Str") @POST public String finishRegistration(@FormParam("String_Node_Str") String response,@FormParam("String_Node_Str") String username) throws U2fException {
  RegisterResponse registerResponse=RegisterResponse.fromJson(response);
  RegisterRequestData registerRequestData=RegisterRequestData.fromJson(storage.get(registerResponse.getRequestId()));
  DeviceRegistration registration=u2f.finishRegistration(registerRequestData,registerResponse);
  addRegistration(username,registration);
  storage.remove(registerResponse.getRequestId());
  return "String_Node_Str" + registration + "String_Node_Str";
}

Fixed version (ground truth):
@Path("String_Node_Str") @POST public String finishRegistration(@FormParam("String_Node_Str") String response,@FormParam("String_Node_Str") String username) throws U2fException {
  RegisterResponse registerResponse=RegisterResponse.fromJson(response);
  RegisterRequestData registerRequestData=RegisterRequestData.fromJson(storage.get(registerResponse.getRequestId()));
  DeviceRegistration registration=u2f.finishRegistration(registerRequestData,registerResponse);
  addRegistration(username,registration);
  storage.remove(registerResponse.getRequestId());
  return "String_Node_Str" + registration + "String_Node_Str"+ NAVIGATION_MENU;
}
Program: 58205
Project: 58205
Buggy source:
public AuthenticationView(String data,String username){
  super("String_Node_Str");
  this.data=data;
  this.username=username;
}

Fixed version (ground truth):
public AuthenticationView(String data,String username){
  super("String_Node_Str");
  this.data=checkNotNull(data);
  this.username=checkNotNull(username);
}
Program: 58206
Project: 58206
Buggy source:
public RegistrationView(String username,String data){
  super("String_Node_Str");
  this.username=username;
  this.data=data;
}

Fixed version (ground truth):
public RegistrationView(String data,String username){
  super("String_Node_Str");
  this.data=checkNotNull(data);
  this.username=checkNotNull(username);
}
Program: 58207
Project: 58207
Buggy source:
public String toJsonWithAttestationCert(){
  return GSON.toJson(new DeviceWithoutCertificate(keyHandle,publicKey,counter));
}

Fixed version (ground truth):
public String toJsonWithAttestationCert(){
  return super.toJson();
}
Program: 58208
Project: 58208
Buggy source:
@Override public String toString(){
  return toJson();
}

Fixed version (ground truth):
@Override public String toString(){
  return super.toJson();
}
Program: 58209
Project: 58209
Buggy source:
private MasterPlaylist(List<PlaylistData> playlists,List<IFrameStreamInfo> iFramePlaylists,List<MediaData> mediaData,List<String> unknownTags){
  mPlaylists=playlists == null ? Collections.<PlaylistData>emptyList() : Collections.unmodifiableList(playlists);
  mIFramePlaylists=playlists == null ? Collections.<IFrameStreamInfo>emptyList() : Collections.unmodifiableList(iFramePlaylists);
  mMediaData=mediaData == null ? Collections.<MediaData>emptyList() : Collections.unmodifiableList(mediaData);
  mUnknownTags=unknownTags == null ? Collections.<String>emptyList() : Collections.unmodifiableList(unknownTags);
}

Fixed version (ground truth):
private MasterPlaylist(List<PlaylistData> playlists,List<IFrameStreamInfo> iFramePlaylists,List<MediaData> mediaData,List<String> unknownTags){
  mPlaylists=DataUtil.emptyOrUnmodifiable(playlists);
  mIFramePlaylists=DataUtil.emptyOrUnmodifiable(iFramePlaylists);
  mMediaData=DataUtil.emptyOrUnmodifiable(mediaData);
  mUnknownTags=DataUtil.emptyOrUnmodifiable(unknownTags);
}
Program: 58210
Project: 58210
Buggy source:
private MediaData(MediaType type,String uri,String groupId,String language,String associatedLanguage,String name,boolean isDefault,boolean isAutoSelect,boolean isForced,String inStreamId,List<String> characteristics){
  mType=type;
  mUri=uri;
  mGroupId=groupId;
  mLanguage=language;
  mAssociatedLanguage=associatedLanguage;
  mName=name;
  mDefault=isDefault;
  mAutoSelect=isAutoSelect;
  mForced=isForced;
  mInStreamId=inStreamId;
  mCharacteristics=characteristics == null ? Collections.<String>emptyList() : Collections.unmodifiableList(characteristics);
}

Fixed version (ground truth):
private MediaData(MediaType type,String uri,String groupId,String language,String associatedLanguage,String name,boolean isDefault,boolean isAutoSelect,boolean isForced,String inStreamId,List<String> characteristics){
  mType=type;
  mUri=uri;
  mGroupId=groupId;
  mLanguage=language;
  mAssociatedLanguage=associatedLanguage;
  mName=name;
  mDefault=isDefault;
  mAutoSelect=isAutoSelect;
  mForced=isForced;
  mInStreamId=inStreamId;
  mCharacteristics=DataUtil.emptyOrUnmodifiable(characteristics);
}
Program: 58211
Project: 58211
Buggy source:
private MediaPlaylist(List<TrackData> tracks,List<String> unknownTags,int targetDuration,StartData startData,int mediaSequenceNumber,boolean isIframesOnly,PlaylistType playlistType){
  mTracks=tracks == null ? Collections.<TrackData>emptyList() : Collections.unmodifiableList(tracks);
  mUnknownTags=unknownTags == null ? Collections.<String>emptyList() : Collections.unmodifiableList(unknownTags);
  mTargetDuration=targetDuration;
  mMediaSequenceNumber=mediaSequenceNumber;
  mIsIframesOnly=isIframesOnly;
  mStartData=startData;
  mPlaylistType=playlistType;
}

Fixed version (ground truth):
private MediaPlaylist(List<TrackData> tracks,List<String> unknownTags,int targetDuration,StartData startData,int mediaSequenceNumber,boolean isIframesOnly,PlaylistType playlistType){
  mTracks=DataUtil.emptyOrUnmodifiable(tracks);
  mUnknownTags=DataUtil.emptyOrUnmodifiable(unknownTags);
  mTargetDuration=targetDuration;
  mMediaSequenceNumber=mediaSequenceNumber;
  mIsIframesOnly=isIframesOnly;
  mStartData=startData;
  mPlaylistType=playlistType;
}
Program: 58213
Project: 58213
Buggy source:
/** 
 * Returns the exception caught during the last call on the proxied object in the current thread.
 * @param < E > This type parameter makes some type casts redundant.
 * @return Returns the exception caught during the last call on the proxiedobject in the current thread - if the call was made through a proxy that has been created via {@link #verifyException(Object,Class) verifyException()} or{@link #catchException(Object,Class) catchException()}. Returns null the proxy has not caught an exception. Returns null if the caught exception belongs to a class that is no longer  {@link ClassLoader loaded}.
 */
public static <E extends Exception>E caughtException(){
  return ExceptionHolder.<E>get();
}

Fixed version (ground truth):
/** 
 * Returns the exception caught during the last call on the proxied object in the current thread.
 * @param < E > This type parameter makes some type casts redundant.
 * @return Returns the exception caught during the last call on the proxiedobject in the current thread - if the call was made through a proxy that has been created via {@link #verifyException(Object,Class) verifyException()} or{@link #catchException(Object,Class) catchException()}. Returns null the proxy has not caught an exception. Returns null if the caught exception belongs to a class that is no longer  {@link ClassLoader loaded}.
 */
public static Exception caughtException(){
  return ExceptionHolder.get();
}
Program: 58214
Project: 58214
Buggy source:
public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  try {
    return method.invoke(target,args);
  }
 catch (  Exception e) {
    if (e instanceof InvocationTargetException) {
      e=(Exception)((InvocationTargetException)e).getTargetException();
    }
    throw e;
  }
}

Fixed version (ground truth):
public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  try {
    return method.invoke(target,args);
  }
 catch (  InvocationTargetException e) {
    throw e.getTargetException();
  }
}
Program: 58215
Project: 58215
Buggy source:
public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  beforeInvocation();
  try {
    Object retval=method.invoke(target,args);
    return afterInvocation(retval);
  }
 catch (  Exception e) {
    if (e instanceof InvocationTargetException) {
      e=(Exception)((InvocationTargetException)e).getTargetException();
    }
    return afterInvocationThrowsException(e,method);
  }
}

Fixed version (ground truth):
public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  beforeInvocation();
  try {
    Object retval=method.invoke(target,args);
    return afterInvocation(retval);
  }
 catch (  InvocationTargetException e) {
    Throwable cause=e.getTargetException();
    if (!(cause instanceof Exception)) {
      throw cause;
    }
 else {
      return afterInvocationThrowsException((Exception)cause,method);
    }
  }
}
Program: 58216
Project: 58216
Buggy source:
@SuppressWarnings("String_Node_Str") public <T,E extends Exception>T createProxy(T obj,Class<E> exceptionClazz,boolean assertException){
  InvocationHandler invocationHandler=new ExceptionProcessingJdkInvocationHandler<E>(obj,exceptionClazz,assertException);
  Set<Class<?>> interfaces=new HashSet<Class<?>>();
  Class<?> clazz=obj.getClass();
  while (true) {
    for (    Class<?> interfaze : clazz.getInterfaces()) {
      interfaces.add(interfaze);
    }
    if (clazz.getSuperclass() == null) {
      break;
    }
    clazz=clazz.getSuperclass();
  }
  return (T)Proxy.newProxyInstance(obj.getClass().getClassLoader(),interfaces.toArray(new Class<?>[interfaces.size()]),invocationHandler);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T,E extends Exception>T createProxy(T obj,Class<E> exceptionClazz,boolean assertException){
  InvocationHandler invocationHandler=new ExceptionProcessingJdkInvocationHandler<E>(obj,exceptionClazz,assertException);
  Set<Class<?>> interfaces=new HashSet<Class<?>>();
  Class<?> clazz=obj.getClass();
  while (true) {
    for (    Class<?> interfaze : clazz.getInterfaces()) {
      interfaces.add(interfaze);
    }
    if (clazz.getSuperclass() == null) {
      break;
    }
    clazz=clazz.getSuperclass();
  }
  interfaces.add(JdkProxy.class);
  ClassLoader classLoader;
  if (JdkProxy.class.getClassLoader().equals(obj.getClass().getClassLoader())) {
    classLoader=obj.getClass().getClassLoader();
  }
 else {
    classLoader=new SearchingClassLoader(JdkProxy.class.getClassLoader(),obj.getClass().getClassLoader());
  }
  return (T)Proxy.newProxyInstance(classLoader,interfaces.toArray(new Class<?>[interfaces.size()]),invocationHandler);
}
Program: 58217
Project: 58217
Buggy source:
@SuppressWarnings("String_Node_Str") public <T,E extends Exception>T createProxy(T obj,Class<E> exceptionClazz,boolean assertException){
  if (obj == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (exceptionClazz == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!ClassImposterizer.INSTANCE.canImposterise(obj.getClass())) {
    return fallbackProxyFactory.createProxy(obj,exceptionClazz,assertException);
  }
  MethodInterceptor interceptor=new ExceptionProcessingMockitoCglibMethodInterceptor<E>(obj,exceptionClazz,assertException);
  T proxy;
  try {
    proxy=(T)ClassImposterizer.INSTANCE.imposterise(interceptor,obj.getClass());
  }
 catch (  MockitoException e) {
    return fallbackProxyFactory.createProxy(obj,exceptionClazz,assertException);
  }
  new LenientCopyTool().copyToMock(obj,proxy);
  return proxy;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T,E extends Exception>T createProxy(T obj,Class<E> exceptionClazz,boolean assertException){
  if (obj == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (exceptionClazz == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!ClassImposterizer.INSTANCE.canImposterise(obj.getClass())) {
    return fallbackProxyFactory.createProxy(obj,exceptionClazz,assertException);
  }
  MethodInterceptor interceptor=new ExceptionProcessingMockitoCglibMethodInterceptor<E>(obj,exceptionClazz,assertException);
  T proxy;
  try {
    proxy=(T)ClassImposterizer.INSTANCE.imposterise(interceptor,obj.getClass(),CglibProxy.class);
  }
 catch (  MockitoException e) {
    return fallbackProxyFactory.createProxy(obj,exceptionClazz,assertException);
  }
  new LenientCopyTool().copyToMock(obj,proxy);
  return proxy;
}
Program: 58219
Project: 58219
Buggy source:
@Override public void onViewCreated(final View view,final Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mRecyclerView=(RecyclerView)view.findViewById(android.R.id.list);
  mRecyclerView.setLayoutManager(new XDALinerLayoutManager(getActivity()));
  mRecyclerView.setAdapter(mAdapter);
  ViewCompat.setOverScrollMode(mRecyclerView,ViewCompat.OVER_SCROLL_NEVER);
  mRefreshLayout=(XDARefreshLayout)view.findViewById(R.id.swipe_refresh_layout);
  mRefreshLayout.setXDAColourScheme();
  mRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener(){
    @Override public void onRefresh(){
      final Bundle bundle=new Bundle();
      bundle.putBoolean(RetrofitClient.FORCE_RELOAD,true);
      getLoaderManager().restartLoader(0,bundle,ForumFragment.this);
    }
  }
);
  mClient.getBus().register(mEventHandler);
  mModeHelper.setRecyclerView(mRecyclerView);
  final ActionBar bar=getActivity().getActionBar();
  bar.show();
  bar.setTitle(mForumTitle);
  bar.setSubtitle(mParentForumTitle);
  if (mAdapter.getItemCount() == 0) {
    getLoaderManager().initLoader(0,null,this);
    mRefreshLayout.setRefreshing(true);
  }
}

Fixed version (ground truth):
@Override public void onViewCreated(final View view,final Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  mRecyclerView=(RecyclerView)view.findViewById(android.R.id.list);
  mRecyclerView.setLayoutManager(new XDALinerLayoutManager(getActivity()));
  mRecyclerView.setAdapter(mAdapter);
  ViewCompat.setOverScrollMode(mRecyclerView,ViewCompat.OVER_SCROLL_NEVER);
  mRefreshLayout=(XDARefreshLayout)view.findViewById(R.id.swipe_refresh_layout);
  mRefreshLayout.setXDAColourScheme();
  mRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener(){
    @Override public void onRefresh(){
      final Bundle bundle=new Bundle();
      bundle.putBoolean(RetrofitClient.FORCE_RELOAD,true);
      getLoaderManager().restartLoader(0,bundle,ForumFragment.this);
    }
  }
);
  mClient.getBus().register(mEventHandler);
  mModeHelper.setRecyclerView(mRecyclerView);
  final ActionBar bar=getActivity().getActionBar();
  bar.show();
  bar.setTitle(mForumTitle);
  bar.setSubtitle(mParentForumTitle);
  if (mForumType == ForumType.CHILD) {
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    bar.setListNavigationCallbacks(mSpinnerAdapter,mSpinnerAdapter);
    bar.setSelectedNavigationItem(mSpinnerAdapter.getCount() - 1);
  }
  if (mAdapter.getItemCount() == 0) {
    getLoaderManager().initLoader(0,null,this);
    mRefreshLayout.setRefreshing(true);
  }
}
Program: 58220
Project: 58220
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  setHasOptionsMenu(true);
  final ActionBar bar=getActivity().getActionBar();
  bar.show();
  bar.setTitle(R.string.subscribed);
  bar.setSubtitle(null);
  final ViewPager pager=(ViewPager)view.findViewById(R.id.forum_view_pager);
  pager.setOffscreenPageLimit(3);
  pager.setAdapter(mFragmentAdapter);
  final TabLayout slidingTabLayout=(TabLayout)view.findViewById(R.id.pager_tab_strip);
  slidingTabLayout.setSelectedIndicatorColors(getResources().getColor(android.R.color.white));
  slidingTabLayout.setViewPager(pager);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  setHasOptionsMenu(true);
  final ActionBar bar=getActivity().getActionBar();
  bar.show();
  bar.setTitle(R.string.subscribed);
  bar.setSubtitle(null);
  bar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
  final ViewPager pager=(ViewPager)view.findViewById(R.id.forum_view_pager);
  pager.setOffscreenPageLimit(3);
  pager.setAdapter(mFragmentAdapter);
  final TabLayout slidingTabLayout=(TabLayout)view.findViewById(R.id.pager_tab_strip);
  slidingTabLayout.setSelectedIndicatorColors(getResources().getColor(android.R.color.white));
  slidingTabLayout.setViewPager(pager);
}
Program: 58221
Project: 58221
Buggy source:
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mThreadClient=RetrofitThreadClient.getClient(getActivity());
  final UnifiedThreadFragmentActionModeHelper helper=new UnifiedThreadFragmentActionModeHelper(getActivity(),mThreadClient);
  mModeHelper=new ActionModeHelper(getActivity(),helper,new ThreadClickListener(),ActionModeHelper.SelectionMode.SINGLE);
  mAdapter=new UnifiedThreadAdapter(getActivity(),mModeHelper,mModeHelper,mModeHelper);
  mThreadEventHelper=new ThreadEventHelper(getActivity(),mAdapter);
  helper.setAdapter(mAdapter);
  helper.setModeHelper(mModeHelper);
  mForumId=getArguments().getInt(FORUM_ID_ARGUMENT,0);
  mForumTitle=getArguments().getString(FORUM_TITLE_ARGUMENT,null);
  mParentForumTitle=getArguments().getString(PARENT_FORUM_TITLE_ARGUMENT,null);
  mHierarchy=getArguments().getStringArrayList(FORUM_HIERARCHY_ARGUMENT);
}

Fixed version (ground truth):
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mThreadClient=RetrofitThreadClient.getClient(getActivity());
  final UnifiedThreadFragmentActionModeHelper helper=new UnifiedThreadFragmentActionModeHelper(getActivity(),mThreadClient);
  mModeHelper=new ActionModeHelper(getActivity(),helper,new ThreadClickListener(),ActionModeHelper.SelectionMode.SINGLE);
  mAdapter=new UnifiedThreadAdapter(getActivity(),mModeHelper,mModeHelper,mModeHelper);
  mThreadEventHelper=new ThreadEventHelper(getActivity(),mAdapter);
  helper.setAdapter(mAdapter);
  helper.setModeHelper(mModeHelper);
  mForumType=(ForumType)getArguments().getSerializable(FORUM_TYPE);
  mForumId=getArguments().getInt(FORUM_ID_ARGUMENT,0);
  mForumTitle=getArguments().getString(FORUM_TITLE_ARGUMENT,null);
  mParentForumTitle=getArguments().getString(PARENT_FORUM_TITLE_ARGUMENT,null);
  mHierarchy=getArguments().getStringArrayList(FORUM_HIERARCHY_ARGUMENT);
  mSpinnerAdapter=new HierarchySpinnerAdapter(getActivity(),LayoutInflater.from(getActivity()),mHierarchy,getFragmentManager());
}