nus-yam/ex-repair huggingface dataset:
Program: 156274
Project: 156274
Buggy source:
/** 
 * @return True if {@link #craft()} might return true, or false if {@link #craft()} will definitely returnfalse. 
 */
public boolean canCraft(){
  if (currentRecipe == null || isBlueprintDirty) {
    return false;
  }
  if (!invResult.canFullyAccept(assumedResult)) {
    return false;
  }
  if (areMaterialsDirty) {
    areMaterialsDirty=false;
switch (recipeType) {
case INGREDIENTS:
{
      }
case EXACT_STACKS:
{
      cachedHasRequirements=hasExactStacks();
      break;
    }
default :
{
    throw new IllegalStateException("String_Node_Str" + recipeType);
  }
}
}
return cachedHasRequirements;
}

Fixed version (ground truth):
/** 
 * @return True if {@link #craft()} might return true, or false if {@link #craft()} will definitely returnfalse. 
 */
public boolean canCraft(){
  if (currentRecipe == null || isBlueprintDirty) {
    return false;
  }
  if (!invResult.canFullyAccept(assumedResult)) {
    return false;
  }
  if (areMaterialsDirty) {
    areMaterialsDirty=false;
switch (recipeType) {
case INGREDIENTS:
case EXACT_STACKS:
{
        cachedHasRequirements=hasExactStacks();
        break;
      }
default :
{
      throw new IllegalStateException("String_Node_Str" + recipeType);
    }
}
}
return cachedHasRequirements;
}
Program: 156275
Project: 156275
Buggy source:
public void rotateIfInvalid(){
  BCLog.logger.info("String_Node_Str" + StringUtilBC.blockPosToString(getPos()));
  if (currentDirection != null && isFacingReceiver(currentDirection)) {
    return;
  }
  attemptRotation();
  if (currentDirection == null) {
    currentDirection=EnumFacing.UP;
  }
}

Fixed version (ground truth):
public void rotateIfInvalid(){
  if (currentDirection != null && isFacingReceiver(currentDirection)) {
    return;
  }
  attemptRotation();
  if (currentDirection == null) {
    currentDirection=EnumFacing.UP;
  }
}
Program: 156276
Project: 156276
Buggy source:
public EnumActionResult attemptRotation(){
  BCLog.logger.info("String_Node_Str" + StringUtilBC.blockPosToString(getPos()));
  OrderedEnumMap<EnumFacing> possible=VanillaRotationHandlers.ROTATE_FACING;
  EnumFacing current=currentDirection;
  for (int i=0; i < 6; i++) {
    current=possible.next(current);
    if (isFacingReceiver(current)) {
      if (currentDirection != current) {
        currentDirection=current;
        sendNetworkUpdate(NET_RENDER_DATA);
        redrawBlock();
        world.notifyNeighborsRespectDebug(getPos(),getBlockType(),true);
        return EnumActionResult.SUCCESS;
      }
      return EnumActionResult.FAIL;
    }
  }
  return EnumActionResult.FAIL;
}

Fixed version (ground truth):
public EnumActionResult attemptRotation(){
  OrderedEnumMap<EnumFacing> possible=VanillaRotationHandlers.ROTATE_FACING;
  EnumFacing current=currentDirection;
  for (int i=0; i < 6; i++) {
    current=possible.next(current);
    if (isFacingReceiver(current)) {
      if (currentDirection != current) {
        currentDirection=current;
        sendNetworkUpdate(NET_RENDER_DATA);
        redrawBlock();
        world.notifyNeighborsRespectDebug(getPos(),getBlockType(),true);
        return EnumActionResult.SUCCESS;
      }
      return EnumActionResult.FAIL;
    }
  }
  return EnumActionResult.FAIL;
}
Program: 156277
Project: 156277
Buggy source:
public PipeFlowPower(IPipe pipe,NBTTagCompound nbt){
  super(pipe,nbt);
  sections=new EnumMap<>(EnumFacing.class);
  for (  EnumFacing face : EnumFacing.VALUES) {
    sections.put(face,new Section(face));
  }
}

Fixed version (ground truth):
public PipeFlowPower(IPipe pipe,NBTTagCompound nbt){
  super(pipe,nbt);
  isReceiver=nbt.getBoolean("String_Node_Str");
  sections=new EnumMap<>(EnumFacing.class);
  for (  EnumFacing face : EnumFacing.VALUES) {
    sections.put(face,new Section(face));
  }
}
Program: 156278
Project: 156278
Buggy source:
@Override public NBTTagCompound writeToNbt(){
  NBTTagCompound nbt=super.writeToNbt();
  return nbt;
}

Fixed version (ground truth):
@Override public NBTTagCompound writeToNbt(){
  NBTTagCompound nbt=super.writeToNbt();
  nbt.setBoolean("String_Node_Str",isReceiver);
  return nbt;
}
Program: 156279
Project: 156279
Buggy source:
@SubscribeEvent public static void renderOverlay(RenderGameOverlayEvent.Text event){
  Minecraft mc=Minecraft.getMinecraft();
  if (!mc.gameSettings.showDebugInfo)   return;
  if (mc.player.hasReducedDebug() || mc.gameSettings.reducedDebugInfo || !mc.player.capabilities.isCreativeMode) {
    return;
  }
  List<String> left=event.getLeft();
  List<String> right=event.getRight();
  RayTraceResult mouseOver=mc.objectMouseOver;
  if (mouseOver == null) {
    return;
  }
  getDebuggableObject(mouseOver).ifPresent(client -> {
    EnumFacing side=mouseOver.sideHit;
    MessageManager.sendToServer(new MessageDebuggableRequest(client.getPos(),side));
    List<String> clientLeft=new ArrayList<>();
    List<String> clientRight=new ArrayList<>();
    client.getClientDebugInfo(clientLeft,clientRight,side);
    final String headerFirst=DIFF_HEADER_FORMATTING + "String_Node_Str";
    final String headerSecond=DIFF_HEADER_FORMATTING + "String_Node_Str";
    appendDiff(left,ClientDebuggables.SERVER_LEFT,clientLeft,headerFirst,headerSecond);
    appendDiff(right,ClientDebuggables.SERVER_RIGHT,clientRight,headerFirst,headerSecond);
  }
);
}

Fixed version (ground truth):
@SubscribeEvent public static void renderOverlay(RenderGameOverlayEvent.Text event){
  Minecraft mc=Minecraft.getMinecraft();
  if (!mc.gameSettings.showDebugInfo)   return;
  if (mc.player.hasReducedDebug() || mc.gameSettings.reducedDebugInfo || !mc.player.capabilities.isCreativeMode) {
    return;
  }
  List<String> left=event.getLeft();
  List<String> right=event.getRight();
  ClientDebuggables.getDebuggableTileSide().ifPresent(tileSide -> {
    List<String> clientLeft=new ArrayList<>();
    List<String> clientRight=new ArrayList<>();
    tileSide.getLeft().getClientDebugInfo(clientLeft,clientRight,tileSide.getRight());
    final String headerFirst=DIFF_HEADER_FORMATTING + "String_Node_Str";
    final String headerSecond=DIFF_HEADER_FORMATTING + "String_Node_Str";
    appendDiff(left,ClientDebuggables.SERVER_LEFT,clientLeft,headerFirst,headerSecond);
    appendDiff(right,ClientDebuggables.SERVER_RIGHT,clientRight,headerFirst,headerSecond);
  }
);
}
Program: 156280
Project: 156280
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str");
  left.add("String_Node_Str" + box.min());
  left.add("String_Node_Str" + box.max());
  left.add("String_Node_Str" + scanning);
  left.add("String_Node_Str" + (boxIterator == null ? null : boxIterator.getCurrent()));
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str");
  left.add("String_Node_Str" + box.min());
  left.add("String_Node_Str" + box.max());
  left.add("String_Node_Str" + scanning);
  left.add("String_Node_Str" + (boxIterator == null ? null : boxIterator.getCurrent()));
}
Program: 156281
Project: 156281
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + battery.getDebugString());
  left.add("String_Node_Str" + (basePoses == null ? "String_Node_Str" : basePoses.size()));
  left.add("String_Node_Str" + currentBasePosIndex);
  left.add("String_Node_Str" + isDone);
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + battery.getDebugString());
  left.add("String_Node_Str" + (basePoses == null ? "String_Node_Str" : basePoses.size()));
  left.add("String_Node_Str" + currentBasePosIndex);
  left.add("String_Node_Str" + isDone);
}
Program: 156282
Project: 156282
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + battery.getDebugString());
  left.add("String_Node_Str" + addon);
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + battery.getDebugString());
  left.add("String_Node_Str" + addon);
}
Program: 156284
Project: 156284
Buggy source:
public static void reloadConfig(EnumRestartRequirement restarted){
  useLocalServerOnClient=propUseLocalServerOnClient.getBoolean();
  minePlayerProtected=propMinePlayerProtected.getBoolean();
  BCLibConfig.useColouredLabels=propUseColouredLabels.getBoolean();
  BCLibConfig.useHighContrastLabelColours=propUseHighContrastColouredLabels.getBoolean();
  hidePower=propHidePower.getBoolean();
  hideFluid=propHideFluid.getBoolean();
  BCLibConfig.useBucketsStatic=propUseBucketsStatic.getBoolean();
  BCLibConfig.useBucketsFlow=propUseBucketsFlow.getBoolean();
  BCLibConfig.useLongLocalizedName=propUseLongLocalizedName.getBoolean();
  BCLibConfig.itemLifespan=propItemLifespan.getInt();
  markerMaxDistance=propMarkerMaxDistance.getInt();
  BCLibConfig.colourBlindMode=propColourBlindMode.getBoolean();
  BCLibConfig.displayTimeGap=ConfigUtil.parseEnumForConfig(propDisplayTimeGap.getString(),TimeGap.values(),TimeGap.TICKS);
  if (EnumRestartRequirement.GAME.hasBeenRestarted(restarted)) {
    worldGen=propWorldGen.getBoolean();
    worldGenWaterSpring=propWorldGenWaterSpring.getBoolean();
  }
  BCLibConfig.refreshConfigs();
  if (config.hasChanged()) {
    config.save();
  }
  if (objConfig.hasChanged()) {
    objConfig.save();
  }
}

Fixed version (ground truth):
public static void reloadConfig(EnumRestartRequirement restarted){
  minePlayerProtected=propMinePlayerProtected.getBoolean();
  BCLibConfig.useColouredLabels=propUseColouredLabels.getBoolean();
  BCLibConfig.useHighContrastLabelColours=propUseHighContrastColouredLabels.getBoolean();
  hidePower=propHidePower.getBoolean();
  hideFluid=propHideFluid.getBoolean();
  BCLibConfig.useBucketsStatic=propUseBucketsStatic.getBoolean();
  BCLibConfig.useBucketsFlow=propUseBucketsFlow.getBoolean();
  BCLibConfig.useLongLocalizedName=propUseLongLocalizedName.getBoolean();
  BCLibConfig.itemLifespan=propItemLifespan.getInt();
  markerMaxDistance=propMarkerMaxDistance.getInt();
  BCLibConfig.colourBlindMode=propColourBlindMode.getBoolean();
  BCLibConfig.displayTimeGap=ConfigUtil.parseEnumForConfig(propDisplayTimeGap.getString(),TimeGap.values(),TimeGap.TICKS);
  if (EnumRestartRequirement.GAME.hasBeenRestarted(restarted)) {
    worldGen=propWorldGen.getBoolean();
    worldGenWaterSpring=propWorldGenWaterSpring.getBoolean();
  }
  BCLibConfig.refreshConfigs();
  if (config.hasChanged()) {
    config.save();
  }
  if (objConfig.hasChanged()) {
    objConfig.save();
  }
}
Program: 156285
Project: 156285
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  super.getDebugInfo(left,right,side);
  left.add("String_Node_Str");
  left.add("String_Node_Str" + tank1.getContentsString());
  left.add("String_Node_Str" + tank2.getContentsString());
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  super.getDebugInfo(left,right,side);
  left.add("String_Node_Str");
  left.add("String_Node_Str" + tank1.getContentsString());
  left.add("String_Node_Str" + tank2.getContentsString());
}
Program: 156286
Project: 156286
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + tankIn.getDebugString());
  left.add("String_Node_Str" + tankGasOut.getDebugString());
  left.add("String_Node_Str" + tankLiquidOut.getDebugString());
  left.add("String_Node_Str" + mjBattery.getDebugString());
  left.add("String_Node_Str" + MjAPI.formatMj(distillPower));
  left.add("String_Node_Str" + LocaleUtil.localizeMjFlow(powerAvgClient));
  left.add("String_Node_Str" + currentRecipe);
  if (world.isRemote) {
    setClientModelVariables(1);
    left.add("String_Node_Str");
    left.add("String_Node_Str" + MODEL_FACING.value);
    left.add("String_Node_Str" + MODEL_ACTIVE.value);
    left.add("String_Node_Str" + MODEL_POWER_AVG.value);
    left.add("String_Node_Str" + MODEL_POWER_MAX.value);
    left.add("String_Node_Str");
    clientModelData.refresh();
    clientModelData.addDebugInfo(left);
  }
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + tankIn.getDebugString());
  left.add("String_Node_Str" + tankGasOut.getDebugString());
  left.add("String_Node_Str" + tankLiquidOut.getDebugString());
  left.add("String_Node_Str" + mjBattery.getDebugString());
  left.add("String_Node_Str" + MjAPI.formatMj(distillPower));
  left.add("String_Node_Str" + LocaleUtil.localizeMjFlow(powerAvgClient));
  left.add("String_Node_Str" + currentRecipe);
}
Program: 156287
Project: 156287
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + tank.getDebugString());
  String s="String_Node_Str";
  for (  EnumFacing f : EnumFacing.VALUES) {
    if (openSides.contains(f)) {
      if (s.length() > 0) {
        s+="String_Node_Str";
      }
      s+=f.getName();
    }
  }
  left.add("String_Node_Str" + s);
  left.add("String_Node_Str" + getCurrentDelay());
  left.add("String_Node_Str" + tick);
  left.add("String_Node_Str" + queue.size());
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + tank.getDebugString());
  left.add("String_Node_Str" + openSides.stream().map(Enum::name).collect(Collectors.joining("String_Node_Str")));
  left.add("String_Node_Str" + getCurrentDelay());
  left.add("String_Node_Str" + tick);
  left.add("String_Node_Str" + queue.size());
}
Program: 156288
Project: 156288
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  if (hasWorld() && world.isRemote) {
    left.add("String_Node_Str");
    smoothedCoolableIn.getDebugInfo(left,right,side);
    left.add("String_Node_Str");
    left.add("String_Node_Str");
    smoothedHeatableOut.getDebugInfo(left,right,side);
  }
 else {
    left.add("String_Node_Str" + tankHeatableOut.getDebugString());
    left.add("String_Node_Str" + tankCoolableIn.getDebugString());
  }
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + tankHeatableOut.getDebugString());
  left.add("String_Node_Str" + tankCoolableIn.getDebugString());
}
Program: 156289
Project: 156289
Buggy source:
@Override @SideOnly(Side.CLIENT) public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + progress);
  left.add("String_Node_Str" + progressState);
  left.add("String_Node_Str" + (tileEnd != null));
  left.add("String_Node_Str" + heatProvided);
  left.add("String_Node_Str" + coolingProvided);
  if (hasWorld() && world.isRemote) {
    left.add("String_Node_Str");
    left.add("String_Node_Str");
    smoothedCoolableOut.getDebugInfo(left,right,side);
    left.add("String_Node_Str");
    left.add("String_Node_Str");
    smoothedHeatableIn.getDebugInfo(left,right,side);
  }
 else {
    left.add("String_Node_Str" + tankHeatableIn.getDebugString());
    left.add("String_Node_Str" + tankCoolableOut.getDebugString());
  }
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str" + progress);
  left.add("String_Node_Str" + progressState);
  left.add("String_Node_Str" + (tileEnd != null));
  left.add("String_Node_Str" + heatProvided);
  left.add("String_Node_Str" + coolingProvided);
  left.add("String_Node_Str" + tankHeatableIn.getDebugString());
  left.add("String_Node_Str" + tankCoolableOut.getDebugString());
}
Program: 156290
Project: 156290
Buggy source:
public static void init(){
  PipeConnectionAPI.registerConnection(Blocks.BREWING_STAND,(world,pos,face,state) -> face.getAxis().getPlane() == EnumFacing.Plane.HORIZONTAL ? 4 / 16F : 0);
  PipeApi.stripeRegistry.addHandler(StripesHandlerPlant.INSTANCE);
  PipeApi.stripeRegistry.addHandler(StripesHandlerShears.INSTANCE);
  PipeApi.stripeRegistry.addHandler(StripesHandlerEntityInteract.INSTANCE,EnumHandlerPriority.LOW);
  PipeApi.stripeRegistry.addHandler(StripesHandlerHoe.INSTANCE);
  PipeApi.stripeRegistry.addHandler(StripesHandlerDispenser.INSTANCE,EnumHandlerPriority.LOW);
  PipeApi.stripeRegistry.addHandler(StripesHandlerPlaceBlock.INSTANCE,EnumHandlerPriority.LOW);
  PipeApi.stripeRegistry.addHandler(StripesHandlerUse.INSTANCE,EnumHandlerPriority.LOW);
  StripesHandlerDispenser.ITEM_CLASSES.add(ItemBucket.class);
  StripesHandlerDispenser.ITEM_CLASSES.add(ItemMinecart.class);
  StripesHandlerUse.ITEMS.add(Items.FIREWORKS);
  PipeApi.stripeRegistry.addHandler(StripesHandlerMinecartDestroy.INSTANCE);
}

Fixed version (ground truth):
public static void init(){
  PipeConnectionAPI.registerConnection(Blocks.BREWING_STAND,(world,pos,face,state) -> face.getAxis().getPlane() == EnumFacing.Plane.HORIZONTAL ? 4 / 16F : 0);
  PipeApi.stripeRegistry.addHandler(StripesHandlerPlant.INSTANCE);
  PipeApi.stripeRegistry.addHandler(StripesHandlerShears.INSTANCE);
  PipeApi.stripeRegistry.addHandler(StripesHandlerEntityInteract.INSTANCE,EnumHandlerPriority.LOW);
  PipeApi.stripeRegistry.addHandler(StripesHandlerHoe.INSTANCE);
  PipeApi.stripeRegistry.addHandler(StripesHandlerDispenser.INSTANCE,EnumHandlerPriority.LOW);
  PipeApi.stripeRegistry.addHandler(StripesHandlerPlaceBlock.INSTANCE,EnumHandlerPriority.LOW);
  PipeApi.stripeRegistry.addHandler(StripesHandlerUse.INSTANCE,EnumHandlerPriority.LOW);
  PipeApi.stripeRegistry.addHandler(StripesHandlerMinecartDestroy.INSTANCE);
}
Program: 156291
Project: 156291
Buggy source:
private void findPossibleTargets(){
  possible=new ArrayList<>();
  IBlockState state=world.getBlockState(pos);
  if (state.getBlock() != BCSiliconBlocks.laser) {
    return;
  }
  EnumFacing face=state.getValue(BuildCraftProperties.BLOCK_FACING_6);
  VolumeUtil.iterateCone(world,pos,face,TARGETING_RANGE,true,(w,s,p,visible) -> {
    if (!visible) {
      return;
    }
    IBlockState stateAt=world.getBlockState(p);
    if (stateAt.getBlock() instanceof ILaserTargetBlock) {
      TileEntity tileAt=world.getTileEntity(p);
      if (tileAt instanceof ILaserTarget) {
        ILaserTarget targetAt=(ILaserTarget)tileAt;
        if (targetAt.getRequiredLaserPower() > 0) {
          possible.add(p);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void findPossibleTargets(){
  targetPositions=new ArrayList<>();
  IBlockState state=world.getBlockState(pos);
  if (state.getBlock() != BCSiliconBlocks.laser) {
    return;
  }
  EnumFacing face=state.getValue(BuildCraftProperties.BLOCK_FACING_6);
  VolumeUtil.iterateCone(world,pos,face,TARGETING_RANGE,true,(w,s,p,visible) -> {
    if (!visible) {
      return;
    }
    IBlockState stateAt=world.getBlockState(p);
    if (stateAt.getBlock() instanceof ILaserTargetBlock) {
      TileEntity tileAt=world.getTileEntity(p);
      if (tileAt instanceof ILaserTarget) {
        targetPositions.add(p);
      }
    }
  }
);
}
Program: 156292
Project: 156292
Buggy source:
private void randomlyChooseTargetPos(){
  if (possible.isEmpty()) {
    targetPos=null;
    return;
  }
  targetPos=possible.get(world.rand.nextInt(possible.size()));
}

Fixed version (ground truth):
private void randomlyChooseTargetPos(){
  List<BlockPos> targetsNeedingPower=new ArrayList<>();
  for (  BlockPos position : targetPositions) {
    if (powerNeededAt(position)) {
      targetsNeedingPower.add(position);
    }
  }
  if (targetsNeedingPower.isEmpty()) {
    targetPos=null;
    return;
  }
  targetPos=targetsNeedingPower.get(world.rand.nextInt(targetsNeedingPower.size()));
}
Program: 156293
Project: 156293
Buggy source:
@Override public void update(){
  if (world.isRemote) {
    if (clientLaserMoveInterval.markTimeIfDelay(world) || targetPos == null) {
      updateLaser();
    }
    return;
  }
  avgPower.tick();
  BlockPos previousTargetPos=targetPos;
  if (possible == null) {
    findPossibleTargets();
  }
  if (getTarget() == null) {
    targetPos=null;
  }
  if (serverTargetMoveInterval.markTimeIfDelay(world) || getTarget() == null) {
    randomlyChooseTargetPos();
  }
  ILaserTarget target=getTarget();
  if (target != null) {
    long max=getMaxPowerPerTick();
    max*=battery.getStored() + max;
    max/=battery.getCapacity() / 2;
    max=Math.min(Math.min(max,getMaxPowerPerTick()),target.getRequiredLaserPower());
    long power=battery.extractPower(0,max);
    long excess=target.receiveLaserPower(power);
    if (excess > 0) {
      battery.addPowerChecking(excess,false);
    }
    avgPower.push(power - excess);
  }
 else {
    avgPower.clear();
  }
  if (!Objects.equals(previousTargetPos,targetPos)) {
    sendNetworkUpdate(NET_RENDER_DATA);
  }
}

Fixed version (ground truth):
@Override public void update(){
  if (world.isRemote) {
    if (clientLaserMoveInterval.markTimeIfDelay(world) || targetPos == null) {
      updateLaser();
    }
    return;
  }
  avgPower.tick();
  BlockPos previousTargetPos=targetPos;
  if (targetPositions == null) {
    findPossibleTargets();
  }
  if (!powerNeededAt(targetPos)) {
    targetPos=null;
  }
  if (serverTargetMoveInterval.markTimeIfDelay(world) || !powerNeededAt(targetPos)) {
    randomlyChooseTargetPos();
  }
  ILaserTarget target=getTarget();
  if (target != null) {
    long max=getMaxPowerPerTick();
    max*=battery.getStored() + max;
    max/=battery.getCapacity() / 2;
    max=Math.min(Math.min(max,getMaxPowerPerTick()),target.getRequiredLaserPower());
    long power=battery.extractPower(0,max);
    long excess=target.receiveLaserPower(power);
    if (excess > 0) {
      battery.addPowerChecking(excess,false);
    }
    avgPower.push(power - excess);
  }
 else {
    avgPower.clear();
  }
  if (!Objects.equals(previousTargetPos,targetPos)) {
    sendNetworkUpdate(NET_RENDER_DATA);
  }
}
Program: 156294
Project: 156294
Buggy source:
private ILaserTarget getTarget(){
  if (targetPos != null) {
    TileEntity tile=world.getTileEntity(targetPos);
    if (tile instanceof ILaserTarget) {
      ILaserTarget target=(ILaserTarget)tile;
      return target.getRequiredLaserPower() > 0 ? target : null;
    }
 else {
      possible.remove(targetPos);
      return null;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private ILaserTarget getTarget(){
  if (targetPos != null) {
    return (ILaserTarget)world.getTileEntity(targetPos);
  }
  return null;
}
Program: 156297
Project: 156297
Buggy source:
public void arc(int ca,int cb,double ra,double rb,int da,int db,ArcType type){
  ra=Math.max(1,ra);
  rb=Math.max(1,rb);
  double ra2=ra * ra;
  double rb2=rb * rb;
  double sigma=2 * rb2 + ra2 * (1 - 2 * rb);
  for (int a=0, b=(int)rb; rb2 * a <= ra2 * b; a++) {
    iterator.iterate(ca - a,cb - b);
    if (type.shouldDrawSecondQuadrant()) {
      iterator.iterate(ca + a + da,cb - b);
      if (type.shouldDrawAllQuadrants()) {
        iterator.iterate(ca - a,cb + b + db);
        iterator.iterate(ca + a + da,cb + b + db);
      }
    }
    if (sigma >= 0) {
      sigma+=4 * ra2 * (1 - b);
      b--;
    }
    sigma+=rb2 * ((4 * a) + 6);
  }
  sigma=2 * ra2 + rb2 * (1 - 2 * ra);
  for (int a=(int)ra, b=0; ra2 * b <= rb2 * a; b++) {
    iterator.iterate(ca - a,cb - b);
    if (type.shouldDrawSecondQuadrant()) {
      iterator.iterate(ca + a + da,cb - b);
      if (type.shouldDrawAllQuadrants()) {
        iterator.iterate(ca - a,cb + b + db);
        iterator.iterate(ca + a + da,cb + b + db);
      }
    }
    if (sigma >= 0) {
      sigma+=4 * rb2 * (1 - a);
      a--;
    }
    sigma+=ra2 * ((4 * b) + 6);
  }
}

Fixed version (ground truth):
public void arc(int ca,int cb,double ra,double rb,int da,int db,ArcType type){
  if (ra <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + ra + "String_Node_Str");
  }
  if (rb <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + rb + "String_Node_Str");
  }
  double ra2=ra * ra;
  double rb2=rb * rb;
  double sigma=2 * rb2 + ra2 * (1 - 2 * rb);
  for (int a=0, b=(int)rb; rb2 * a <= ra2 * b; a++) {
    iterator.iterate(ca - a,cb - b);
    if (type.shouldDrawSecondQuadrant()) {
      iterator.iterate(ca + a + da,cb - b);
      if (type.shouldDrawAllQuadrants()) {
        iterator.iterate(ca - a,cb + b + db);
        iterator.iterate(ca + a + da,cb + b + db);
      }
    }
    if (sigma >= 0) {
      sigma+=4 * ra2 * (1 - b);
      b--;
    }
    sigma+=rb2 * ((4 * a) + 6);
  }
  sigma=2 * ra2 + rb2 * (1 - 2 * ra);
  for (int a=(int)ra, b=0; ra2 * b <= rb2 * a; b++) {
    iterator.iterate(ca - a,cb - b);
    if (type.shouldDrawSecondQuadrant()) {
      iterator.iterate(ca + a + da,cb - b);
      if (type.shouldDrawAllQuadrants()) {
        iterator.iterate(ca - a,cb + b + db);
        iterator.iterate(ca + a + da,cb + b + db);
      }
    }
    if (sigma >= 0) {
      sigma+=4 * rb2 * (1 - a);
      a--;
    }
    sigma+=ra2 * ((4 * b) + 6);
  }
}
Program: 156298
Project: 156298
Buggy source:
@Override protected void genShape(int maxA,int maxB,LineList list){
  list.setFillPoint(maxA,maxB);
  list.arc(maxA,maxB,maxA,maxB);
}

Fixed version (ground truth):
@Override protected void genShape(int maxA,int maxB,LineList list){
  if (maxA == 0 || maxB == 0) {
    list.moveTo(0,0);
    list.lineTo(maxA,maxB);
    return;
  }
  list.setFillPoint(maxA,maxB);
  list.arc(maxA,maxB,maxA,maxB);
}
Program: 156299
Project: 156299
Buggy source:
@Override protected void genShape(int maxA,int maxB,LineList list){
  int halfA=maxA / 2;
  int halfB=maxB / 2;
  int halfAUpper=maxA - halfA;
  int halfBUpper=maxB - halfB;
  list.setFillPoint(halfA,halfB);
  list.arc(halfA,halfB,maxA / 2.0,maxB / 2.0,halfAUpper - halfA,halfBUpper - halfB,ArcType.FULL_CIRCLE);
}

Fixed version (ground truth):
@Override protected void genShape(int maxA,int maxB,LineList list){
  if (maxA == 0 || maxB == 0) {
    list.moveTo(0,0);
    list.lineTo(maxA,maxB);
    return;
  }
  int halfA=maxA / 2;
  int halfB=maxB / 2;
  int halfAUpper=maxA - halfA;
  int halfBUpper=maxB - halfB;
  list.setFillPoint(halfA,halfB);
  list.arc(halfA,halfB,maxA / 2.0,maxB / 2.0,halfAUpper - halfA,halfBUpper - halfB,ArcType.FULL_CIRCLE);
}
Program: 156300
Project: 156300
Buggy source:
@Override protected void genShape(int maxA,int maxB,LineList list){
  int halfA=maxA / 2;
  int halfAUpper=maxA - halfA;
  list.setFillPoint(halfA,maxB);
  list.arc(halfA,maxB,maxA / 2.0,maxB,halfAUpper - halfA,0,ArcType.SEMI_CIRCLE);
}

Fixed version (ground truth):
@Override protected void genShape(int maxA,int maxB,LineList list){
  if (maxA == 0 || maxB == 0) {
    list.moveTo(0,0);
    list.lineTo(maxA,maxB);
    return;
  }
  int halfA=maxA / 2;
  int halfAUpper=maxA - halfA;
  list.setFillPoint(halfA,maxB);
  list.arc(halfA,maxB,maxA / 2.0,maxB,halfAUpper - halfA,0,ArcType.SEMI_CIRCLE);
}
Program: 156303
Project: 156303
Buggy source:
public String toFormatString(){
  StringBuilder miscString=new StringBuilder();
  for (  TextFormatting format : misc) {
    miscString.append(format.toString());
  }
  return (colour == null ? "String_Node_Str" : colour.toString()) + miscString + text;
}

Fixed version (ground truth):
public String toFormatString(){
  StringBuilder miscString=new StringBuilder();
  for (  TextFormatting format : misc) {
    miscString.append(format.toString());
  }
  return TextFormatting.RESET + (colour == null ? "String_Node_Str" : colour.toString()) + miscString+ text;
}
Program: 156305
Project: 156305
Buggy source:
@Override public boolean isTriggerActive(TileEntity tile,EnumFacing side,IStatementContainer container,IStatementParameter[] parameters){
  ItemStack searchedStack=StackUtil.EMPTY;
  if (parameters != null && parameters.length >= 1 && parameters[0] != null) {
    searchedStack=parameters[0].getItemStack();
  }
  IItemHandler handler=tile.getCapability(CapUtil.CAP_ITEMS,side.getOpposite());
  if (handler != null) {
    boolean hasSlots=false;
    boolean foundItems=false;
    boolean foundSpace=false;
    for (int i=0; i < handler.getSlots(); i++) {
      hasSlots=true;
      ItemStack stack=handler.getStackInSlot(i);
      foundItems|=!stack.isEmpty() && (searchedStack.isEmpty() || StackUtil.canStacksOrListsMerge(stack,searchedStack));
      foundSpace|=(stack.isEmpty() | (StackUtil.canStacksOrListsMerge(stack,searchedStack) && stack.getCount() < stack.getMaxStackSize())) && (searchedStack.isEmpty() || searchedStack.getItem() instanceof IList || handler.insertItem(i,searchedStack,true).isEmpty());
    }
    if (!hasSlots) {
      return false;
    }
switch (state) {
case EMPTY:
      return !foundItems;
case CONTAINS:
    return foundItems;
case SPACE:
  return foundSpace;
default :
return !foundSpace;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean isTriggerActive(TileEntity tile,EnumFacing side,IStatementContainer container,IStatementParameter[] parameters){
  ItemStack searchedStack=StackUtil.EMPTY;
  if (parameters != null && parameters.length >= 1 && parameters[0] != null) {
    searchedStack=parameters[0].getItemStack();
  }
  IItemHandler handler=tile.getCapability(CapUtil.CAP_ITEMS,side.getOpposite());
  if (handler != null) {
    boolean hasSlots=false;
    boolean foundItems=false;
    boolean foundSpace=false;
    for (int i=0; i < handler.getSlots(); i++) {
      hasSlots=true;
      ItemStack stack=handler.getStackInSlot(i);
      foundItems|=!stack.isEmpty() && (searchedStack.isEmpty() || StackUtil.canStacksOrListsMerge(stack,searchedStack));
      foundSpace|=(stack.isEmpty() || (StackUtil.canStacksOrListsMerge(stack,searchedStack) && stack.getCount() < stack.getMaxStackSize())) && (searchedStack.isEmpty() || searchedStack.getItem() instanceof IList || handler.insertItem(i,searchedStack,true).isEmpty());
    }
    if (!hasSlots) {
      return false;
    }
switch (state) {
case EMPTY:
      return !foundItems;
case CONTAINS:
    return foundItems;
case SPACE:
  return foundSpace;
default :
return !foundSpace;
}
}
return false;
}
Program: 156306
Project: 156306
Buggy source:
private static JsonContents loadContents(IResourceManager resourceManager,String domain){
  ResourceLocation location=new ResourceLocation(domain,"String_Node_Str");
  try (InputStream is=resourceManager.getResource(location).getInputStream()){
    if (is != null) {
      InputStreamReader isr=new InputStreamReader(is);
      return new Gson().fromJson(isr,JsonContents.class);
    }
    return null;
  }
 catch (  FileNotFoundException fnfe) {
    if (DEBUG) {
      BCLog.logger.warn("String_Node_Str" + location + "String_Node_Str");
    }
    return null;
  }
catch (  IOException io) {
    if (DEBUG) {
      BCLog.logger.warn("String_Node_Str" + domain + "String_Node_Str",io);
    }
 else {
      BCLog.logger.warn("String_Node_Str" + domain + "String_Node_Str"+ io.getMessage());
    }
    return null;
  }
}

Fixed version (ground truth):
private static JsonContents loadContents(IResourceManager resourceManager,String domain){
  ResourceLocation location=new ResourceLocation(domain,"String_Node_Str");
  try (InputStream is=resourceManager.getResource(location).getInputStream()){
    if (is != null) {
      InputStreamReader isr=new InputStreamReader(is,StandardCharsets.UTF_8);
      return new Gson().fromJson(isr,JsonContents.class);
    }
    return null;
  }
 catch (  FileNotFoundException fnfe) {
    if (DEBUG) {
      BCLog.logger.warn("String_Node_Str" + location + "String_Node_Str");
    }
    return null;
  }
catch (  IOException io) {
    if (DEBUG) {
      BCLog.logger.warn("String_Node_Str" + domain + "String_Node_Str",io);
    }
 else {
      BCLog.logger.warn("String_Node_Str" + domain + "String_Node_Str"+ io.getMessage());
    }
    return null;
  }
}
Program: 156307
Project: 156307
Buggy source:
public InputStreamReader startLoading(ResourceLocation location) throws JsonSyntaxException {
  if (!loaded.add(location)) {
    throw new JsonSyntaxException("String_Node_Str" + location + "String_Node_Str"+ loadingStack.peek());
  }
  loadingStack.push(location);
  try {
    IResource res=Minecraft.getMinecraft().getResourceManager().getResource(location);
    return new InputStreamReader(res.getInputStream());
  }
 catch (  FileNotFoundException e) {
    throw new JsonSyntaxException("String_Node_Str" + location,e);
  }
catch (  IOException io) {
    throw new JsonSyntaxException(io);
  }
}

Fixed version (ground truth):
public InputStreamReader startLoading(ResourceLocation location) throws JsonSyntaxException {
  if (!loaded.add(location)) {
    throw new JsonSyntaxException("String_Node_Str" + location + "String_Node_Str"+ loadingStack.peek());
  }
  loadingStack.push(location);
  try {
    IResource res=Minecraft.getMinecraft().getResourceManager().getResource(location);
    return new InputStreamReader(res.getInputStream(),StandardCharsets.UTF_8);
  }
 catch (  FileNotFoundException e) {
    throw new JsonSyntaxException("String_Node_Str" + location,e);
  }
catch (  IOException io) {
    throw new JsonSyntaxException(io);
  }
}
Program: 156308
Project: 156308
Buggy source:
protected final void read(InputStream streamIn){
  if (streamIn != null) {
    try (Reader reader=new InputStreamReader(streamIn)){
      properties.load(reader);
      reader.close();
    }
 catch (    IOException e) {
      BCLog.logger.warn("String_Node_Str" + e.getMessage());
    }
  }
}

Fixed version (ground truth):
protected final void read(InputStream streamIn){
  if (streamIn != null) {
    try (Reader reader=new InputStreamReader(streamIn,StandardCharsets.UTF_8)){
      properties.load(reader);
      reader.close();
    }
 catch (    IOException e) {
      BCLog.logger.warn("String_Node_Str" + e.getMessage());
    }
  }
}
Program: 156309
Project: 156309
Buggy source:
protected final void write(OutputStream streamOut){
  if (streamOut == null)   return;
  try (Writer writer=new OutputStreamWriter(streamOut)){
    properties.store(writer,comment());
    writer.close();
  }
 catch (  IOException e) {
    BCLog.logger.warn("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
protected final void write(OutputStream streamOut){
  if (streamOut == null)   return;
  try (Writer writer=new OutputStreamWriter(streamOut,StandardCharsets.UTF_8)){
    properties.store(writer,comment());
    writer.close();
  }
 catch (  IOException e) {
    BCLog.logger.warn("String_Node_Str" + e.getMessage());
  }
}
Program: 156310
Project: 156310
Buggy source:
private void internalTick(double value){
  pos=++pos % precise;
  double oldValue=data[pos];
  data[pos]=value;
  if (pos == 0) {
    averageRaw=0;
    for (    double iValue : data) {
      averageRaw+=iValue;
    }
  }
 else {
    averageRaw=averageRaw - oldValue + value;
  }
}

Fixed version (ground truth):
private void internalTick(double value){
  pos=(pos + 1) % precise;
  double oldValue=data[pos];
  data[pos]=value;
  if (pos == 0) {
    averageRaw=0;
    for (    double iValue : data) {
      averageRaw+=iValue;
    }
  }
 else {
    averageRaw=averageRaw - oldValue + value;
  }
}
Program: 156311
Project: 156311
Buggy source:
public static boolean isValid(BlockPos offset){
  if (offset.getX() < 0 | offset.getX() >= 16)   return false;
  if (offset.getY() < 0 | offset.getY() >= 16)   return false;
  if (offset.getZ() < 0 | offset.getZ() >= 16)   return false;
  return true;
}

Fixed version (ground truth):
public static boolean isValid(BlockPos offset){
  if (offset.getX() < 0 || offset.getX() >= 16)   return false;
  if (offset.getY() < 0 || offset.getY() >= 16)   return false;
  if (offset.getZ() < 0 || offset.getZ() >= 16)   return false;
  return true;
}
Program: 156313
Project: 156313
Buggy source:
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str");
  left.add("String_Node_Str" + battery.getDebugString());
  left.add("String_Node_Str");
  left.add("String_Node_Str" + frameBox.min());
  left.add("String_Node_Str" + frameBox.max());
  left.add("String_Node_Str");
  left.add("String_Node_Str" + miningBox.min());
  left.add("String_Node_Str" + miningBox.max());
  left.add("String_Node_Str" + (boxIterator == null ? "String_Node_Str" : boxIterator.getCurrent()));
  if (currentTask != null) {
    left.add("String_Node_Str");
    left.add("String_Node_Str" + currentTask.getClass().getName());
    left.add("String_Node_Str" + LocaleUtil.localizeMj(currentTask.getPower()));
    left.add("String_Node_Str" + LocaleUtil.localizeMj(currentTask.getTarget()));
  }
 else {
    left.add("String_Node_Str");
  }
  left.add("String_Node_Str" + drillPos);
}

Fixed version (ground truth):
@Override public void getDebugInfo(List<String> left,List<String> right,EnumFacing side){
  left.add("String_Node_Str");
  left.add("String_Node_Str" + battery.getDebugString());
  left.add("String_Node_Str" + LocaleUtil.localizeMjFlow(debugPowerRate));
  left.add("String_Node_Str");
  left.add("String_Node_Str" + frameBox.min());
  left.add("String_Node_Str" + frameBox.max());
  left.add("String_Node_Str");
  left.add("String_Node_Str" + miningBox.min());
  left.add("String_Node_Str" + miningBox.max());
  BoxIterator iter=boxIterator;
  left.add("String_Node_Str" + (iter == null ? "String_Node_Str" : iter.getCurrent()));
  Task task=currentTask;
  if (task != null) {
    left.add("String_Node_Str");
    left.add("String_Node_Str" + task.getClass().getName());
    left.add("String_Node_Str" + LocaleUtil.localizeMj(task.getPower()));
    left.add("String_Node_Str" + LocaleUtil.localizeMj(task.getTarget()));
  }
 else {
    left.add("String_Node_Str");
  }
  left.add("String_Node_Str" + drillPos);
}
Program: 156314
Project: 156314
Buggy source:
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,EntityPlayer player,List<String> tooltip,boolean advanced){
  String tipName="String_Node_Str" + unlocalizedName.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  String localised=I18n.format(tipName);
  if (!localised.equals(tipName)) {
    tooltip.add(TextFormatting.GRAY + localised);
  }
  if (definition.flowType == PipeApi.flowFluids) {
    PipeApi.FluidTransferInfo fti=PipeApi.getFluidTransferInfo(definition);
    tooltip.add(LocaleUtil.localizeFluidFlow(fti.transferPerTick));
  }
 else   if (definition.flowType == PipeApi.flowPower) {
    PipeApi.PowerTransferInfo pti=PipeApi.getPowerTransferInfo(definition);
    tooltip.add(LocaleUtil.localizeMjFlow(pti.transferPerTick));
  }
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,EntityPlayer player,List<String> tooltip,boolean advanced){
  String tipName="String_Node_Str" + unlocalizedName.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  String localised=I18n.format(tipName);
  if (!localised.equals(tipName)) {
    tooltip.add(TextFormatting.GRAY + localised);
  }
  if (definition.flowType == PipeApi.flowFluids) {
    PipeApi.FluidTransferInfo fti=PipeApi.getFluidTransferInfo(definition);
    tooltip.add(LocaleUtil.localizeFluidFlow(fti.transferPerTick));
  }
 else   if (definition.flowType == PipeApi.flowPower) {
    PipeApi.PowerTransferInfo pti=PipeApi.getPowerTransferInfo(definition);
    tooltip.add(LocaleUtil.localizeMjFlow(pti.transferPerTick));
    tooltip.add("String_Node_Str");
  }
}
Program: 156315
Project: 156315
Buggy source:
@Override public void update(){
  if (!queueBuilt && !world.isRemote) {
    buildQueue();
    queueBuilt=true;
  }
  super.update();
  tank.drain(tank.getCapacity(),true);
  FluidUtilBC.pushFluidAround(world,pos,tank);
}

Fixed version (ground truth):
@Override public void update(){
  if (!queueBuilt && !world.isRemote) {
    buildQueue();
    queueBuilt=true;
  }
  super.update();
  FluidUtilBC.pushFluidAround(world,pos,tank);
}
Program: 156316
Project: 156316
Buggy source:
@PipeEventHandler public static void addActions(PipeEventStatement.AddActionInternal event){
  Collections.addAll(event.actions,BCTransportStatements.ACTION_PIPE_COLOUR);
}

Fixed version (ground truth):
@Override public void addActions(PipeEventStatement.AddActionInternal event){
  super.addActions(event);
  Collections.addAll(event.actions,BCTransportStatements.ACTION_PIPE_COLOUR);
}
Program: 156317
Project: 156317
Buggy source:
private static List<Handler> getHandlers(Class<?> cls){
  if (!allHandlers.containsKey(cls)) {
    List<Handler> list=new ArrayList<>();
    for (    Method m : cls.getMethods()) {
      PipeEventHandler annot=m.getAnnotation(PipeEventHandler.class);
      if (annot == null) {
        continue;
      }
      Parameter[] params=m.getParameters();
      if (params.length != 1) {
        throw new IllegalStateException("String_Node_Str" + m + "String_Node_Str"+ Arrays.toString(params)+ "String_Node_Str");
      }
      Parameter p=params[0];
      if (!PipeEvent.class.isAssignableFrom(p.getType())) {
        throw new IllegalStateException("String_Node_Str" + m + "String_Node_Str"+ p.getType()+ "String_Node_Str");
      }
      MethodHandle mh;
      try {
        mh=MethodHandles.publicLookup().unreflect(m);
      }
 catch (      IllegalAccessException e) {
        throw new IllegalStateException("String_Node_Str" + m + "String_Node_Str",e);
      }
      boolean isStatic=Modifier.isStatic(m.getModifiers());
      String methodName=m.toString();
      list.add(new Handler(annot.priority(),annot.receiveCancelled(),isStatic,methodName,mh,p.getType()));
    }
    Class<?> superCls=cls.getSuperclass();
    if (superCls != null) {
      list.addAll(getHandlers(superCls));
    }
    allHandlers.put(cls,list);
    return list;
  }
  return allHandlers.get(cls);
}

Fixed version (ground truth):
private static List<Handler> getHandlers(Class<?> cls){
  if (!allHandlers.containsKey(cls)) {
    List<Handler> list=new ArrayList<>();
    Class<?> superCls=cls.getSuperclass();
    if (superCls != null) {
      list.addAll(getHandlers(superCls));
    }
    for (    Method m : cls.getMethods()) {
      PipeEventHandler annot=m.getAnnotation(PipeEventHandler.class);
      if (annot == null) {
        continue;
      }
      Parameter[] params=m.getParameters();
      if (params.length != 1) {
        throw new IllegalStateException("String_Node_Str" + m + "String_Node_Str"+ Arrays.toString(params)+ "String_Node_Str");
      }
      Parameter p=params[0];
      if (!PipeEvent.class.isAssignableFrom(p.getType())) {
        throw new IllegalStateException("String_Node_Str" + m + "String_Node_Str"+ p.getType()+ "String_Node_Str");
      }
      MethodHandle mh;
      try {
        mh=MethodHandles.publicLookup().unreflect(m);
      }
 catch (      IllegalAccessException e) {
        throw new IllegalStateException("String_Node_Str" + m + "String_Node_Str",e);
      }
      boolean isStatic=Modifier.isStatic(m.getModifiers());
      String methodName=m.toString();
      list.add(new Handler(annot.priority(),annot.receiveCancelled(),isStatic,methodName,mh,p.getType()));
    }
    allHandlers.put(cls,list);
    return list;
  }
  return allHandlers.get(cls);
}
Program: 156318
Project: 156318
Buggy source:
@PipeEventHandler public static void addActions(PipeEventStatement.AddActionInternal event){
  Collections.addAll(event.actions,BCTransportStatements.ACTION_EXTRACTION_PRESET);
}

Fixed version (ground truth):
@Override public void addActions(PipeEventStatement.AddActionInternal event){
  super.addActions(event);
  Collections.addAll(event.actions,BCTransportStatements.ACTION_EXTRACTION_PRESET);
}
Program: 156319
Project: 156319
Buggy source:
@PipeEventHandler public void onActionActivate(PipeEventActionActivate event){
  if (event.action instanceof ActionExtractionPreset) {
    ActionExtractionPreset preset=(ActionExtractionPreset)event.action;
    activeSlots.add(preset.index);
    activatedTtl[preset.index.ordinal()]=2;
  }
}

Fixed version (ground truth):
@Override public void onActionActivate(PipeEventActionActivate event){
  super.onActionActivate(event);
  if (event.action instanceof ActionExtractionPreset) {
    ActionExtractionPreset preset=(ActionExtractionPreset)event.action;
    activeSlots.add(preset.index);
    activatedTtl[preset.index.ordinal()]=2;
  }
}
Program: 156320
Project: 156320
Buggy source:
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer player,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  if (world.isRemote) {
    return true;
  }
  if (player.getHeldItem(hand).isEmpty()) {
    return super.onBlockActivated(world,pos,state,player,hand,side,hitX,hitY,hitZ);
  }
  TileEntity tile=world.getTileEntity(pos);
  if (tile instanceof TileTank) {
    TileTank tank=(TileTank)tile;
    if (FluidUtil.interactWithFluidHandler(player,hand,world,pos,side)) {
      tank.sendNetworkUpdate(TileBC_Neptune.NET_RENDER_DATA);
      player.inventoryContainer.detectAndSendChanges();
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer player,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  TileEntity tile=world.getTileEntity(pos);
  if (tile instanceof TileTank) {
    TileTank tank=(TileTank)tile;
    return tank.onActivate(player,hand);
  }
  return false;
}
Program: 156322
Project: 156322
Buggy source:
private void findEnd(){
  tileEnd=null;
  IBlockState state=getCurrentStateForBlock(BCFactoryBlocks.heatExchangeStart);
  if (state == null) {
    return;
  }
  BlockHeatExchange block=(BlockHeatExchange)state.getBlock();
  EnumFacing facing=state.getValue(BlockBCBase_Neptune.PROP_FACING);
  int middles=0;
  BlockPos search=getPos();
  for (int i=0; i < 3; i++) {
    search=search.offset(facing);
    state=getLocalState(search);
    if (state.getBlock() != BCFactoryBlocks.heatExchangeMiddle) {
      break;
    }
    block=BCFactoryBlocks.heatExchangeMiddle;
    if (block.part.getAxis(state) != facing.getAxis()) {
      return;
    }
    middles++;
  }
  if (middles == 0) {
    return;
  }
  if (state.getBlock() != BCFactoryBlocks.heatExchangeEnd) {
    return;
  }
  if (state.getValue(BlockBCBase_Neptune.PROP_FACING) != facing.getOpposite()) {
    return;
  }
  TileEntity tile=getLocalTile(search);
  if (tile instanceof TileHeatExchangeEnd) {
    tileEnd=(TileHeatExchangeEnd)tile;
  }
 else {
  }
}

Fixed version (ground truth):
private void findEnd(){
  tileEnd=null;
  IBlockState state=getCurrentStateForBlock(BCFactoryBlocks.heatExchangeStart);
  if (state == null) {
    return;
  }
  BlockHeatExchange block=(BlockHeatExchange)state.getBlock();
  EnumFacing facing=state.getValue(BlockBCBase_Neptune.PROP_FACING);
  int middles=0;
  BlockPos search=getPos();
  for (int i=0; i <= 3; i++) {
    search=search.offset(facing);
    state=getLocalState(search);
    if (state.getBlock() != BCFactoryBlocks.heatExchangeMiddle) {
      break;
    }
    block=BCFactoryBlocks.heatExchangeMiddle;
    if (block.part.getAxis(state) != facing.getAxis()) {
      return;
    }
    middles++;
  }
  if (middles == 0) {
    return;
  }
  if (state.getBlock() != BCFactoryBlocks.heatExchangeEnd) {
    return;
  }
  if (state.getValue(BlockBCBase_Neptune.PROP_FACING) != facing.getOpposite()) {
    return;
  }
  TileEntity tile=getLocalTile(search);
  if (tile instanceof TileHeatExchangeEnd) {
    tileEnd=(TileHeatExchangeEnd)tile;
  }
 else {
  }
}
Program: 156323
Project: 156323
Buggy source:
private Tank getTank(BlockPos at){
  TileEntity tile=world.getTileEntity(at);
  if (tile instanceof TileTank) {
    TileTank tileTank=(TileTank)tile;
    return tileTank.tank;
  }
  return null;
}

Fixed version (ground truth):
private TileTank getTank(BlockPos at){
  TileEntity tile=world.getTileEntity(at);
  if (tile instanceof TileTank) {
    return (TileTank)tile;
  }
  return null;
}