nus-yam/ex-repair huggingface dataset:
Program: 133786
Project: 133786
Buggy source:
@Override public void execute(Tuple input){
  Source src=parseComponentId(input.getSourceComponent());
  if (src == Source.GACD) {
    avg=input.getDoubleByField(Field.AVERAGE);
  }
 else {
    CallDetailRecord cdr=(CallDetailRecord)input.getValueByField(Field.RECORD);
    String number=input.getString(0);
    long timestamp=input.getLong(1);
    double rate=input.getDouble(2);
    String key=String.format("String_Node_Str",number,timestamp);
    if (map.containsKey(key)) {
      Entry e=map.get(key);
      e.set(src,rate);
      if (e.isFull()) {
        double ratio=(e.get(Source.CT24) / e.get(Source.ECR24)) / avg;
        double score=score(thresholdMin,thresholdMax,ratio);
        LOG.info(String.format("String_Node_Str",thresholdMin,thresholdMax,e.get(Source.CT24),e.get(Source.ECR24),avg,ratio,score));
        collector.emit(new Values(number,timestamp,score,cdr));
        map.remove(key);
      }
 else {
        LOG.warn(String.format("String_Node_Str",input.getSourceComponent(),e.toString()));
      }
    }
 else {
      Entry e=new Entry(cdr);
      e.set(src,rate);
      map.put(key,e);
    }
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple input){
  Source src=parseComponentId(input.getSourceComponent());
  if (src == Source.GACD) {
    avg=input.getDoubleByField(Field.AVERAGE);
  }
 else {
    CallDetailRecord cdr=(CallDetailRecord)input.getValueByField(Field.RECORD);
    String number=input.getString(0);
    long timestamp=input.getLong(1);
    double rate=input.getDouble(2);
    String key=String.format("String_Node_Str",number,timestamp);
    if (map.containsKey(key)) {
      Entry e=map.get(key);
      e.set(src,rate);
      if (e.isFull()) {
        double ratio=(e.get(Source.CT24) / e.get(Source.ECR24)) / avg;
        double score=score(thresholdMin,thresholdMax,ratio);
        LOG.debug(String.format("String_Node_Str",thresholdMin,thresholdMax,e.get(Source.CT24),e.get(Source.ECR24),avg,ratio,score));
        collector.emit(new Values(number,timestamp,score,cdr));
        map.remove(key);
      }
 else {
        LOG.warn(String.format("String_Node_Str",input.getSourceComponent(),e.toString()));
      }
    }
 else {
      Entry e=new Entry(cdr);
      e.set(src,rate);
      map.put(key,e);
    }
  }
}
Program: 133787
Project: 133787
Buggy source:
@Override public void execute(Tuple input){
  CallDetailRecord cdr=(CallDetailRecord)input.getValue(3);
  String number=input.getString(0);
  long timestamp=input.getLong(1);
  double rate=input.getDouble(2);
  String key=String.format("String_Node_Str",number,timestamp);
  Source src=parseComponentId(input.getSourceComponent());
  if (map.containsKey(key)) {
    Entry e=map.get(key);
    e.set(src,rate);
    if (e.isFull()) {
      double ratio=(e.get(Source.ECR) / e.get(Source.RCR));
      double score=score(thresholdMin,thresholdMax,ratio);
      LOG.info(String.format("String_Node_Str",thresholdMin,thresholdMax,e.get(Source.ECR),e.get(Source.RCR),ratio,score));
      collector.emit(new Values(number,timestamp,score,cdr));
      map.remove(key);
    }
 else {
      LOG.warn(String.format("String_Node_Str",input.getSourceComponent(),e.toString()));
    }
  }
 else {
    Entry e=new Entry(cdr);
    e.set(src,rate);
    map.put(key,e);
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple input){
  CallDetailRecord cdr=(CallDetailRecord)input.getValue(3);
  String number=input.getString(0);
  long timestamp=input.getLong(1);
  double rate=input.getDouble(2);
  String key=String.format("String_Node_Str",number,timestamp);
  Source src=parseComponentId(input.getSourceComponent());
  if (map.containsKey(key)) {
    Entry e=map.get(key);
    e.set(src,rate);
    if (e.isFull()) {
      double ratio=(e.get(Source.ECR) / e.get(Source.RCR));
      double score=score(thresholdMin,thresholdMax,ratio);
      LOG.debug(String.format("String_Node_Str",thresholdMin,thresholdMax,e.get(Source.ECR),e.get(Source.RCR),ratio,score));
      collector.emit(new Values(number,timestamp,score,cdr));
      map.remove(key);
    }
 else {
      LOG.warn(String.format("String_Node_Str",input.getSourceComponent(),e.toString()));
    }
  }
 else {
    Entry e=new Entry(cdr);
    e.set(src,rate);
    map.put(key,e);
  }
}
Program: 133788
Project: 133788
Buggy source:
@Override public void execute(Tuple input){
  CallDetailRecord cdr=(CallDetailRecord)input.getValueByField(Field.RECORD);
  Source src=parseComponentId(input.getSourceComponent());
  String caller=cdr.getCallingNumber();
  long timestamp=cdr.getAnswerTime().getMillis() / 1000;
  double score=input.getDouble(2);
  String key=String.format("String_Node_Str",caller,timestamp);
  if (map.containsKey(key)) {
    Entry e=map.get(key);
    if (e.isFull()) {
      double mainScore=sum(e.getValues(),weights);
      LOG.info(String.format("String_Node_Str",mainScore,Arrays.toString(e.getValues())));
      collector.emit(new Values(caller,timestamp,mainScore,cdr));
    }
 else {
      e.set(src,score);
    }
  }
 else {
    Entry e=new Entry(cdr);
    e.set(src,score);
    map.put(key,e);
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple input){
  CallDetailRecord cdr=(CallDetailRecord)input.getValueByField(Field.RECORD);
  Source src=parseComponentId(input.getSourceComponent());
  String caller=cdr.getCallingNumber();
  long timestamp=cdr.getAnswerTime().getMillis() / 1000;
  double score=input.getDouble(2);
  String key=String.format("String_Node_Str",caller,timestamp);
  if (map.containsKey(key)) {
    Entry e=map.get(key);
    if (e.isFull()) {
      double mainScore=sum(e.getValues(),weights);
      LOG.debug(String.format("String_Node_Str",mainScore,Arrays.toString(e.getValues())));
      collector.emit(new Values(caller,timestamp,mainScore,cdr));
    }
 else {
      e.set(src,score);
    }
  }
 else {
    Entry e=new Entry(cdr);
    e.set(src,score);
    map.put(key,e);
  }
}
Program: 133789
Project: 133789
Buggy source:
@Override public void execute(Tuple input){
  CallDetailRecord cdr=(CallDetailRecord)input.getValue(3);
  String number=input.getString(0);
  long timestamp=input.getLong(1);
  double rate=input.getDouble(2);
  String key=String.format("String_Node_Str",number,timestamp);
  Source src=parseComponentId(input.getSourceComponent());
  if (map.containsKey(key)) {
    Entry e=map.get(key);
    e.set(src,rate);
    if (e.isFull()) {
      double ratio=(e.get(Source.ENCR) / e.get(Source.ECR));
      double score=score(thresholdMin,thresholdMax,ratio);
      LOG.info(String.format("String_Node_Str",thresholdMin,thresholdMax,e.get(Source.ENCR),e.get(Source.ECR),ratio,score));
      collector.emit(new Values(number,timestamp,score,cdr));
      map.remove(key);
    }
 else {
      LOG.warn(String.format("String_Node_Str",input.getSourceComponent(),e.toString()));
    }
  }
 else {
    Entry e=new Entry(cdr);
    e.set(src,rate);
    map.put(key,e);
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple input){
  CallDetailRecord cdr=(CallDetailRecord)input.getValue(3);
  String number=input.getString(0);
  long timestamp=input.getLong(1);
  double rate=input.getDouble(2);
  String key=String.format("String_Node_Str",number,timestamp);
  Source src=parseComponentId(input.getSourceComponent());
  if (map.containsKey(key)) {
    Entry e=map.get(key);
    e.set(src,rate);
    if (e.isFull()) {
      double ratio=(e.get(Source.ENCR) / e.get(Source.ECR));
      double score=score(thresholdMin,thresholdMax,ratio);
      LOG.debug(String.format("String_Node_Str",thresholdMin,thresholdMax,e.get(Source.ENCR),e.get(Source.ECR),ratio,score));
      collector.emit(new Values(number,timestamp,score,cdr));
      map.remove(key);
    }
 else {
      LOG.warn(String.format("String_Node_Str",input.getSourceComponent(),e.toString()));
    }
  }
 else {
    Entry e=new Entry(cdr);
    e.set(src,rate);
    map.put(key,e);
  }
}
Program: 133790
Project: 133790
Buggy source:
@Override public void initialize(){
  varDetectThreads=config.getInt(Conf.VAR_DETECT_THREADS,1);
  ecrThreads=config.getInt(Conf.ECR_THREADS,1);
  rcrThreads=config.getInt(Conf.RCR_THREADS,1);
  encrThreads=config.getInt(Conf.ENCR_THREADS,1);
  ecr24Threads=config.getInt(Conf.ECR24_THREADS,1);
  ct24Threads=config.getInt(Conf.CT24_THREADS,1);
  fofirThreads=config.getInt(Conf.FOFIR_THREADS,1);
  urlThreads=config.getInt(Conf.URL_THREADS,1);
  acdThreads=config.getInt(Conf.ACD_THREADS,1);
  scorerThreads=config.getInt(Conf.SCORER_THREADS,1);
}

Fixed version (ground truth):
@Override public void initialize(){
  super.initialize();
  varDetectThreads=config.getInt(Conf.VAR_DETECT_THREADS,1);
  ecrThreads=config.getInt(Conf.ECR_THREADS,1);
  rcrThreads=config.getInt(Conf.RCR_THREADS,1);
  encrThreads=config.getInt(Conf.ENCR_THREADS,1);
  ecr24Threads=config.getInt(Conf.ECR24_THREADS,1);
  ct24Threads=config.getInt(Conf.CT24_THREADS,1);
  fofirThreads=config.getInt(Conf.FOFIR_THREADS,1);
  urlThreads=config.getInt(Conf.URL_THREADS,1);
  acdThreads=config.getInt(Conf.ACD_THREADS,1);
  scorerThreads=config.getInt(Conf.SCORER_THREADS,1);
}
Program: 133791
Project: 133791
Buggy source:
@Override public void initialize(){
  String shapeFile=config.getString(Conf.MAP_MATCHER_SHAPEFILE);
  latMin=config.getDouble(Conf.MAP_MATCHER_LAT_MIN);
  latMax=config.getDouble(Conf.MAP_MATCHER_LAT_MAX);
  lonMin=config.getDouble(Conf.MAP_MATCHER_LON_MIN);
  lonMax=config.getDouble(Conf.MAP_MATCHER_LON_MAX);
  try {
    sectors=new RoadGridList(shapeFile);
  }
 catch (  SQLException|IOException ex) {
    LOG.error("String_Node_Str",ex);
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void initialize(){
  String shapeFile=config.getString(Conf.MAP_MATCHER_SHAPEFILE);
  latMin=config.getDouble(Conf.MAP_MATCHER_LAT_MIN);
  latMax=config.getDouble(Conf.MAP_MATCHER_LAT_MAX);
  lonMin=config.getDouble(Conf.MAP_MATCHER_LON_MIN);
  lonMax=config.getDouble(Conf.MAP_MATCHER_LON_MAX);
  try {
    sectors=new RoadGridList(config,shapeFile);
  }
 catch (  SQLException|IOException ex) {
    LOG.error("String_Node_Str",ex);
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 133792
Project: 133792
Buggy source:
@Override public void execute(Tuple input){
  try {
    int speed=input.getIntegerByField(Field.SPEED);
    int bearing=input.getIntegerByField(Field.BEARING);
    double latitude=input.getDoubleByField(Field.LATITUDE);
    double longitude=input.getDoubleByField(Field.LONGITUDE);
    if (speed <= 0)     return;
    if (longitude > lonMin || longitude < lonMax || latitude > latMin || latitude < latMax)     return;
    GPSRecord record=new GPSRecord(longitude,latitude,speed,bearing);
    int roadID=sectors.fetchRoadID(record);
    if (roadID != -1) {
      List<Object> values=input.getValues();
      values.add(roadID);
      collector.emit(values);
    }
    collector.ack(input);
  }
 catch (  SQLException ex) {
    LOG.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple input){
  try {
    int speed=input.getIntegerByField(Field.SPEED);
    int bearing=input.getIntegerByField(Field.BEARING);
    double latitude=input.getDoubleByField(Field.LATITUDE);
    double longitude=input.getDoubleByField(Field.LONGITUDE);
    if (speed <= 0)     return;
    if (longitude > lonMax || longitude < lonMin || latitude > latMax || latitude < latMin)     return;
    GPSRecord record=new GPSRecord(longitude,latitude,speed,bearing);
    int roadID=sectors.fetchRoadID(record);
    if (roadID != -1) {
      List<Object> values=input.getValues();
      values.add(roadID);
      collector.emit(values);
    }
    collector.ack(input);
  }
 catch (  SQLException ex) {
    LOG.error("String_Node_Str",ex);
  }
}
Program: 133793
Project: 133793
Buggy source:
/** 
 * Opens the next file from the index. If there's multiple instances of the spout, it will read only a portion of the files.
 */
protected void openNextFile(){
  while (++curFileIndex % numTasks != taskId) {
  }
  if (curFileIndex < files.length) {
    try {
      File file=files[curFileIndex];
      scanner=new Scanner(file);
      curLineIndex=0;
      LOG.info("String_Node_Str",file.getName(),FileUtils.humanReadableByteCount(file.length()));
    }
 catch (    FileNotFoundException ex) {
      LOG.error(String.format("String_Node_Str",files[curFileIndex]),ex);
      throw new IllegalStateException("String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
/** 
 * Opens the next file from the index. If there's multiple instances of the spout, it will read only a portion of the files.
 */
protected void openNextFile(){
  while ((curFileIndex + 1) % numTasks != taskId) {
    curFileIndex++;
  }
  if (curFileIndex < files.length) {
    try {
      File file=files[curFileIndex];
      scanner=new Scanner(file);
      curLineIndex=0;
      LOG.info("String_Node_Str",file.getName(),FileUtils.humanReadableByteCount(file.length()));
    }
 catch (    FileNotFoundException ex) {
      LOG.error(String.format("String_Node_Str",files[curFileIndex]),ex);
      throw new IllegalStateException("String_Node_Str",ex);
    }
  }
}
Program: 133794
Project: 133794
Buggy source:
@Override public final void execute(Tuple tuple){
  if (TupleUtils.isTickTuple(tuple)) {
    getLogger().debug("String_Node_Str");
    emitRankings();
  }
 else {
    updateRankingsWithTuple(tuple);
  }
}

Fixed version (ground truth):
@Override public final void execute(Tuple tuple){
  if (TupleUtils.isTickTuple(tuple)) {
    getLogger().info("String_Node_Str");
    emitRankings();
  }
 else {
    updateRankingsWithTuple(tuple);
  }
}
Program: 133795
Project: 133795
Buggy source:
@Override public void execute(Tuple tuple){
  if (TupleUtils.isTickTuple(tuple)) {
    LOG.debug("String_Node_Str");
    emitCurrentWindowCounts();
  }
 else {
    countObjAndAck(tuple);
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple tuple){
  if (TupleUtils.isTickTuple(tuple)) {
    LOG.info("String_Node_Str");
    emitCurrentWindowCounts();
  }
 else {
    countObjAndAck(tuple);
  }
}
Program: 133796
Project: 133796
Buggy source:
@Override public void initialize(){
  super.initialize();
  topicExtractorThreads=config.getInt(Conf.TOPIC_EXTRACTOR_THREADS,1);
  counterThreads=config.getInt(Conf.COUNTER_THREADS,1);
  iRankerThreads=config.getInt(Conf.IRANKER_THREADS,1);
  tRankerThreads=config.getInt(Conf.IRANKER_THREADS,1);
}

Fixed version (ground truth):
@Override public void initialize(){
  super.initialize();
  topicExtractorThreads=config.getInt(Conf.TOPIC_EXTRACTOR_THREADS,1);
  counterThreads=config.getInt(Conf.COUNTER_THREADS,1);
  iRankerThreads=config.getInt(Conf.IRANKER_THREADS,1);
  tRankerThreads=config.getInt(Conf.IRANKER_THREADS,1);
  topn=config.getInt(Conf.TOPN,10);
}
Program: 133797
Project: 133797
Buggy source:
public static void progressAllCleanup(){
  for (  TempBlock block : FROZEN_BLOCKS.keySet()) {
    Player player=FROZEN_BLOCKS.get(block);
    BendingPlayer bPlayer=BendingPlayer.getBendingPlayer(player);
    if (bPlayer == null) {
      return;
    }
 else     if (block.getBlock().getType() != Material.ICE) {
      FROZEN_BLOCKS.remove(block);
      continue;
    }
 else     if (!player.isOnline()) {
      thaw(block);
      continue;
    }
 else     if (block.getBlock().getWorld() != player.getWorld()) {
      thaw(block);
      continue;
    }
 else     if (block.getLocation().distanceSquared(player.getLocation()) > CLEANUP_RANGE * CLEANUP_RANGE || !bPlayer.canBendIgnoreBindsCooldowns(getAbility("String_Node_Str"))) {
      thaw(block);
    }
  }
}

Fixed version (ground truth):
public static void progressAllCleanup(){
  for (  TempBlock block : FROZEN_BLOCKS.keySet()) {
    Player player=FROZEN_BLOCKS.get(block);
    BendingPlayer bPlayer=BendingPlayer.getBendingPlayer(player);
    if (bPlayer == null) {
      FROZEN_BLOCKS.remove(block);
      continue;
    }
 else     if (block.getBlock().getType() != Material.ICE) {
      FROZEN_BLOCKS.remove(block);
      continue;
    }
 else     if (!player.isOnline()) {
      thaw(block);
      continue;
    }
 else     if (block.getBlock().getWorld() != player.getWorld()) {
      thaw(block);
      continue;
    }
 else     if (block.getLocation().distanceSquared(player.getLocation()) > CLEANUP_RANGE * CLEANUP_RANGE || !bPlayer.canBendIgnoreBindsCooldowns(getAbility("String_Node_Str"))) {
      thaw(block);
    }
  }
}
Program: 133798
Project: 133798
Buggy source:
public void revertFrozenBlocks(){
  if (active_types.contains(PhaseChangeType.FREEZE)) {
    for (    TempBlock tb : blocks) {
      tb.revertBlock();
    }
    blocks.clear();
    PLAYER_BY_BLOCK.remove(player);
  }
}

Fixed version (ground truth):
public void revertFrozenBlocks(){
  if (active_types.contains(PhaseChangeType.FREEZE)) {
    for (    TempBlock tb : blocks) {
      PLAYER_BY_BLOCK.remove(tb);
      tb.revertBlock();
    }
    blocks.clear();
  }
}
Program: 133799
Project: 133799
Buggy source:
public static void sendBrandingMessage(CommandSender sender,String message){
  ChatColor color=ChatColor.valueOf(ConfigManager.languageConfig.get().getString("String_Node_Str").toUpperCase());
  color=color == null ? ChatColor.GOLD : color;
  String prefix=ChatColor.translateAlternateColorCodes('&',ConfigManager.languageConfig.get().getString("String_Node_Str")) + color + "String_Node_Str"+ ChatColor.translateAlternateColorCodes('&',ConfigManager.languageConfig.get().getString("String_Node_Str"));
  if (!(sender instanceof Player)) {
    sender.sendMessage(prefix + message);
  }
 else {
    TextComponent prefixComponent=new TextComponent(prefix);
    TextComponent messageComponent=new TextComponent(message);
    prefixComponent.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,"String_Node_Str"));
    prefixComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new ComponentBuilder(color + "String_Node_Str" + color+ "String_Node_Str").create()));
    ((Player)sender).spigot().sendMessage(new TextComponent(prefixComponent,messageComponent));
  }
}

Fixed version (ground truth):
public static void sendBrandingMessage(CommandSender sender,String message){
  ChatColor color=ChatColor.valueOf(ConfigManager.languageConfig.get().getString("String_Node_Str").toUpperCase());
  color=color == null ? ChatColor.GOLD : color;
  String prefix=ChatColor.translateAlternateColorCodes('&',ConfigManager.languageConfig.get().getString("String_Node_Str")) + color + "String_Node_Str"+ ChatColor.translateAlternateColorCodes('&',ConfigManager.languageConfig.get().getString("String_Node_Str"));
  if (!(sender instanceof Player)) {
    sender.sendMessage(prefix + message);
  }
 else {
    TextComponent prefixComponent=new TextComponent(prefix);
    prefixComponent.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,"String_Node_Str"));
    prefixComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new ComponentBuilder(color + "String_Node_Str" + color+ "String_Node_Str").create()));
    String lastColor="String_Node_Str";
    String newMessage="String_Node_Str";
    for (int i=0; i < message.split("String_Node_Str").length; i++) {
      String c=message.split("String_Node_Str")[i];
      if (c.equalsIgnoreCase("String_Node_Str")) {
        lastColor="String_Node_Str" + message.split("String_Node_Str")[i + 1];
        newMessage=newMessage + c;
      }
 else       if (c.equalsIgnoreCase("String_Node_Str")) {
        newMessage=newMessage + "String_Node_Str" + lastColor;
      }
 else {
        newMessage=newMessage + c;
      }
    }
    TextComponent messageComponent=new TextComponent(newMessage);
    ((Player)sender).spigot().sendMessage(new TextComponent(prefixComponent,messageComponent));
  }
}
Program: 133800
Project: 133800
Buggy source:
/** 
 * Removes this ability instance instantly. This method does not cause any block animation, it just removes everything.
 */
@Override public void remove(){
  super.remove();
  for (int i=affectedBlocks.size() - 1; i > -1; i--) {
    final TempBlock tblock=affectedBlocks.get(i);
    tblock.revertBlock();
    if (TEMP_LAVA_BLOCKS.values().contains(tblock)) {
      affectedBlocks.remove(tblock);
      TEMP_LAVA_BLOCKS.remove(TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.get(tblock));
      TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.remove(tblock);
    }
    if (TEMP_LAND_BLOCKS.values().contains(tblock)) {
      affectedBlocks.remove(tblock);
      TEMP_LAND_BLOCKS.remove(tblock);
    }
  }
  for (  BukkitRunnable task : tasks) {
    task.cancel();
  }
}

Fixed version (ground truth):
/** 
 * Removes this ability instance instantly. This method does not cause any block animation, it just removes everything.
 */
@Override public void remove(){
  super.remove();
  for (int i=affectedBlocks.size() - 1; i > -1; i--) {
    final TempBlock tblock=affectedBlocks.get(i);
    tblock.revertBlock();
    if (TEMP_LAVA_BLOCKS.values().contains(tblock)) {
      affectedBlocks.remove(tblock);
      TEMP_LAVA_BLOCKS.remove(TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.get(tblock));
      TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.remove(tblock);
    }
    if (TEMP_LAND_BLOCKS.values().contains(tblock)) {
      affectedBlocks.remove(tblock);
      TEMP_LAND_BLOCKS.remove(TEMP_LAND_BLOCKS_BY_TEMPBLOCK.get(tblock));
      TEMP_LAND_BLOCKS_BY_TEMPBLOCK.remove(tblock);
    }
  }
  for (  BukkitRunnable task : tasks) {
    task.cancel();
  }
}
Program: 133802
Project: 133802
Buggy source:
/** 
 * Creates a LavaBlock and appends the TempBlock to our arraylist called TEMP_LAVA_BLOCKS. If ALLOW_NATURAL_FLOW is turned on then this method will remove the block from TempBlock.instances, which will allow the lava to flow naturally.
 * @param block the block that will be turned to lava
 */
public void createLava(Block block){
  if (isEarth(block) || isSand(block) || isMetal(block)) {
    if (isPlant(block.getRelative(BlockFace.UP)) || isSnow(block.getRelative(BlockFace.UP))) {
      Block above=block.getRelative(BlockFace.UP);
      Block above2=above.getRelative(BlockFace.UP);
      if (isPlant(above) || isSnow(above)) {
        TempBlock tb=new TempBlock(above,Material.AIR,(byte)0);
        TEMP_AIR_BLOCKS.put(above,tb);
        affectedBlocks.add(tb);
        if (isPlant(above2) && above2.getType().equals(Material.DOUBLE_PLANT)) {
          TempBlock tb2=new TempBlock(above2,Material.AIR,(byte)0);
          TEMP_AIR_BLOCKS.put(above2,tb2);
          affectedBlocks.add(tb);
        }
      }
 else       return;
    }
    TempBlock tblock=new TempBlock(block,Material.LAVA,(byte)0);
    TEMP_LAVA_BLOCKS.put(block,tblock);
    TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.put(tblock,block);
    affectedBlocks.add(tblock);
    if (allowNaturalFlow) {
      TempBlock.removeBlock(block);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a LavaBlock and appends the TempBlock to our arraylist called TEMP_LAVA_BLOCKS. If ALLOW_NATURAL_FLOW is turned on then this method will remove the block from TempBlock.instances, which will allow the lava to flow naturally.
 * @param block the block that will be turned to lava
 */
public void createLava(Block block){
  if (isEarth(block) || isSand(block) || isMetal(block)) {
    if (isPlant(block.getRelative(BlockFace.UP)) || isSnow(block.getRelative(BlockFace.UP))) {
      Block above=block.getRelative(BlockFace.UP);
      Block above2=above.getRelative(BlockFace.UP);
      if (isPlant(above) || isSnow(above)) {
        TempBlock tb=new TempBlock(above,Material.AIR,(byte)0);
        TEMP_AIR_BLOCKS.put(above,tb);
        TEMP_AIR_BLOCKS_BY_TEMPBLOCK.put(tb,above);
        affectedBlocks.add(tb);
        if (isPlant(above2) && above2.getType().equals(Material.DOUBLE_PLANT)) {
          TempBlock tb2=new TempBlock(above2,Material.AIR,(byte)0);
          TEMP_AIR_BLOCKS.put(above2,tb2);
          TEMP_AIR_BLOCKS_BY_TEMPBLOCK.put(tb2,above2);
          affectedBlocks.add(tb);
        }
      }
 else       return;
    }
    TempBlock tblock=new TempBlock(block,Material.LAVA,(byte)0);
    TEMP_LAVA_BLOCKS.put(block,tblock);
    TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.put(tblock,block);
    affectedBlocks.add(tblock);
    if (allowNaturalFlow) {
      TempBlock.removeBlock(block);
    }
  }
}
Program: 133803
Project: 133803
Buggy source:
/** 
 * Removes a lava block if it is inside of our ArrayList of TempBlocks.
 * @param testBlock the block to attempt to remove
 */
@SuppressWarnings("String_Node_Str") public void removeLava(Block testBlock){
  if (TEMP_LAVA_BLOCKS.containsKey(testBlock)) {
    TempBlock tb=TEMP_LAVA_BLOCKS.get(testBlock);
    tb.revertBlock();
    TEMP_LAVA_BLOCKS.remove(testBlock);
    TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.remove(tb);
    affectedBlocks.remove(tb);
    return;
  }
  TempBlock tblock=new TempBlock(testBlock,revertMaterial,testBlock.getData());
  affectedBlocks.add(tblock);
  TEMP_LAND_BLOCKS.put(testBlock,tblock);
}

Fixed version (ground truth):
/** 
 * Removes a lava block if it is inside of our ArrayList of TempBlocks.
 * @param testBlock the block to attempt to remove
 */
@SuppressWarnings("String_Node_Str") public void removeLava(Block testBlock){
  if (TEMP_LAVA_BLOCKS.containsKey(testBlock)) {
    TempBlock tb=TEMP_LAVA_BLOCKS.get(testBlock);
    tb.revertBlock();
    TEMP_LAVA_BLOCKS.remove(testBlock);
    TEMP_LAVA_BLOCKS_BY_TEMPBLOCK.remove(tb);
    affectedBlocks.remove(tb);
    return;
  }
  TempBlock tblock=new TempBlock(testBlock,revertMaterial,testBlock.getData());
  affectedBlocks.add(tblock);
  TEMP_LAND_BLOCKS.put(testBlock,tblock);
  TEMP_LAND_BLOCKS_BY_TEMPBLOCK.put(tblock,testBlock);
}
Program: 133804
Project: 133804
Buggy source:
@Override public void progress(){
  groundBlock=getGround();
  if (groundBlock == null) {
    remove();
    return;
  }
  bPlayer.addCooldown(this);
  dir=dir.clone().normalize().multiply(1.5);
  dir.setY(0);
  double distance=loc.getY() - (double)groundBlock.getY();
  double dx=Math.abs(distance - 2.4);
  if (distance > 1.75) {
    dir.setY(-.50 * dx * dx);
  }
 else   if (distance < 1) {
    dir.setY(.50 * dx * dx);
  }
 else {
    dir.setY(0);
  }
  loc.add(dir);
  ParticleEffect.BLOCK_CRACK.display((ParticleEffect.ParticleData)new ParticleEffect.BlockData(blockType,blockByte),1F,0.1F,1F,0.1F,100,loc.add(0,-1,0),500);
  if (player.isDead() || !player.isOnline()) {
    remove();
    return;
  }
  if (!player.isSneaking()) {
    remove();
    return;
  }
  if (loc.getWorld().equals(startLoc.getWorld()) && loc.distance(startLoc) >= selectRange) {
    remove();
    return;
  }
  for (  Entity e : GeneralMethods.getEntitiesAroundPoint(loc,2.5)) {
    if (e.getEntityId() != player.getEntityId() && e instanceof LivingEntity) {
      closestEntity=e;
      formDome();
      remove();
      return;
    }
  }
  if (random.nextInt(2) == 0) {
    playEarthbendingSound(loc);
  }
}

Fixed version (ground truth):
@Override public void progress(){
  groundBlock=getGround();
  if (groundBlock == null) {
    remove();
    return;
  }
  bPlayer.addCooldown(this);
  dir=dir.clone().normalize().multiply(1.5);
  dir.setY(0);
  double distance=loc.getY() - (double)groundBlock.getY();
  double dx=Math.abs(distance - 2.4);
  if (distance > 1.75) {
    dir.setY(-.50 * dx * dx);
  }
 else   if (distance < 1) {
    dir.setY(.50 * dx * dx);
  }
 else {
    dir.setY(0);
  }
  loc.add(dir);
  if (player.isDead() || !player.isOnline()) {
    remove();
    return;
  }
  if (!player.isSneaking()) {
    remove();
    return;
  }
  if (loc.getWorld().equals(startLoc.getWorld()) && loc.distance(startLoc) >= selectRange) {
    remove();
    return;
  }
  ParticleEffect.BLOCK_CRACK.display((ParticleEffect.ParticleData)new ParticleEffect.BlockData(blockType,blockByte),1F,0.1F,1F,0.1F,100,loc.add(0,-1,0),500);
  for (  Entity e : GeneralMethods.getEntitiesAroundPoint(loc,2.5)) {
    if (e.getEntityId() != player.getEntityId() && e instanceof LivingEntity) {
      closestEntity=e;
      formDome();
      remove();
      return;
    }
  }
  if (random.nextInt(2) == 0) {
    playEarthbendingSound(loc);
  }
}
Program: 133806
Project: 133806
Buggy source:
public static boolean isWeapon(Material mat){
  return mat != null && (mat == Material.WOOD_AXE || mat == Material.WOOD_PICKAXE || mat == Material.WOOD_SPADE || mat == Material.WOOD_SWORD || mat == Material.STONE_AXE || mat == Material.STONE_PICKAXE || mat == Material.STONE_SPADE || mat == Material.STONE_SWORD || mat == Material.IRON_AXE || mat == Material.IRON_PICKAXE || mat == Material.IRON_SWORD || mat == Material.IRON_SPADE || mat == Material.DIAMOND_AXE || mat == Material.DIAMOND_PICKAXE || mat == Material.DIAMOND_SWORD || mat == Material.DIAMOND_SPADE);
}

Fixed version (ground truth):
public static boolean isWeapon(Material mat){
  return mat != null && (mat == Material.WOOD_AXE || mat == Material.WOOD_PICKAXE || mat == Material.WOOD_SPADE || mat == Material.WOOD_SWORD || mat == Material.STONE_AXE || mat == Material.STONE_PICKAXE || mat == Material.STONE_SPADE || mat == Material.STONE_SWORD || mat == Material.IRON_AXE || mat == Material.IRON_PICKAXE || mat == Material.IRON_SWORD || mat == Material.IRON_SPADE || mat == Material.DIAMOND_AXE || mat == Material.DIAMOND_PICKAXE || mat == Material.DIAMOND_SWORD || mat == Material.DIAMOND_SPADE || mat == Material.GOLD_AXE || mat == Material.GOLD_HOE || mat == Material.GOLD_SWORD || mat == Material.GOLD_PICKAXE || mat == Material.GOLD_SPADE);
}
Program: 133811
Project: 133811
Buggy source:
@Override public void progress(){
  if (bPlayer.isOnCooldown(this)) {
    remove();
    return;
  }
  jump(player);
  WaterArmsWhip waw=WaterArmsWhip.getGrabbedEntities().get(player);
  if (waw != null) {
    waw.setGrabbed(false);
  }
  bPlayer.addCooldown(this);
}

Fixed version (ground truth):
@Override public void progress(){
  if (bPlayer.isOnCooldown(this)) {
    remove();
    return;
  }
  jump(player);
  WaterArmsWhip waw=WaterArmsWhip.getGrabbedEntities().get(player);
  if (waw != null) {
    waw.setGrabbed(false);
  }
}
Program: 133812
Project: 133812
Buggy source:
private void jump(Player p){
  if (!GeneralMethods.isSolid(p.getLocation().getBlock().getRelative(BlockFace.DOWN))) {
    return;
  }
  Vector vec=p.getVelocity();
  vec.setY(height);
  p.setVelocity(vec);
  return;
}

Fixed version (ground truth):
private void jump(Player p){
  if (!GeneralMethods.isSolid(p.getLocation().getBlock().getRelative(BlockFace.DOWN))) {
    remove();
    return;
  }
  Vector vec=p.getVelocity();
  vec.setY(height);
  p.setVelocity(vec);
  bPlayer.addCooldown(this);
  return;
}
Program: 133813
Project: 133813
Buggy source:
@Override public long getCooldown(){
  return 0;
}

Fixed version (ground truth):
@Override public long getCooldown(){
  return cooldown;
}
Program: 133814
Project: 133814
Buggy source:
public QuickStrike(Player player){
  super(player);
  if (!bPlayer.canBend(this)) {
    return;
  }
  this.damage=getConfig().getInt("String_Node_Str");
  this.blockChance=getConfig().getInt("String_Node_Str");
  target=GeneralMethods.getTargetedEntity(player,2);
  if (target == null) {
    return;
  }
  start();
}

Fixed version (ground truth):
public QuickStrike(Player sourceplayer,Entity targetentity){
  super(sourceplayer);
  if (!bPlayer.canBend(this)) {
    return;
  }
  this.damage=getConfig().getInt("String_Node_Str");
  this.cooldown=getConfig().getLong("String_Node_Str");
  this.blockChance=getConfig().getInt("String_Node_Str");
  target=targetentity;
  if (target == null) {
    return;
  }
  start();
}
Program: 133815
Project: 133815
Buggy source:
@Override public void progress(){
  if (target == null) {
    remove();
    return;
  }
  DamageHandler.damageEntity(target,damage,this);
  if (target instanceof Player && ChiPassive.willChiBlock(player,(Player)target)) {
    ChiPassive.blockChi((Player)target);
  }
  remove();
}

Fixed version (ground truth):
@Override public void progress(){
  if (bPlayer.isOnCooldown(this)) {
    return;
  }
  if (target == null) {
    remove();
    return;
  }
  DamageHandler.damageEntity(target,damage,this);
  bPlayer.addCooldown(this);
  if (target instanceof Player && ChiPassive.willChiBlock(player,(Player)target)) {
    ChiPassive.blockChi((Player)target);
  }
  remove();
}
Program: 133816
Project: 133816
Buggy source:
public RapidPunch(Player player){
  super(player);
  if (!bPlayer.canBend(this)) {
    return;
  }
  this.damage=getConfig().getInt("String_Node_Str");
  this.punches=getConfig().getInt("String_Node_Str");
  this.distance=getConfig().getInt("String_Node_Str");
  this.cooldown=getConfig().getLong("String_Node_Str");
  this.target=GeneralMethods.getTargetedEntity(player,distance);
  start();
}

Fixed version (ground truth):
public RapidPunch(Player sourceplayer,Entity targetentity){
  super(sourceplayer);
  if (!bPlayer.canBend(this)) {
    return;
  }
  this.damage=getConfig().getInt("String_Node_Str");
  this.punches=getConfig().getInt("String_Node_Str");
  this.distance=getConfig().getInt("String_Node_Str");
  this.cooldown=getConfig().getLong("String_Node_Str");
  this.target=GeneralMethods.getTargetedEntity(player,distance);
  start();
}
Program: 133817
Project: 133817
Buggy source:
public SwiftKick(Player player){
  super(player);
  if (!bPlayer.canBend(this)) {
    return;
  }
  this.damage=getConfig().getInt("String_Node_Str");
  this.blockChance=getConfig().getInt("String_Node_Str");
  this.cooldown=getConfig().getInt("String_Node_Str");
  this.target=GeneralMethods.getTargetedEntity(player,4);
  start();
}

Fixed version (ground truth):
public SwiftKick(Player sourceplayer,Entity targetentity){
  super(sourceplayer);
  if (!bPlayer.canBend(this)) {
    return;
  }
  this.damage=getConfig().getInt("String_Node_Str");
  this.blockChance=getConfig().getInt("String_Node_Str");
  this.cooldown=getConfig().getInt("String_Node_Str");
  this.target=targetentity;
  start();
}
Program: 133820
Project: 133820
Buggy source:
/** 
 * Changes the player that owns this ability instance. Used for redirection  and other abilities that change the player object.
 * @param player The player who now controls the ability
 */
public void setPlayer(Player player){
  INSTANCES_BY_PLAYER.get(this.getClass()).get(this.player.getUniqueId()).remove(this.getId());
  INSTANCES_BY_PLAYER.get(this.getClass()).get(player.getUniqueId()).put(this.getId(),this);
  this.player=player;
}

Fixed version (ground truth):
/** 
 * Changes the player that owns this ability instance. Used for redirection  and other abilities that change the player object.
 * @param player The player who now controls the ability
 */
public void setPlayer(Player player){
  Map<UUID,Map<Integer,CoreAbility>> classMap=INSTANCES_BY_PLAYER.get(getClass());
  if (classMap != null) {
    Map<Integer,CoreAbility> playerMap=classMap.get(player.getUniqueId());
    if (playerMap != null) {
      playerMap.remove(this.id);
      if (playerMap.size() == 0) {
        classMap.remove(player.getUniqueId());
      }
    }
    if (classMap.size() == 0) {
      INSTANCES_BY_PLAYER.remove(getClass());
    }
  }
  if (!INSTANCES_BY_PLAYER.containsKey(this.getClass())) {
    INSTANCES_BY_PLAYER.put(this.getClass(),new ConcurrentHashMap<UUID,Map<Integer,CoreAbility>>());
  }
  if (!INSTANCES_BY_PLAYER.get(this.getClass()).containsKey(player.getUniqueId())) {
    INSTANCES_BY_PLAYER.get(this.getClass()).put(player.getUniqueId(),new ConcurrentHashMap<Integer,CoreAbility>());
  }
  INSTANCES_BY_PLAYER.get(this.getClass()).get(player.getUniqueId()).put(this.getId(),this);
  this.player=player;
}
Program: 133822
Project: 133822
Buggy source:
/** 
 * Displays the enabled moves for the given subelement to the CommandSender.
 * @param sender The CommandSender to show the moves to
 * @param element The subelement to show the moves for
 */
private void displaySubElement(CommandSender sender,Element element){
  List<CoreAbility> abilities=CoreAbility.getAbilitiesByElement(element);
  if (abilities.isEmpty() && element != null) {
    sender.sendMessage(ChatColor.YELLOW + noAbilitiesAvailable.replace("String_Node_Str",element.getColor() + element.getName() + ChatColor.YELLOW));
    return;
  }
  for (  CoreAbility ability : abilities) {
    if (ability.isHiddenAbility()) {
      continue;
    }
 else     if (!(sender instanceof Player) || GeneralMethods.canView((Player)sender,ability.getName())) {
      sender.sendMessage(element.getColor() + ability.getName());
    }
  }
}

Fixed version (ground truth):
/** 
 * Displays the enabled moves for the given subelement to the CommandSender.
 * @param sender The CommandSender to show the moves to
 * @param element The subelement to show the moves for
 */
private void displaySubElement(CommandSender sender,Element element){
  List<CoreAbility> abilities=CoreAbility.getAbilitiesByElement(element);
  if (abilities.isEmpty() && element != null) {
    sender.sendMessage(ChatColor.YELLOW + noAbilitiesAvailable.replace("String_Node_Str",element.getColor() + element.getName() + ChatColor.YELLOW));
    return;
  }
  HashSet<String> abilitiesSent=new HashSet<String>();
  for (  CoreAbility ability : abilities) {
    if (ability.isHiddenAbility() || abilitiesSent.contains(ability.getName())) {
      continue;
    }
 else     if (!(sender instanceof Player) || GeneralMethods.canView((Player)sender,ability.getName())) {
      sender.sendMessage(element.getColor() + ability.getName());
      abilitiesSent.add(ability.getName());
    }
  }
}
Program: 133823
Project: 133823
Buggy source:
private void displayAvatar(CommandSender sender){
  List<CoreAbility> abilities=CoreAbility.getAbilitiesByElement(Element.AVATAR);
  if (abilities.isEmpty()) {
    sender.sendMessage(ChatColor.YELLOW + noAbilitiesAvailable.replace("String_Node_Str",Element.AVATAR.getColor() + "String_Node_Str" + ChatColor.YELLOW));
    return;
  }
  for (  CoreAbility ability : abilities) {
    if (ability.isHiddenAbility()) {
      continue;
    }
    if (sender instanceof Player) {
      if (GeneralMethods.canView((Player)sender,ability.getName())) {
        sender.sendMessage(ability.getElement().getColor() + ability.getName());
      }
    }
 else {
      sender.sendMessage(ability.getElement().getColor() + ability.getName());
    }
  }
}

Fixed version (ground truth):
private void displayAvatar(CommandSender sender){
  List<CoreAbility> abilities=CoreAbility.getAbilitiesByElement(Element.AVATAR);
  if (abilities.isEmpty()) {
    sender.sendMessage(ChatColor.YELLOW + noAbilitiesAvailable.replace("String_Node_Str",Element.AVATAR.getColor() + "String_Node_Str" + ChatColor.YELLOW));
    return;
  }
  HashSet<String> abilitiesSent=new HashSet<String>();
  for (  CoreAbility ability : abilities) {
    if (ability.isHiddenAbility() || abilitiesSent.contains(ability.getName())) {
      continue;
    }
    if (sender instanceof Player) {
      if (GeneralMethods.canView((Player)sender,ability.getName())) {
        sender.sendMessage(ability.getElement().getColor() + ability.getName());
        abilitiesSent.add(ability.getName());
      }
    }
 else {
      sender.sendMessage(ability.getElement().getColor() + ability.getName());
      abilitiesSent.add(ability.getName());
    }
  }
}
Program: 133824
Project: 133824
Buggy source:
public boolean prepare(){
  Block block=BlockSource.getWaterSourceBlock(player,selectRange,ClickType.SHIFT_DOWN,true,true,bPlayer.canPlantbend());
  cancelPrevious();
  block(player);
  if (block != null) {
    sourceBlock=block;
    focusBlock();
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean prepare(){
  Block block=BlockSource.getWaterSourceBlock(player,selectRange,ClickType.SHIFT_DOWN,true,true,bPlayer.canPlantbend());
  cancelPrevious();
  if (block != null) {
    sourceBlock=block;
    focusBlock();
    return true;
  }
  return false;
}
Program: 133825
Project: 133825
Buggy source:
/** 
 * Blocks other water manips
 */
private static void block(Player player){
  for (  WaterManipulation manip : getAbilities(WaterManipulation.class)) {
    if (!manip.location.getWorld().equals(player.getWorld())) {
      continue;
    }
 else     if (!manip.progressing) {
      continue;
    }
 else     if (manip.getPlayer().equals(player)) {
      continue;
    }
 else     if (GeneralMethods.isRegionProtectedFromBuild(manip,manip.location)) {
      continue;
    }
    Location location=player.getEyeLocation();
    Vector vector=location.getDirection();
    Location mloc=manip.location;
    if (mloc.distanceSquared(location) <= manip.selectRange * manip.selectRange && GeneralMethods.getDistanceFromLine(vector,location,manip.location) < manip.deflectRange && mloc.distanceSquared(location.clone().add(vector)) < mloc.distanceSquared(location.clone().add(vector.clone().multiply(-1)))) {
      manip.remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Blocks other water manips
 */
public static void block(Player player){
  for (  WaterManipulation manip : getAbilities(WaterManipulation.class)) {
    if (!manip.location.getWorld().equals(player.getWorld())) {
      continue;
    }
 else     if (!manip.progressing) {
      continue;
    }
 else     if (manip.getPlayer().equals(player)) {
      continue;
    }
 else     if (GeneralMethods.isRegionProtectedFromBuild(manip,manip.location)) {
      continue;
    }
    Location location=player.getEyeLocation();
    Vector vector=location.getDirection();
    Location mloc=manip.location;
    if (mloc.distanceSquared(location) <= manip.selectRange * manip.selectRange && GeneralMethods.getDistanceFromLine(vector,location,manip.location) < manip.deflectRange && mloc.distanceSquared(location.clone().add(vector)) < mloc.distanceSquared(location.clone().add(vector.clone().multiply(-1)))) {
      manip.remove();
    }
  }
}
Program: 133826
Project: 133826
Buggy source:
@SuppressWarnings("String_Node_Str") public static void moveWater(Player player){
  BendingPlayer bPlayer=BendingPlayer.getBendingPlayer(player);
  if (bPlayer == null) {
    return;
  }
  if (bPlayer.isOnCooldown("String_Node_Str")) {
    redirectTargettedBlasts(player);
    return;
  }
  boolean handledPrepare=false;
  double range=25;
  for (  WaterManipulation waterManip : getAbilities(player,WaterManipulation.class)) {
    range=waterManip.range;
    if (waterManip.prepared) {
      waterManip.prepared=false;
      handledPrepare=true;
      waterManip.moveWater();
    }
  }
  if (!handledPrepare && WaterReturn.hasWaterBottle(player)) {
    Location eyeLoc=player.getEyeLocation();
    Block block=eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock();
    if (!AFFECTED_BLOCKS.containsKey(block)) {
      AFFECTED_BLOCKS.put(block,block);
    }
    if (isTransparent(player,block) && isTransparent(player,eyeLoc.getBlock())) {
      if (getTargetLocation(player,range).distanceSquared(block.getLocation()) > 1) {
        block.setType(Material.WATER);
        block.setData((byte)0);
        WaterManipulation waterManip=new WaterManipulation(player);
        waterManip.moveWater();
        if (!waterManip.progressing) {
          block.setType(Material.AIR);
        }
 else {
          WaterReturn.emptyWaterBottle(player);
        }
      }
    }
  }
  redirectTargettedBlasts(player);
}

Fixed version (ground truth):
public static void moveWater(Player player){
  BendingPlayer bPlayer=BendingPlayer.getBendingPlayer(player);
  if (bPlayer == null) {
    return;
  }
  if (bPlayer.isOnCooldown("String_Node_Str")) {
    redirectTargettedBlasts(player);
    return;
  }
  boolean handledPrepare=false;
  double range=25;
  for (  WaterManipulation waterManip : getAbilities(player,WaterManipulation.class)) {
    range=waterManip.range;
    if (waterManip.prepared) {
      waterManip.prepared=false;
      handledPrepare=true;
      waterManip.moveWater();
    }
  }
  if (!handledPrepare && WaterReturn.hasWaterBottle(player)) {
    Location eyeLoc=player.getEyeLocation();
    Block block=eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock();
    if (!AFFECTED_BLOCKS.containsKey(block)) {
      AFFECTED_BLOCKS.put(block,block);
    }
    if (isTransparent(player,block) && isTransparent(player,eyeLoc.getBlock())) {
      if (getTargetLocation(player,range).distanceSquared(block.getLocation()) > 1) {
        TempBlock tb=new TempBlock(block,Material.WATER,(byte)0);
        WaterManipulation waterManip=new WaterManipulation(player);
        waterManip.moveWater();
        if (!waterManip.progressing) {
          block.setType(Material.AIR);
          tb.revertBlock();
        }
 else {
          WaterReturn.emptyWaterBottle(player);
          tb.revertBlock();
        }
      }
    }
  }
  redirectTargettedBlasts(player);
}
Program: 133828
Project: 133828
Buggy source:
@Override public void progress(){
  if (player.isDead() || !player.isOnline()) {
    remove();
    return;
  }
 else   if (distanceTravelled > spearRange) {
    remove();
    return;
  }
  if (!hitEntity) {
    progressSpear();
  }
 else {
    createIceBall();
    remove();
  }
  if (layer >= spearSphere) {
    remove();
    return;
  }
 else   if (!canPlaceBlock(location.getBlock())) {
    if (canFreeze) {
      createSpear();
    }
    remove();
    return;
  }
}

Fixed version (ground truth):
@Override public void progress(){
  if (player.isDead() || !player.isOnline()) {
    remove();
    return;
  }
 else   if (distanceTravelled > spearRange) {
    remove();
    return;
  }
  if (!hitEntity) {
    progressSpear();
  }
 else {
    createIceBall();
    remove();
  }
  if (!canPlaceBlock(location.getBlock())) {
    if (canFreeze) {
      createSpear();
    }
    remove();
    return;
  }
}
Program: 133829
Project: 133829
Buggy source:
private void createIceBall(){
  for (  Block block : GeneralMethods.getBlocksAroundPoint(location,spearSphere)) {
    if (isTransparent(player,block) && block.getType() != Material.ICE && !WaterArms.isUnbreakable(block)) {
      playIcebendingSound(block.getLocation());
      new TempBlock(block,Material.ICE,(byte)0);
      getIceBlocks().put(block,System.currentTimeMillis() + spearDuration + (long)(Math.random() * 500));
    }
  }
}

Fixed version (ground truth):
private void createIceBall(){
  if (spearSphere <= 0) {
    if (canFreeze) {
      createSpear();
    }
    return;
  }
  for (  Block block : GeneralMethods.getBlocksAroundPoint(location,spearSphere)) {
    if (isTransparent(player,block) && block.getType() != Material.ICE && !WaterArms.isUnbreakable(block)) {
      playIcebendingSound(block.getLocation());
      new TempBlock(block,Material.ICE,(byte)0);
      getIceBlocks().put(block,System.currentTimeMillis() + spearDuration + (long)(Math.random() * 500));
    }
  }
}