nus-yam/ex-repair huggingface dataset:
Program: 97786
Project: 97786
Buggy source:
private void fillIteration(SnipeData v,int fillFaces,BlockBuffer current,BlockBuffer target){
  int brushSize=(int)v.getBrushSize() + 1;
  double brushSizeSquared=v.getBrushSize() * v.getBrushSize();
  Map<BlockState,Integer> frequency=Maps.newHashMap();
  for (int x=-brushSize; x <= brushSize; x++) {
    for (int y=-brushSize; y <= brushSize; y++) {
      for (int z=-brushSize; z <= brushSize; z++) {
        if (x * x + y * y + z * z >= brushSizeSquared) {
          continue;
        }
        BlockState state=current.get(x,y,z);
        if (!BlockHelper.isLiquidOrGas(state)) {
          continue;
        }
        int total=0;
        int highest=1;
        BlockState highestState=state;
        frequency.clear();
        for (        Vector3i offs : FACES_TO_CHECK) {
          BlockState next=current.get(x + offs.getX(),y + offs.getY(),z + offs.getZ());
          if (BlockHelper.isLiquidOrGas(next)) {
            continue;
          }
          total++;
          Integer count=frequency.get(next);
          if (count == null) {
            count=1;
          }
 else {
            count++;
          }
          if (count > highest) {
            highest=count;
            highestState=next;
          }
          frequency.put(next,count);
        }
        if (total > fillFaces) {
          target.set(x,y,z,highestState);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void fillIteration(SnipeData v,int fillFaces,BlockBuffer current,BlockBuffer target){
  int brushSize=(int)v.getBrushSize() + 1;
  double brushSizeSquared=v.getBrushSize() * v.getBrushSize();
  Map<BlockState,Integer> frequency=Maps.newHashMap();
  for (int x=-brushSize; x <= brushSize; x++) {
    for (int y=-brushSize; y <= brushSize; y++) {
      for (int z=-brushSize; z <= brushSize; z++) {
        target.set(x,y,z,current.get(x,y,z));
        if (x * x + y * y + z * z >= brushSizeSquared) {
          continue;
        }
        BlockState state=current.get(x,y,z);
        if (!BlockHelper.isLiquidOrGas(state)) {
          continue;
        }
        int total=0;
        int highest=1;
        BlockState highestState=state;
        frequency.clear();
        for (        Vector3i offs : FACES_TO_CHECK) {
          BlockState next=current.get(x + offs.getX(),y + offs.getY(),z + offs.getZ());
          if (BlockHelper.isLiquidOrGas(next)) {
            continue;
          }
          total++;
          Integer count=frequency.get(next);
          if (count == null) {
            count=1;
          }
 else {
            count++;
          }
          if (count > highest) {
            highest=count;
            highestState=next;
          }
          frequency.put(next,count);
        }
        if (total > fillFaces) {
          target.set(x,y,z,highestState);
        }
      }
    }
  }
}
Program: 97787
Project: 97787
Buggy source:
private void erosionIteration(SnipeData v,int erodeFaces,BlockBuffer current,BlockBuffer target){
  int brushSize=(int)v.getBrushSize() + 1;
  double brushSizeSquared=v.getBrushSize() * v.getBrushSize();
  Map<BlockType,Integer> frequency=Maps.newHashMap();
  for (int x=-brushSize; x <= brushSize; x++) {
    for (int y=-brushSize; y <= brushSize; y++) {
      for (int z=-brushSize; z <= brushSize; z++) {
        if (x * x + y * y + z * z >= brushSizeSquared) {
          continue;
        }
        BlockState state=current.get(x,y,z);
        if (BlockHelper.isLiquidOrGas(state)) {
          continue;
        }
        int total=0;
        int highest=1;
        BlockType highestState=state.getType();
        frequency.clear();
        for (        Vector3i offs : FACES_TO_CHECK) {
          BlockState next=current.get(x + offs.getX(),y + offs.getY(),z + offs.getZ());
          if (!BlockHelper.isLiquidOrGas(next)) {
            continue;
          }
          total++;
          Integer count=frequency.get(next.getType());
          if (count == null) {
            count=1;
          }
 else {
            count++;
          }
          if (count > highest) {
            highest=count;
            highestState=next.getType();
          }
          frequency.put(next.getType(),count);
        }
        if (total > erodeFaces) {
          target.set(x,y,z,highestState.getDefaultState());
        }
      }
    }
  }
}

Fixed version (ground truth):
private void erosionIteration(SnipeData v,int erodeFaces,BlockBuffer current,BlockBuffer target){
  int brushSize=(int)v.getBrushSize() + 1;
  double brushSizeSquared=v.getBrushSize() * v.getBrushSize();
  Map<BlockType,Integer> frequency=Maps.newHashMap();
  for (int x=-brushSize; x <= brushSize; x++) {
    for (int y=-brushSize; y <= brushSize; y++) {
      for (int z=-brushSize; z <= brushSize; z++) {
        target.set(x,y,z,current.get(x,y,z));
        if (x * x + y * y + z * z >= brushSizeSquared) {
          continue;
        }
        BlockState state=current.get(x,y,z);
        if (BlockHelper.isLiquidOrGas(state)) {
          continue;
        }
        int total=0;
        int highest=1;
        BlockType highestState=state.getType();
        frequency.clear();
        for (        Vector3i offs : FACES_TO_CHECK) {
          BlockState next=current.get(x + offs.getX(),y + offs.getY(),z + offs.getZ());
          if (!BlockHelper.isLiquidOrGas(next)) {
            continue;
          }
          total++;
          Integer count=frequency.get(next.getType());
          if (count == null) {
            count=1;
          }
 else {
            count++;
          }
          if (count > highest) {
            highest=count;
            highestState=next.getType();
          }
          frequency.put(next.getType(),count);
        }
        if (total > erodeFaces) {
          target.set(x,y,z,highestState.getDefaultState());
        }
      }
    }
  }
}
Program: 97789
Project: 97789
Buggy source:
private void overlay(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      if (xs + zs < brushSizeSquared) {
        int y=targetBlock.getBlockY();
        for (; y >= Brush.WORLD_HEIGHT; y--) {
          if (this.world.getBlockType(x,y,z) != BlockTypes.AIR) {
            break;
          }
        }
        if (y == targetBlock.getBlockY() && y < WORLD_HEIGHT) {
          if (this.world.getBlockType(x,y + 1,z) != BlockTypes.AIR) {
            continue;
          }
        }
        for (int y0=y; y0 > y - this.depth; y0--) {
          if (this.world.getBlockType(x,y0,z) != BlockTypes.AIR) {
            perform(v,x,y0,z);
          }
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void overlay(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=this.targetBlock.getBlockX();
  int tz=this.targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(tz - z) * (tz - z);
      if (xs + zs < brushSizeSquared) {
        int y=targetBlock.getBlockY();
        for (; y >= 0; y--) {
          if (this.world.getBlockType(x,y,z) != BlockTypes.AIR) {
            break;
          }
        }
        if (y == targetBlock.getBlockY() && y < WORLD_HEIGHT) {
          if (this.world.getBlockType(x,y + 1,z) != BlockTypes.AIR) {
            continue;
          }
        }
        for (int y0=y; y0 > y - this.depth; y0--) {
          if (this.world.getBlockType(x,y0,z) != BlockTypes.AIR) {
            perform(v,x,y0,z);
          }
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97790
Project: 97790
Buggy source:
@Override public final void parameters(final String[] par,final SnipeData v){
  for (int i=1; i < par.length; i++) {
    final String parameter=par[i];
    if (parameter.equalsIgnoreCase("String_Node_Str")) {
      v.sendMessage(TextColors.GOLD,"String_Node_Str");
      v.sendMessage(TextColors.AQUA,"String_Node_Str");
      return;
    }
    if (parameter.startsWith("String_Node_Str")) {
      try {
        this.depth=Integer.parseInt(parameter.replace("String_Node_Str","String_Node_Str"));
        if (this.depth < 1) {
          this.depth=1;
        }
        v.sendMessage(TextColors.AQUA,"String_Node_Str" + this.depth);
      }
 catch (      NumberFormatException e) {
        v.sendMessage(TextColors.RED,"String_Node_Str");
      }
    }
 else {
      v.sendMessage(TextColors.RED,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public final void parameters(final String[] par,final SnipeData v){
  if (par.length > 0) {
    if (par[0].equalsIgnoreCase("String_Node_Str")) {
      v.sendMessage(TextColors.GOLD,"String_Node_Str");
      v.sendMessage(TextColors.AQUA,"String_Node_Str");
      return;
    }
    if (par[0].startsWith("String_Node_Str")) {
      try {
        this.depth=Integer.parseInt(par[0].replace("String_Node_Str","String_Node_Str"));
        if (this.depth < 1) {
          this.depth=1;
        }
        v.sendMessage(TextColors.AQUA,"String_Node_Str" + this.depth);
      }
 catch (      NumberFormatException e) {
        v.sendMessage(TextColors.RED,"String_Node_Str");
      }
    }
 else {
      v.sendMessage(TextColors.RED,"String_Node_Str");
    }
  }
}
Program: 97791
Project: 97791
Buggy source:
public void parse(String[] args,SnipeData v){
  String handle=args[0];
  if (handle.length() == 1 || handle.length() == 2) {
    PerformerType pl=null;
    char p=handle.charAt(0);
    if (p == 'm' || p == 'M') {
      pl=PerformerType.TYPE;
    }
 else     if (p == 'i' || p == 'I') {
      pl=PerformerType.STATE;
      v.sendMessage(TextColors.RED,"String_Node_Str");
    }
 else     if (p == 'c' || p == 'C') {
      pl=PerformerType.COMBO;
    }
 else {
      parameters(args,v);
      return;
    }
    if (handle.length() == 2) {
      char r=handle.charAt(1);
      if (r == 'm' || r == 'M') {
        this.replace=PerformerType.TYPE;
      }
 else       if (r == 'i' || r == 'I') {
        this.replace=PerformerType.STATE;
        v.sendMessage(TextColors.RED,"String_Node_Str");
      }
 else       if (r == 'c' || r == 'C') {
        this.replace=PerformerType.COMBO;
      }
 else {
        parameters(args,v);
        return;
      }
    }
 else {
      this.replace=PerformerType.NONE;
    }
    this.place=pl;
    if (args.length > 1) {
      parameters(Arrays.copyOfRange(args,1,args.length),v);
    }
  }
 else {
    parameters(args,v);
  }
}

Fixed version (ground truth):
public void parse(String[] args,SnipeData v){
  String handle=args[0];
  if (handle.length() == 1 || handle.length() == 2) {
    PerformerType pl=null;
    char p=handle.charAt(0);
    if (p == 'm' || p == 'M') {
      pl=PerformerType.TYPE;
    }
 else     if (p == 'i' || p == 'I') {
      pl=PerformerType.STATE;
      v.sendMessage(TextColors.RED,"String_Node_Str");
    }
 else     if (p == 'c' || p == 'C') {
      pl=PerformerType.COMBO;
    }
 else {
      parameters(args,v);
      return;
    }
    if (handle.length() == 2) {
      char r=handle.charAt(1);
      if (r == 'm' || r == 'M') {
        this.replace=PerformerType.TYPE;
      }
 else       if (r == 'i' || r == 'I') {
        this.replace=PerformerType.STATE;
        v.sendMessage(TextColors.RED,"String_Node_Str");
      }
 else       if (r == 'c' || r == 'C') {
        this.replace=PerformerType.COMBO;
      }
 else {
        parameters(args,v);
        return;
      }
    }
 else {
      this.replace=PerformerType.NONE;
    }
    this.place=pl;
    parameters(Arrays.copyOfRange(args,1,args.length),v);
  }
 else {
    parameters(args,v);
  }
}
Program: 97792
Project: 97792
Buggy source:
@Override protected final void arrow(final SnipeData v){
  if (this.file == null) {
    v.sendMessage(TextColors.RED,"String_Node_Str");
    return;
  }
  if (this.pos1 == null || !this.worldUid.equals(this.targetBlock.getExtent().getUniqueId())) {
    this.pos1=this.targetBlock.getBlockPosition();
    this.pos2=null;
    this.worldUid=this.targetBlock.getExtent().getUniqueId();
    v.sendMessage(TextColors.GRAY,"String_Node_Str");
  }
 else   if (this.pos2 == null) {
    this.pos2=this.targetBlock.getBlockPosition();
    v.sendMessage(TextColors.GRAY,"String_Node_Str");
  }
 else {
    Vector3i origin=this.targetBlock.getBlockPosition();
    ArchetypeVolume volume=this.world.createArchetypeVolume(this.pos1,this.pos2,origin);
    this.schematic=Schematic.builder().paletteType(BlockPaletteTypes.LOCAL).volume(volume).metaValue("String_Node_Str",this.filename).metaValue("String_Node_Str",v.owner().getPlayer().getName()).metaValue("String_Node_Str",System.currentTimeMillis()).build();
    try (GZIPOutputStream out=new GZIPOutputStream(new FileOutputStream(this.file))){
      DataContainer data=DataTranslators.SCHEMATIC.translate(this.schematic);
      DataFormats.NBT.writeTo(out,data);
      v.sendMessage(TextColors.GREEN,"String_Node_Str");
      this.lastMod=this.file.lastModified();
      this.pos1=null;
      this.pos2=null;
    }
 catch (    IOException e) {
      e.printStackTrace();
      v.sendMessage(TextColors.RED,"String_Node_Str");
      return;
    }
  }
}

Fixed version (ground truth):
@Override protected final void arrow(final SnipeData v){
  if (this.file == null) {
    v.sendMessage(TextColors.RED,"String_Node_Str");
    return;
  }
  if (this.pos1 == null || !this.worldUid.equals(this.targetBlock.getExtent().getUniqueId())) {
    this.pos1=this.targetBlock.getBlockPosition();
    this.pos2=null;
    this.worldUid=this.targetBlock.getExtent().getUniqueId();
    v.sendMessage(TextColors.GRAY,"String_Node_Str");
  }
 else   if (this.pos2 == null) {
    this.pos2=this.targetBlock.getBlockPosition();
    v.sendMessage(TextColors.GRAY,"String_Node_Str");
  }
 else {
    Vector3i origin=this.targetBlock.getBlockPosition();
    ArchetypeVolume volume=this.world.createArchetypeVolume(this.pos1,this.pos2,origin);
    this.schematic=Schematic.builder().paletteType(BlockPaletteTypes.LOCAL).volume(volume).metaValue("String_Node_Str",this.filename).metaValue("String_Node_Str",v.owner().getPlayer().getName()).metaValue("String_Node_Str",System.currentTimeMillis()).build();
    this.file.getParentFile().mkdirs();
    try (GZIPOutputStream out=new GZIPOutputStream(new FileOutputStream(this.file))){
      DataContainer data=DataTranslators.SCHEMATIC.translate(this.schematic);
      DataFormats.NBT.writeTo(out,data);
      v.sendMessage(TextColors.GREEN,"String_Node_Str");
      this.lastMod=this.file.lastModified();
      this.pos1=null;
      this.pos2=null;
    }
 catch (    IOException e) {
      e.printStackTrace();
      v.sendMessage(TextColors.RED,"String_Node_Str");
      return;
    }
  }
}
Program: 97793
Project: 97793
Buggy source:
@Override public final void parameters(final String[] par,final SnipeData v){
  if (par.length == 0) {
    v.sendMessage(TextColors.RED,"String_Node_Str");
    return;
  }
  if (par[0].equalsIgnoreCase("String_Node_Str")) {
    v.sendMessage(TextColors.GOLD,"String_Node_Str");
    v.sendMessage(TextColors.AQUA,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (!this.filename.equals(par[0])) {
    this.lastMod=0;
    this.schematic=null;
  }
  this.filename=par[0];
  File schematic=SchematicHelper.getSchematicsDir().resolve(this.filename + "String_Node_Str").toFile();
  if (schematic.exists()) {
    v.sendMessage(TextColors.RED,"String_Node_Str" + this.filename + "String_Node_Str");
  }
 else {
    v.sendMessage(TextColors.AQUA,"String_Node_Str" + this.filename + "String_Node_Str");
  }
  this.file=schematic;
  if (par.length > 1) {
    if (par[1].equalsIgnoreCase("String_Node_Str")) {
      this.pasteOption=PasteOption.FULL;
    }
 else     if (par[1].equalsIgnoreCase("String_Node_Str")) {
      this.pasteOption=PasteOption.FULL;
    }
 else     if (par[1].equalsIgnoreCase("String_Node_Str")) {
      this.pasteOption=PasteOption.FULL;
    }
 else {
      v.sendMessage(TextColors.RED,"String_Node_Str");
      return;
    }
    v.sendMessage(TextColors.YELLOW,"String_Node_Str" + this.pasteOption.name().toLowerCase());
  }
}

Fixed version (ground truth):
@Override public final void parameters(final String[] par,final SnipeData v){
  if (par.length == 0) {
    v.sendMessage(TextColors.RED,"String_Node_Str");
    return;
  }
  if (par[0].equalsIgnoreCase("String_Node_Str")) {
    v.sendMessage(TextColors.GOLD,"String_Node_Str");
    v.sendMessage(TextColors.AQUA,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (!par[0].equals(this.filename)) {
    this.lastMod=0;
    this.schematic=null;
  }
  this.filename=par[0];
  File schematic=SchematicHelper.getSchematicsDir().resolve(this.filename + "String_Node_Str").toFile();
  if (schematic.exists()) {
    v.sendMessage(TextColors.RED,"String_Node_Str" + this.filename + "String_Node_Str");
  }
 else {
    v.sendMessage(TextColors.AQUA,"String_Node_Str" + this.filename + "String_Node_Str");
  }
  this.file=schematic;
  if (par.length > 1) {
    if (par[1].equalsIgnoreCase("String_Node_Str")) {
      this.pasteOption=PasteOption.FULL;
    }
 else     if (par[1].equalsIgnoreCase("String_Node_Str")) {
      this.pasteOption=PasteOption.FULL;
    }
 else     if (par[1].equalsIgnoreCase("String_Node_Str")) {
      this.pasteOption=PasteOption.FULL;
    }
 else {
      v.sendMessage(TextColors.RED,"String_Node_Str");
      return;
    }
    v.sendMessage(TextColors.YELLOW,"String_Node_Str" + this.pasteOption.name().toLowerCase());
  }
}
Program: 97794
Project: 97794
Buggy source:
public void set(int x,int y,int z,BlockState state){
  if (state == null) {
    if (this.buffer[index(x,y,z)] != Character.MAX_VALUE) {
      this.count--;
      this.buffer[index(x,y,z)]=Character.MAX_VALUE;
    }
    return;
  }
  if (this.buffer[index(x,y,z)] == Character.MAX_VALUE) {
    this.count++;
  }
  int id=this.palette.getOrAssign(state);
  this.buffer[index(x,y,z)]=(char)id;
}

Fixed version (ground truth):
public void set(int x,int y,int z,BlockState state){
  if (x < this.min.getX() || x > this.max.getX() || y < this.min.getY() || y > this.max.getY() || z < this.min.getZ() || z > this.max.getZ()) {
    throw new IllegalArgumentException("String_Node_Str" + this.min + "String_Node_Str"+ this.max+ "String_Node_Str"+ x+ "String_Node_Str"+ y+ "String_Node_Str"+ z+ "String_Node_Str");
  }
  if (state == null) {
    if (this.buffer[index(x,y,z)] != Character.MAX_VALUE) {
      this.count--;
      this.buffer[index(x,y,z)]=Character.MAX_VALUE;
    }
    return;
  }
  if (this.buffer[index(x,y,z)] == Character.MAX_VALUE) {
    this.count++;
  }
  int id=this.palette.getOrAssign(state);
  this.buffer[index(x,y,z)]=(char)id;
}
Program: 97795
Project: 97795
Buggy source:
public BlockState get(int x,int y,int z){
  char id=this.buffer[index(x,y,z)];
  if (id == Character.MAX_VALUE) {
    return null;
  }
  return this.palette.get(id).get();
}

Fixed version (ground truth):
public BlockState get(int x,int y,int z){
  if (x < this.min.getX() || x > this.max.getX() || y < this.min.getY() || y > this.max.getY() || z < this.min.getZ() || z > this.max.getZ()) {
    throw new IllegalArgumentException("String_Node_Str" + this.min + "String_Node_Str"+ this.max+ "String_Node_Str"+ x+ "String_Node_Str"+ y+ "String_Node_Str"+ z+ "String_Node_Str");
  }
  char id=this.buffer[index(x,y,z)];
  if (id == Character.MAX_VALUE) {
    return null;
  }
  return this.palette.get(id).get();
}
Program: 97796
Project: 97796
Buggy source:
private int index(int x,int y,int z){
  return x + y * this.size.getX() + z * this.size.getX() * this.size.getY();
}

Fixed version (ground truth):
private int index(int x,int y,int z){
  x-=this.min.getX();
  y-=this.min.getY();
  z-=this.min.getZ();
  return x + y * this.size.getX() + z * this.size.getX() * this.size.getY();
}
Program: 97797
Project: 97797
Buggy source:
/** 
 * Display voxel type.
 */
public void voxel(){
  this.snipeData.sendMessage(TextColors.GOLD,"String_Node_Str",TextColors.RED,this.snipeData.getVoxelId(),TextColors.GRAY,"String_Node_Str",this.snipeData.getVoxelId(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Display voxel type.
 */
public void voxel(){
  this.snipeData.sendMessage(TextColors.GOLD,"String_Node_Str",TextColors.RED,this.snipeData.getVoxelId());
}
Program: 97798
Project: 97798
Buggy source:
private void ball(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int ty=targetBlock.getBlockY();
  int tz=targetBlock.getBlockZ();
  this.undo=new Undo(GenericMath.floor(4 * Math.PI * (brushSize + 1)* (brushSize + 1)* (brushSize + 1) / 3));
  int size=GenericMath.floor(brushSize) + 1;
  for (int x=-size; x <= size; x++) {
    for (int y=-size; y <= size; y++) {
      for (int z=-size; z <= size; z++) {
        if (x * x + y * y + z * z < brushSizeSquared) {
          perform(v,x + tx,y + ty,z + tz);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void ball(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int ty=targetBlock.getBlockY();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int miny=Math.max(GenericMath.floor(targetBlock.getBlockY() - brushSize),0);
  int maxy=Math.min(GenericMath.floor(targetBlock.getBlockY() + brushSize) + 1,WORLD_HEIGHT);
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(4 * Math.PI * (brushSize + 1)* (brushSize + 1)* (brushSize + 1) / 3));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int y=miny; y <= maxy; y++) {
      double ys=(ty - y) * (ty - y);
      for (int z=minz; z <= maxz; z++) {
        double zs=(tz - z) * (tz - z);
        if (xs + ys + zs < brushSizeSquared) {
          perform(v,x,y,z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97799
Project: 97799
Buggy source:
@Override protected final void arrow(final SnipeData v){
  this.biome(v);
}

Fixed version (ground truth):
@Override protected final void arrow(final SnipeData v){
  this.biome(v,this.targetBlock);
}
Program: 97800
Project: 97800
Buggy source:
private void biome(final SnipeData v){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(this.targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(this.targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(this.targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(this.targetBlock.getBlockZ() + brushSize) + 1;
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      if ((xs + zs) <= brushSizeSquared) {
        this.world.setBiome(x,z,this.selectedBiome);
      }
    }
  }
}

Fixed version (ground truth):
private void biome(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(this.targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(this.targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(this.targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(this.targetBlock.getBlockZ() + brushSize) + 1;
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(tz - z) * (tz - z);
      if ((xs + zs) <= brushSizeSquared) {
        this.world.setBiome(x,z,this.selectedBiome);
      }
    }
  }
}
Program: 97801
Project: 97801
Buggy source:
@Override protected final void powder(final SnipeData v){
  this.biome(v);
}

Fixed version (ground truth):
@Override protected final void powder(final SnipeData v){
  this.biome(v,this.lastBlock);
}
Program: 97802
Project: 97802
Buggy source:
private void applyBrush(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      if (xs + zs < brushSizeSquared) {
        final int sum=this.useWorldCoordinates ? x + z : x - minx + z - minz;
        if (sum % 2 != 0) {
          perform(v,x,targetBlock.getBlockY(),z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void applyBrush(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(tz - z) * (tz - z);
      if (xs + zs < brushSizeSquared) {
        final int sum=this.useWorldCoordinates ? x + z : x - tx + z - tx;
        if (sum % 2 != 0) {
          perform(v,x,targetBlock.getBlockY(),z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97803
Project: 97803
Buggy source:
private void cleanSnow(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int miny=Math.max(GenericMath.floor(targetBlock.getBlockY() - brushSize),0);
  int maxy=Math.min(GenericMath.floor(targetBlock.getBlockY() + brushSize) + 1,WORLD_HEIGHT);
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  if (miny <= 0) {
    miny=1;
  }
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)* (brushSize + 1) / 3));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      for (int y=maxy; y >= miny; y--) {
        double ys=(miny - y) * (miny - y);
        if (xs + ys + zs < brushSizeSquared) {
          BlockType below=this.world.getBlockType(x,y,z);
          if (below == BlockTypes.SNOW_LAYER || below == BlockTypes.AIR) {
            setBlockType(x,y,z,BlockTypes.AIR);
          }
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void cleanSnow(SnipeData v,Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int ty=targetBlock.getBlockY();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int miny=Math.max(GenericMath.floor(targetBlock.getBlockY() - brushSize),0);
  int maxy=Math.min(GenericMath.floor(targetBlock.getBlockY() + brushSize) + 1,WORLD_HEIGHT);
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  if (miny <= 0) {
    miny=1;
  }
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)* (brushSize + 1) / 3));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(tz - z) * (tz - z);
      for (int y=maxy; y >= miny; y--) {
        double ys=(ty - y) * (ty - y);
        if (xs + ys + zs < brushSizeSquared) {
          BlockType below=this.world.getBlockType(x,y,z);
          if (below == BlockTypes.SNOW_LAYER || below == BlockTypes.AIR) {
            setBlockType(x,y,z,BlockTypes.AIR);
          }
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97804
Project: 97804
Buggy source:
private void cylinder(SnipeData v,Location<World> targetBlock){
  int yStartingPoint=targetBlock.getBlockY() + v.getcCen();
  int yEndPoint=targetBlock.getBlockY() + v.getVoxelHeight() + v.getcCen();
  if (yEndPoint < yStartingPoint) {
    yEndPoint=yStartingPoint;
  }
  if (yStartingPoint < 0) {
    yStartingPoint=0;
  }
 else   if (yStartingPoint > WORLD_HEIGHT) {
    yStartingPoint=WORLD_HEIGHT;
  }
  if (yEndPoint < 0) {
    yEndPoint=0;
  }
 else   if (yEndPoint > WORLD_HEIGHT) {
    yEndPoint=WORLD_HEIGHT;
  }
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      if (xs + zs < brushSizeSquared) {
        for (int y=yEndPoint; y >= yStartingPoint; y--) {
          perform(v,x,targetBlock.getBlockY(),z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void cylinder(SnipeData v,Location<World> targetBlock){
  int yStartingPoint=targetBlock.getBlockY() + v.getcCen();
  int yEndPoint=targetBlock.getBlockY() + v.getVoxelHeight() + v.getcCen();
  if (yEndPoint < yStartingPoint) {
    yEndPoint=yStartingPoint;
  }
  if (yStartingPoint < 0) {
    yStartingPoint=0;
  }
 else   if (yStartingPoint > WORLD_HEIGHT) {
    yStartingPoint=WORLD_HEIGHT;
  }
  if (yEndPoint < 0) {
    yEndPoint=0;
  }
 else   if (yEndPoint > WORLD_HEIGHT) {
    yEndPoint=WORLD_HEIGHT;
  }
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(tz - z) * (tz - z);
      if (xs + zs < brushSizeSquared) {
        for (int y=yEndPoint; y >= yStartingPoint; y--) {
          perform(v,x,targetBlock.getBlockY(),z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97805
Project: 97805
Buggy source:
private void disc(final SnipeData v,final Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      if (xs + zs < brushSizeSquared) {
        perform(v,x,targetBlock.getBlockY(),z);
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void disc(final SnipeData v,final Location<World> targetBlock){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(tz - z) * (tz - z);
      if (xs + zs < brushSizeSquared) {
        perform(v,x,targetBlock.getBlockY(),z);
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97806
Project: 97806
Buggy source:
private void disc(final SnipeData v,Location<World> targetBlock,Direction axis){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + brushSize) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      if (xs + zs < brushSizeSquared) {
        if (axis == Direction.UP) {
          perform(v,x,targetBlock.getBlockY(),z);
        }
 else         if (axis == Direction.NORTH) {
          perform(v,x,z,targetBlock.getBlockZ());
        }
 else         if (axis == Direction.EAST) {
          perform(v,targetBlock.getBlockX(),x,z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void disc(final SnipeData v,Location<World> targetBlock,Direction axis){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int ty=targetBlock.getBlockY();
  int tz=targetBlock.getBlockZ();
  this.undo=new Undo(GenericMath.floor(Math.PI * (brushSize + 1) * (brushSize + 1)));
  int size=GenericMath.floor(brushSize) + 1;
  for (int x=-size; x <= size; x++) {
    for (int z=-size; z <= size; z++) {
      if (x * x + z * z < brushSizeSquared) {
        if (axis == Direction.UP) {
          perform(v,x + tx,targetBlock.getBlockY(),z + tz);
        }
 else         if (axis == Direction.NORTH) {
          perform(v,x + tx,z + ty,targetBlock.getBlockZ());
        }
 else         if (axis == Direction.EAST) {
          perform(v,targetBlock.getBlockX(),x + ty,z + tz);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97807
Project: 97807
Buggy source:
private void ellipse(final SnipeData v,Location<World> targetBlock,Direction axis){
  double xrads=this.xrad * this.xrad;
  double yrads=this.yrad * this.yrad;
  int minx=GenericMath.floor(targetBlock.getBlockX() - this.xrad);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + this.xrad) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - this.yrad);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + this.yrad) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (this.xrad + 1) * (this.yrad + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(minz - z) * (minz - z);
      if (xs / xrads + zs / yrads < 1) {
        if (axis == Direction.UP) {
          perform(v,x,targetBlock.getBlockY(),z);
        }
 else         if (axis == Direction.NORTH) {
          perform(v,x,z,targetBlock.getBlockZ());
        }
 else         if (axis == Direction.EAST) {
          perform(v,targetBlock.getBlockX(),x,z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void ellipse(final SnipeData v,Location<World> targetBlock,Direction axis){
  double xrads=this.xrad * this.xrad;
  double yrads=this.yrad * this.yrad;
  int tx=targetBlock.getBlockX();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - this.xrad);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + this.xrad) + 1;
  int minz=GenericMath.floor(targetBlock.getBlockZ() - this.yrad);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + this.yrad) + 1;
  this.undo=new Undo(GenericMath.floor(Math.PI * (this.xrad + 1) * (this.yrad + 1)));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int z=minz; z <= maxz; z++) {
      double zs=(tz - z) * (tz - z);
      if (xs / xrads + zs / yrads < 1) {
        if (axis == Direction.UP) {
          perform(v,x,targetBlock.getBlockY(),z);
        }
 else         if (axis == Direction.NORTH) {
          perform(v,x,z,targetBlock.getBlockZ());
        }
 else         if (axis == Direction.EAST) {
          perform(v,targetBlock.getBlockX(),x,z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97808
Project: 97808
Buggy source:
private void ellipsoid(final SnipeData v,Location<World> targetBlock){
  double xrads=this.xrad * this.xrad;
  double yrads=this.yrad * this.yrad;
  double zrads=this.zrad * this.zrad;
  int minx=GenericMath.floor(targetBlock.getBlockX() - this.xrad);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + this.xrad) + 1;
  int miny=Math.max(GenericMath.floor(targetBlock.getBlockY() - this.yrad),0);
  int maxy=Math.min(GenericMath.floor(targetBlock.getBlockY() + this.yrad) + 1,WORLD_HEIGHT);
  int minz=GenericMath.floor(targetBlock.getBlockZ() - this.zrad);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + this.zrad) + 1;
  this.undo=new Undo(GenericMath.floor(4 * Math.PI * (this.xrad + 1)* (this.yrad + 1)* (this.zrad + 1) / 3));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int y=miny; y <= maxy; y++) {
      double ys=(miny - y) * (miny - y);
      for (int z=minz; z <= maxz; z++) {
        double zs=(minz - z) * (minz - z);
        if (xs / xrads + ys / yrads + zs / zrads < 1) {
          perform(v,x,y,z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void ellipsoid(final SnipeData v,Location<World> targetBlock){
  double xrads=this.xrad * this.xrad;
  double yrads=this.yrad * this.yrad;
  double zrads=this.zrad * this.zrad;
  int tx=targetBlock.getBlockX();
  int ty=targetBlock.getBlockY();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(targetBlock.getBlockX() - this.xrad);
  int maxx=GenericMath.floor(targetBlock.getBlockX() + this.xrad) + 1;
  int miny=Math.max(GenericMath.floor(targetBlock.getBlockY() - this.yrad),0);
  int maxy=Math.min(GenericMath.floor(targetBlock.getBlockY() + this.yrad) + 1,WORLD_HEIGHT);
  int minz=GenericMath.floor(targetBlock.getBlockZ() - this.zrad);
  int maxz=GenericMath.floor(targetBlock.getBlockZ() + this.zrad) + 1;
  this.undo=new Undo(GenericMath.floor(4 * Math.PI * (this.xrad + 1)* (this.yrad + 1)* (this.zrad + 1) / 3));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int y=miny; y <= maxy; y++) {
      double ys=(ty - y) * (ty - y);
      for (int z=minz; z <= maxz; z++) {
        double zs=(tz - z) * (tz - z);
        if (xs / xrads + ys / yrads + zs / zrads < 1) {
          perform(v,x,y,z);
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97809
Project: 97809
Buggy source:
private void radialRemoval(SnipeData v){
  Vector3i chunkPos=this.targetBlock.getChunkPosition();
  int entityCount=0;
  int chunkCount=0;
  int radius=(int)Math.round(v.getBrushSize() / 16);
  int radiusSquared=radius * radius;
  for (int x=chunkPos.getX() - radius; x <= chunkPos.getX() + radius; x++) {
    for (int z=chunkPos.getZ() - radius; z <= chunkPos.getZ() + radius; z++) {
      if (x * x + z * z < radiusSquared) {
        Optional<Chunk> chunk=this.world.getChunk(x,0,z);
        if (chunk.isPresent()) {
          entityCount+=removeEntities(chunk.get());
          chunkCount++;
        }
      }
    }
  }
  v.sendMessage(TextColors.GREEN + "String_Node_Str" + TextColors.RED+ entityCount+ TextColors.GREEN+ "String_Node_Str"+ TextColors.BLUE+ chunkCount+ TextColors.GREEN+ (chunkCount == 1 ? "String_Node_Str" : "String_Node_Str"));
}

Fixed version (ground truth):
private void radialRemoval(SnipeData v){
  int cx=this.targetBlock.getChunkPosition().getX();
  int cz=this.targetBlock.getChunkPosition().getZ();
  int entityCount=0;
  int chunkCount=0;
  int radius=(int)Math.round(v.getBrushSize() / 16);
  int radiusSquared=radius * radius;
  for (int x=-radius; x <= radius; x++) {
    for (int z=-radius; z <= radius; z++) {
      if (x * x + z * z < radiusSquared) {
        Optional<Chunk> chunk=this.world.getChunk(x + cx,0,z + cz);
        if (chunk.isPresent()) {
          entityCount+=removeEntities(chunk.get());
          chunkCount++;
        }
      }
    }
  }
  v.sendMessage(TextColors.GREEN + "String_Node_Str" + TextColors.RED+ entityCount+ TextColors.GREEN+ "String_Node_Str"+ TextColors.BLUE+ chunkCount+ TextColors.GREEN+ (chunkCount == 1 ? "String_Node_Str" : "String_Node_Str"));
}
Program: 97811
Project: 97811
Buggy source:
@Override protected final void arrow(final SnipeData v){
}

Fixed version (ground truth):
@Override protected final void arrow(final SnipeData v){
  Entity e=this.world.createEntity(EntityTypes.LIGHTNING,this.targetBlock.getBlockPosition());
  this.world.spawnEntity(e,this.cause);
}
Program: 97812
Project: 97812
Buggy source:
@Override protected final void powder(final SnipeData v){
}

Fixed version (ground truth):
@Override protected final void powder(final SnipeData v){
  arrow(v);
}
Program: 97813
Project: 97813
Buggy source:
private void rotate(final SnipeData v){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int minx=GenericMath.floor(this.targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(this.targetBlock.getBlockX() + brushSize) + 1;
  int miny=Math.max(GenericMath.floor(this.targetBlock.getBlockY() - brushSize),0);
  int maxy=Math.min(GenericMath.floor(this.targetBlock.getBlockY() + brushSize) + 1,WORLD_HEIGHT);
  int minz=GenericMath.floor(this.targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(this.targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(4 * Math.PI * (brushSize + 1)* (brushSize + 1)* (brushSize + 1) / 3));
  for (int x=minx; x <= maxx; x++) {
    double xs=(minx - x) * (minx - x);
    for (int y=miny; y <= maxy; y++) {
      double ys=(miny - y) * (miny - y);
      for (int z=minz; z <= maxz; z++) {
        double zs=(minz - z) * (minz - z);
        if (xs + ys + zs < brushSizeSquared) {
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}

Fixed version (ground truth):
private void rotate(final SnipeData v){
  double brushSize=v.getBrushSize();
  double brushSizeSquared=brushSize * brushSize;
  int tx=targetBlock.getBlockX();
  int ty=targetBlock.getBlockY();
  int tz=targetBlock.getBlockZ();
  int minx=GenericMath.floor(this.targetBlock.getBlockX() - brushSize);
  int maxx=GenericMath.floor(this.targetBlock.getBlockX() + brushSize) + 1;
  int miny=Math.max(GenericMath.floor(this.targetBlock.getBlockY() - brushSize),0);
  int maxy=Math.min(GenericMath.floor(this.targetBlock.getBlockY() + brushSize) + 1,WORLD_HEIGHT);
  int minz=GenericMath.floor(this.targetBlock.getBlockZ() - brushSize);
  int maxz=GenericMath.floor(this.targetBlock.getBlockZ() + brushSize) + 1;
  this.undo=new Undo(GenericMath.floor(4 * Math.PI * (brushSize + 1)* (brushSize + 1)* (brushSize + 1) / 3));
  for (int x=minx; x <= maxx; x++) {
    double xs=(tx - x) * (tx - x);
    for (int y=miny; y <= maxy; y++) {
      double ys=(ty - y) * (ty - y);
      for (int z=minz; z <= maxz; z++) {
        double zs=(tz - z) * (tz - z);
        if (xs + ys + zs < brushSizeSquared) {
        }
      }
    }
  }
  v.owner().storeUndo(this.undo);
  this.undo=null;
}
Program: 97814
Project: 97814
Buggy source:
/** 
 * Padds an empty String to the front of the array.
 * @param args Array to pad empty string in front of
 * @return padded array
 */
protected String[] hackTheArray(String[] args){
  String[] returnValue=new String[args.length + 1];
  for (int i=0, argsLength=args.length; i < argsLength; i++) {
    String arg=args[i];
    returnValue[i + 1]=arg;
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Padds an empty String to the front of the array.
 * @param args Array to pad empty string in front of
 * @return padded array
 */
protected String[] hackTheArray(String[] args){
  String[] returnValue=new String[args.length + 1];
  returnValue[0]="String_Node_Str";
  for (int i=0, argsLength=args.length; i < argsLength; i++) {
    String arg=args[i];
    returnValue[i + 1]=arg;
  }
  return returnValue;
}
Program: 97816
Project: 97816
Buggy source:
private void doFireball(final SnipeData v){
  final Vector targetCoords=new Vector(this.getTargetBlock().getX() + .5 * this.getTargetBlock().getX() / Math.abs(this.getTargetBlock().getX()),this.getTargetBlock().getY() + .5,this.getTargetBlock().getZ() + .5 * this.getTargetBlock().getZ() / Math.abs(this.getTargetBlock().getZ()));
  final Location playerLocation=v.owner().getPlayer().getLocation();
  final Vector slope=targetCoords.subtract(playerLocation.toVector());
  if (useBigBalls) {
    v.owner().getPlayer().launchProjectile(LargeFireball.class).setVelocity(slope.normalize());
  }
 else {
    v.owner().getPlayer().launchProjectile(SmallFireball.class).setVelocity(slope.normalize());
  }
}

Fixed version (ground truth):
private void doFireball(final SnipeData v){
  final Vector targetCoords=new Vector(this.getTargetBlock().getX() + .5 * this.getTargetBlock().getX() / Math.abs(this.getTargetBlock().getX()),this.getTargetBlock().getY() + .5,this.getTargetBlock().getZ() + .5 * this.getTargetBlock().getZ() / Math.abs(this.getTargetBlock().getZ()));
  final Location playerLocation=v.owner().getPlayer().getEyeLocation();
  final Vector slope=targetCoords.subtract(playerLocation.toVector());
  if (useBigBalls) {
    v.owner().getPlayer().launchProjectile(LargeFireball.class).setVelocity(slope.normalize());
  }
 else {
    v.owner().getPlayer().launchProjectile(SmallFireball.class).setVelocity(slope.normalize());
  }
}