nus-yam/ex-repair huggingface dataset:
Program: 165610
Project: 165610
Buggy source:
@Override public void initGui(){
  super.initGui();
  int k=(this.width - this.xSize) / 2;
  int l=(this.height - this.ySize) / 2;
  list=new WidgetList(mc,this).setName("String_Node_Str").addSelectionEvent(new DefaultSelectionEvent(){
    @Override public void doubleClick(    Widget parent,    int index){
      teleport(index);
    }
  }
);
  Slider listSlider=new Slider(mc,this).setDesiredWidth(11).setVertical().setScrollableName("String_Node_Str");
  Panel toplevel=new Panel(mc,this).setFilledRectThickness(2).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3)).addChild(list).addChild(listSlider);
  toplevel.setBounds(new Rectangle(k,l,xSize,ySize));
  window=new Window(this,toplevel);
  serverDestinationList=null;
  destinationList=null;
  requestReceiversFromServer();
}

Fixed version (ground truth):
@Override public void initGui(){
  super.initGui();
  int k=(this.width - this.xSize) / 2;
  int l=(this.height - this.ySize) / 2;
  list=new WidgetList(mc,this).setName("String_Node_Str").addSelectionEvent(new DefaultSelectionEvent(){
    @Override public void doubleClick(    Widget<?> parent,    int index){
      teleport(index);
    }
  }
);
  Slider listSlider=new Slider(mc,this).setDesiredWidth(11).setVertical().setScrollableName("String_Node_Str");
  Panel toplevel=new Panel(mc,this).setFilledRectThickness(2).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3)).addChild(list).addChild(listSlider);
  toplevel.setBounds(new Rectangle(k,l,xSize,ySize));
  window=new Window(this,toplevel);
  serverDestinationList=null;
  destinationList=null;
  requestReceiversFromServer();
}
Program: 165613
Project: 165613
Buggy source:
private void checkStateServer(){
  if (clickedModules.isEmpty()) {
    return;
  }
  List<ActivatedModule> newClickedModules=new ArrayList<>();
  for (  ActivatedModule cm : clickedModules) {
    cm.ticks--;
    if (cm.ticks > 0) {
      newClickedModules.add(cm);
    }
 else {
      List<IScreenModule> modules=getScreenModules();
      if (cm.module < modules.size()) {
        ItemStack itemStack=inventoryHelper.getStackInSlot(cm.module);
        IScreenModule module=modules.get(cm.module);
        module.mouseClick(getWorld(),cm.x,cm.y,false,null);
        if (module instanceof IScreenModuleUpdater) {
          NBTTagCompound newCompound=((IScreenModuleUpdater)module).update(itemStack.getTagCompound(),getWorld(),null);
          if (newCompound != null) {
            itemStack.setTagCompound(newCompound);
            markDirtyClient();
          }
        }
      }
    }
  }
  clickedModules=newClickedModules;
}

Fixed version (ground truth):
private void checkStateServer(){
  if (clickedModules.isEmpty()) {
    return;
  }
  List<ActivatedModule> newClickedModules=new ArrayList<>();
  for (  ActivatedModule cm : clickedModules) {
    cm.ticks--;
    if (cm.ticks > 0) {
      newClickedModules.add(cm);
    }
 else {
      List<IScreenModule> modules=getScreenModules();
      if (cm.module < modules.size()) {
        ItemStack itemStack=inventoryHelper.getStackInSlot(cm.module);
        IScreenModule<?> module=modules.get(cm.module);
        module.mouseClick(getWorld(),cm.x,cm.y,false,null);
        if (module instanceof IScreenModuleUpdater) {
          NBTTagCompound newCompound=((IScreenModuleUpdater)module).update(itemStack.getTagCompound(),getWorld(),null);
          if (newCompound != null) {
            itemStack.setTagCompound(newCompound);
            markDirtyClient();
          }
        }
      }
    }
  }
  clickedModules=newClickedModules;
}
Program: 165616
Project: 165616
Buggy source:
private void checkStateClient(){
  if (clickedModules.isEmpty()) {
    return;
  }
  List<ActivatedModule> newClickedModules=new ArrayList<>();
  for (  ActivatedModule cm : clickedModules) {
    cm.ticks--;
    if (cm.ticks > 0) {
      newClickedModules.add(cm);
    }
 else {
      List<IClientScreenModule> modules=getClientScreenModules();
      if (cm.module < modules.size()) {
        modules.get(cm.module).mouseClick(getWorld(),cm.x,cm.y,false);
      }
    }
  }
  clickedModules=newClickedModules;
}

Fixed version (ground truth):
private void checkStateClient(){
  if (clickedModules.isEmpty()) {
    return;
  }
  List<ActivatedModule> newClickedModules=new ArrayList<>();
  for (  ActivatedModule cm : clickedModules) {
    cm.ticks--;
    if (cm.ticks > 0) {
      newClickedModules.add(cm);
    }
 else {
      List<IClientScreenModule<?>> modules=getClientScreenModules();
      if (cm.module < modules.size()) {
        modules.get(cm.module).mouseClick(getWorld(),cm.x,cm.y,false);
      }
    }
  }
  clickedModules=newClickedModules;
}
Program: 165617
Project: 165617
Buggy source:
@Override public TypedMap executeWithResult(String command,TypedMap args){
  TypedMap rc=super.executeWithResult(command,args);
  if (rc != null) {
    return rc;
  }
  if (CMD_SCREEN_INFO.equals(command)) {
    IScreenModule module=getHoveringModule();
    List<String> info=Collections.emptyList();
    if (module instanceof ITooltipInfo) {
      info=((ITooltipInfo)module).getInfo(world,getHoveringX(),getHoveringY());
    }
    return TypedMap.builder().put(PARAM_INFO,info).build();
  }
  return null;
}

Fixed version (ground truth):
@Override public TypedMap executeWithResult(String command,TypedMap args){
  TypedMap rc=super.executeWithResult(command,args);
  if (rc != null) {
    return rc;
  }
  if (CMD_SCREEN_INFO.equals(command)) {
    IScreenModule<?> module=getHoveringModule();
    List<String> info=Collections.emptyList();
    if (module instanceof ITooltipInfo) {
      info=((ITooltipInfo)module).getInfo(world,getHoveringX(),getHoveringY());
    }
    return TypedMap.builder().put(PARAM_INFO,info).build();
  }
  return null;
}
Program: 165618
Project: 165618
Buggy source:
public IScreenModule getHoveringModule(){
  if (hoveringModule == -1) {
    return null;
  }
  getScreenModules();
  if (hoveringModule >= 0 && hoveringModule < screenModules.size()) {
    return screenModules.get(hoveringModule);
  }
  return null;
}

Fixed version (ground truth):
public IScreenModule<?> getHoveringModule(){
  if (hoveringModule == -1) {
    return null;
  }
  getScreenModules();
  if (hoveringModule >= 0 && hoveringModule < screenModules.size()) {
    return screenModules.get(hoveringModule);
  }
  return null;
}
Program: 165619
Project: 165619
Buggy source:
private void hitScreenServer(EntityPlayer player,int x,int y,int module){
  List<IScreenModule> screenModules=getScreenModules();
  IScreenModule screenModule=screenModules.get(module);
  if (screenModule != null) {
    ItemStack itemStack=inventoryHelper.getStackInSlot(module);
    screenModule.mouseClick(getWorld(),x,y,true,player);
    if (screenModule instanceof IScreenModuleUpdater) {
      NBTTagCompound newCompound=((IScreenModuleUpdater)screenModule).update(itemStack.getTagCompound(),getWorld(),player);
      if (newCompound != null) {
        itemStack.setTagCompound(newCompound);
        markDirtyClient();
      }
    }
    clickedModules.add(new ActivatedModule(module,5,x,y));
  }
}

Fixed version (ground truth):
private void hitScreenServer(EntityPlayer player,int x,int y,int module){
  List<IScreenModule> screenModules=getScreenModules();
  IScreenModule<?> screenModule=screenModules.get(module);
  if (screenModule != null) {
    ItemStack itemStack=inventoryHelper.getStackInSlot(module);
    screenModule.mouseClick(getWorld(),x,y,true,player);
    if (screenModule instanceof IScreenModuleUpdater) {
      NBTTagCompound newCompound=((IScreenModuleUpdater)screenModule).update(itemStack.getTagCompound(),getWorld(),player);
      if (newCompound != null) {
        itemStack.setTagCompound(newCompound);
        markDirtyClient();
      }
    }
    clickedModules.add(new ActivatedModule(module,5,x,y));
  }
}
Program: 165620
Project: 165620
Buggy source:
public static List<IClientScreenModule> getHelpingScreenModules(){
  if (helpingScreenModules == null) {
    helpingScreenModules=new ArrayList<>();
    addLine("String_Node_Str",0x7799ff,true);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
  }
  return helpingScreenModules;
}

Fixed version (ground truth):
public static List<IClientScreenModule<?>> getHelpingScreenModules(){
  if (helpingScreenModules == null) {
    helpingScreenModules=new ArrayList<>();
    addLine("String_Node_Str",0x7799ff,true);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
    addLine("String_Node_Str",0xffffff,false);
  }
  return helpingScreenModules;
}
Program: 165621
Project: 165621
Buggy source:
public Map<Integer,IModuleData> getScreenData(long millis){
  Map<Integer,IModuleData> map=new HashMap<>();
  List<IScreenModule> screenModules=getScreenModules();
  int moduleIndex=0;
  for (  IScreenModule module : screenModules) {
    if (module != null) {
      IModuleData data=module.getData(screenDataHelper,getWorld(),millis);
      if (data != null) {
        map.put(moduleIndex,data);
      }
    }
    moduleIndex++;
  }
  return map;
}

Fixed version (ground truth):
public Map<Integer,IModuleData> getScreenData(long millis){
  Map<Integer,IModuleData> map=new HashMap<>();
  List<IScreenModule> screenModules=getScreenModules();
  int moduleIndex=0;
  for (  IScreenModule<?> module : screenModules) {
    if (module != null) {
      IModuleData data=module.getData(screenDataHelper,getWorld(),millis);
      if (data != null) {
        map.put(moduleIndex,data);
      }
    }
    moduleIndex++;
  }
  return map;
}
Program: 165622
Project: 165622
Buggy source:
public void hitScreenClient(double hitX,double hitY,double hitZ,EnumFacing side,EnumFacing horizontalFacing){
  ModuleRaytraceResult result=getHitModule(hitX,hitY,hitZ,side,horizontalFacing);
  if (result == null) {
    return;
  }
  List<IClientScreenModule> modules=getClientScreenModules();
  int module=result.getModuleIndex();
  if (isActivated(module)) {
    return;
  }
  modules.get(module).mouseClick(getWorld(),result.getX(),result.getY() - result.getCurrenty(),true);
  clickedModules.add(new ActivatedModule(module,3,result.getX(),result.getY()));
  RFToolsMessages.INSTANCE.sendToServer(new PacketServerCommandTyped(getPos(),CMD_CLICK,TypedMap.builder().put(PARAM_X,result.getX()).put(PARAM_Y,result.getY() - result.getCurrenty()).put(PARAM_MODULE,module).build()));
}

Fixed version (ground truth):
public void hitScreenClient(double hitX,double hitY,double hitZ,EnumFacing side,EnumFacing horizontalFacing){
  ModuleRaytraceResult result=getHitModule(hitX,hitY,hitZ,side,horizontalFacing);
  if (result == null) {
    return;
  }
  List<IClientScreenModule<?>> modules=getClientScreenModules();
  int module=result.getModuleIndex();
  if (isActivated(module)) {
    return;
  }
  modules.get(module).mouseClick(getWorld(),result.getX(),result.getY() - result.getCurrenty(),true);
  clickedModules.add(new ActivatedModule(module,3,result.getX(),result.getY()));
  RFToolsMessages.INSTANCE.sendToServer(new PacketServerCommandTyped(getPos(),CMD_CLICK,TypedMap.builder().put(PARAM_X,result.getX()).put(PARAM_Y,result.getY() - result.getCurrenty()).put(PARAM_MODULE,module).build()));
}
Program: 165623
Project: 165623
Buggy source:
public List<IClientScreenModule> getClientScreenModules(){
  if (clientScreenModules == null) {
    needsServerData=false;
    showHelp=true;
    clientScreenModules=new ArrayList<>();
    for (int i=0; i < inventoryHelper.getCount(); i++) {
      ItemStack itemStack=inventoryHelper.getStackInSlot(i);
      if (!itemStack.isEmpty() && ScreenBlock.hasModuleProvider(itemStack)) {
        IModuleProvider moduleProvider=ScreenBlock.getModuleProvider(itemStack);
        IClientScreenModule clientScreenModule;
        try {
          clientScreenModule=moduleProvider.getClientScreenModule().newInstance();
        }
 catch (        InstantiationException e) {
          Logging.logError("String_Node_Str",e);
          continue;
        }
catch (        IllegalAccessException e) {
          Logging.logError("String_Node_Str",e);
          continue;
        }
        clientScreenModule.setupFromNBT(itemStack.getTagCompound(),getWorld().provider.getDimension(),getPos());
        clientScreenModules.add(clientScreenModule);
        if (clientScreenModule.needsServerData()) {
          needsServerData=true;
        }
        showHelp=false;
      }
 else {
        clientScreenModules.add(null);
      }
    }
  }
  return clientScreenModules;
}

Fixed version (ground truth):
public List<IClientScreenModule<?>> getClientScreenModules(){
  if (clientScreenModules == null) {
    needsServerData=false;
    showHelp=true;
    clientScreenModules=new ArrayList<>();
    for (int i=0; i < inventoryHelper.getCount(); i++) {
      ItemStack itemStack=inventoryHelper.getStackInSlot(i);
      if (!itemStack.isEmpty() && ScreenBlock.hasModuleProvider(itemStack)) {
        IModuleProvider moduleProvider=ScreenBlock.getModuleProvider(itemStack);
        IClientScreenModule<?> clientScreenModule;
        try {
          clientScreenModule=moduleProvider.getClientScreenModule().newInstance();
        }
 catch (        InstantiationException e) {
          Logging.logError("String_Node_Str",e);
          continue;
        }
catch (        IllegalAccessException e) {
          Logging.logError("String_Node_Str",e);
          continue;
        }
        clientScreenModule.setupFromNBT(itemStack.getTagCompound(),getWorld().provider.getDimension(),getPos());
        clientScreenModules.add(clientScreenModule);
        if (clientScreenModule.needsServerData()) {
          needsServerData=true;
        }
        showHelp=false;
      }
 else {
        clientScreenModules.add(null);
      }
    }
  }
  return clientScreenModules;
}
Program: 165624
Project: 165624
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  drawWindow();
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  drawWindow();
}
Program: 165625
Project: 165625
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  drawGhostSlots();
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  drawGhostSlots();
}
Program: 165627
Project: 165627
Buggy source:
private void handleSendingEnergy(){
  int energyStored=getEnergyStored();
  if (energyStored <= EndergenicConfiguration.keepRfInBuffer) {
    return;
  }
  energyStored-=EndergenicConfiguration.keepRfInBuffer;
  for (  EnumFacing dir : EnumFacing.VALUES) {
    BlockPos o=getPos().offset(dir);
    TileEntity te=getWorld().getTileEntity(o);
    EnumFacing opposite=dir.getOpposite();
    if (EnergyTools.isEnergyTE(te) || (te != null && te.hasCapability(CapabilityEnergy.ENERGY,opposite))) {
      int rfToGive;
      if (EndergenicConfiguration.rfOutput <= energyStored) {
        rfToGive=EndergenicConfiguration.rfOutput;
      }
 else {
        rfToGive=energyStored;
      }
      int received;
      if (RFTools.redstoneflux && RedstoneFluxCompatibility.isEnergyConnection(te)) {
        if (RedstoneFluxCompatibility.canConnectEnergy(te,opposite)) {
          received=EnergyTools.receiveEnergy(te,opposite,rfToGive);
        }
 else {
          received=0;
        }
      }
 else {
        received=EnergyTools.receiveEnergy(te,opposite,rfToGive);
      }
      energyStored-=storage.extractEnergy(received,false);
      if (energyStored <= 0) {
        break;
      }
    }
  }
}

Fixed version (ground truth):
private void handleSendingEnergy(){
  int energyStored=getEnergyStored();
  if (energyStored <= EndergenicConfiguration.keepRfInBuffer) {
    return;
  }
  energyStored-=EndergenicConfiguration.keepRfInBuffer;
  for (  EnumFacing dir : EnumFacing.VALUES) {
    BlockPos o=getPos().offset(dir);
    TileEntity te=getWorld().getTileEntity(o);
    EnumFacing opposite=dir.getOpposite();
    if (EnergyTools.isEnergyTE(te) || (te != null && te.hasCapability(CapabilityEnergy.ENERGY,opposite))) {
      int rfToGive;
      if (EndergenicConfiguration.rfOutput <= energyStored) {
        rfToGive=EndergenicConfiguration.rfOutput;
      }
 else {
        rfToGive=energyStored;
      }
      int received;
      if (RFTools.redstoneflux && RedstoneFluxCompatibility.isEnergyConnection(te)) {
        if (RedstoneFluxCompatibility.canConnectEnergy(te,opposite)) {
          received=(int)EnergyTools.receiveEnergy(te,opposite,rfToGive);
        }
 else {
          received=0;
        }
      }
 else {
        received=(int)EnergyTools.receiveEnergy(te,opposite,rfToGive);
      }
      energyStored-=storage.extractEnergy(received,false);
      if (energyStored <= 0) {
        break;
      }
    }
  }
}
Program: 165628
Project: 165628
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  checkStats();
  lastRfPerTick.setText(fromServer_lastRfPerTick + "String_Node_Str");
  lastLostPearls.setText(fromServer_lastPearlsLost + "String_Node_Str");
  lastLaunchedPearls.setText(fromServer_lastPearlsLaunched + "String_Node_Str");
  lastOpportunities.setText(fromServer_lastPearlOpportunities + "String_Node_Str");
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  checkStats();
  lastRfPerTick.setText(fromServer_lastRfPerTick + "String_Node_Str");
  lastLostPearls.setText(fromServer_lastPearlsLost + "String_Node_Str");
  lastLaunchedPearls.setText(fromServer_lastPearlsLaunched + "String_Node_Str");
  lastOpportunities.setText(fromServer_lastPearlOpportunities + "String_Node_Str");
}
Program: 165629
Project: 165629
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float partialTicks,int mouseX,int mouseY){
  requestListsIfNeeded();
  populatePlayers();
  enableButtons();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  drawWindow();
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float partialTicks,int mouseX,int mouseY){
  requestListsIfNeeded();
  populatePlayers();
  enableButtons();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  drawWindow();
}
Program: 165630
Project: 165630
Buggy source:
private void handleSendingEnergy(){
  int energyStored=getEnergyStored();
  for (  EnumFacing facing : EnumFacing.VALUES) {
    BlockPos pos=getPos().offset(facing);
    TileEntity te=getWorld().getTileEntity(pos);
    EnumFacing opposite=facing.getOpposite();
    if (EnergyTools.isEnergyTE(te) || (te != null && te.hasCapability(CapabilityEnergy.ENERGY,opposite))) {
      int rfToGive=CoalGeneratorConfiguration.SENDPERTICK <= energyStored ? CoalGeneratorConfiguration.SENDPERTICK : energyStored;
      int received;
      if (RFTools.redstoneflux && RedstoneFluxCompatibility.isEnergyConnection(te)) {
        if (RedstoneFluxCompatibility.canConnectEnergy(te,opposite)) {
          received=EnergyTools.receiveEnergy(te,opposite,rfToGive);
        }
 else {
          received=0;
        }
      }
 else {
        received=EnergyTools.receiveEnergy(te,opposite,rfToGive);
      }
      energyStored-=storage.extractEnergy(received,false);
      if (energyStored <= 0) {
        break;
      }
    }
  }
}

Fixed version (ground truth):
private void handleSendingEnergy(){
  int energyStored=getEnergyStored();
  for (  EnumFacing facing : EnumFacing.VALUES) {
    BlockPos pos=getPos().offset(facing);
    TileEntity te=getWorld().getTileEntity(pos);
    EnumFacing opposite=facing.getOpposite();
    if (EnergyTools.isEnergyTE(te) || (te != null && te.hasCapability(CapabilityEnergy.ENERGY,opposite))) {
      int rfToGive=CoalGeneratorConfiguration.SENDPERTICK <= energyStored ? CoalGeneratorConfiguration.SENDPERTICK : energyStored;
      int received;
      if (RFTools.redstoneflux && RedstoneFluxCompatibility.isEnergyConnection(te)) {
        if (RedstoneFluxCompatibility.canConnectEnergy(te,opposite)) {
          received=(int)EnergyTools.receiveEnergy(te,opposite,rfToGive);
        }
 else {
          received=0;
        }
      }
 else {
        received=(int)EnergyTools.receiveEnergy(te,opposite,rfToGive);
      }
      energyStored-=storage.extractEnergy(received,false);
      if (energyStored <= 0) {
        break;
      }
    }
  }
}
Program: 165631
Project: 165631
Buggy source:
private void sendOutEnergy(){
  int energyStored=getEnergyStored();
  for (  EnumFacing face : EnumFacing.VALUES) {
    if (modes[face.ordinal()] == Mode.MODE_OUTPUT) {
      BlockPos pos=getPos().offset(face);
      TileEntity te=getWorld().getTileEntity(pos);
      EnumFacing opposite=face.getOpposite();
      if (EnergyTools.isEnergyTE(te) || (te != null && te.hasCapability(CapabilityEnergy.ENERGY,opposite))) {
        if ((!(te instanceof PowerCellTileEntity)) || getNetworkId() == -1 || ((PowerCellTileEntity)te).getNetworkId() != getNetworkId()) {
          float factor=getCostFactor();
          int rfPerTick=getRfPerTickPerSide();
          int received;
          int rfToGive=Math.min(rfPerTick,(int)(energyStored / factor));
          if (RFTools.redstoneflux && RedstoneFluxCompatibility.isEnergyConnection(te)) {
            if (RedstoneFluxCompatibility.canConnectEnergy(te,opposite)) {
              received=EnergyTools.receiveEnergy(te,opposite,rfToGive);
            }
 else {
              received=0;
            }
          }
 else {
            received=EnergyTools.receiveEnergy(te,opposite,rfToGive);
          }
          energyStored-=extractEnergyInternal(received,false,Integer.MAX_VALUE);
          if (energyStored <= 0) {
            break;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void sendOutEnergy(){
  int energyStored=getEnergyStored();
  for (  EnumFacing face : EnumFacing.VALUES) {
    if (modes[face.ordinal()] == Mode.MODE_OUTPUT) {
      BlockPos pos=getPos().offset(face);
      TileEntity te=getWorld().getTileEntity(pos);
      EnumFacing opposite=face.getOpposite();
      if (EnergyTools.isEnergyTE(te) || (te != null && te.hasCapability(CapabilityEnergy.ENERGY,opposite))) {
        if ((!(te instanceof PowerCellTileEntity)) || getNetworkId() == -1 || ((PowerCellTileEntity)te).getNetworkId() != getNetworkId()) {
          float factor=getCostFactor();
          int rfPerTick=getRfPerTickPerSide();
          int received;
          int rfToGive=Math.min(rfPerTick,(int)(energyStored / factor));
          if (RFTools.redstoneflux && RedstoneFluxCompatibility.isEnergyConnection(te)) {
            if (RedstoneFluxCompatibility.canConnectEnergy(te,opposite)) {
              received=(int)EnergyTools.receiveEnergy(te,opposite,rfToGive);
            }
 else {
              received=0;
            }
          }
 else {
            received=(int)EnergyTools.receiveEnergy(te,opposite,rfToGive);
          }
          energyStored-=extractEnergyInternal(received,false,Integer.MAX_VALUE);
          if (energyStored <= 0) {
            break;
          }
        }
      }
    }
  }
}
Program: 165633
Project: 165633
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  cnt--;
  if (cnt < 0) {
    cnt=10;
    sendServerCommand(RFTools.MODID,CommandHandler.CMD_REQUEST_LOCATOR_ENERGY,TypedMap.builder().put(CommandHandler.PARAM_POS,tileEntity.getPos()).build());
  }
  energyLabel.setText(energyConsumption + "String_Node_Str");
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  cnt--;
  if (cnt < 0) {
    cnt=10;
    sendServerCommand(RFTools.MODID,CommandHandler.CMD_REQUEST_LOCATOR_ENERGY,TypedMap.builder().put(CommandHandler.PARAM_POS,tileEntity.getPos()).build());
  }
  energyLabel.setText(energyConsumption + "String_Node_Str");
}
Program: 165634
Project: 165634
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  getShapeRenderer().handleMouseWheel();
  for (int i=0; i < 4; i++) {
    ProjectorOperation op=tileEntity.getOperations()[i];
    valOn[i].setEnabled(op.getOpcodeOn().isNeedsValue());
    valOff[i].setEnabled(op.getOpcodeOff().isNeedsValue());
  }
  sound.setEnabled(scanline.isPressed());
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  ItemStack stack=tileEntity.getRenderStack();
  if (!stack.isEmpty()) {
    getShapeRenderer().setShapeID(tileEntity.getShapeID());
    getShapeRenderer().renderShape(this,stack,guiLeft,guiTop,showAxis.isPressed(),showOuter.isPressed(),showScan.isPressed(),false);
  }
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  getShapeRenderer().handleMouseWheel();
  for (int i=0; i < 4; i++) {
    ProjectorOperation op=tileEntity.getOperations()[i];
    valOn[i].setEnabled(op.getOpcodeOn().isNeedsValue());
    valOff[i].setEnabled(op.getOpcodeOff().isNeedsValue());
  }
  sound.setEnabled(scanline.isPressed());
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  ItemStack stack=tileEntity.getRenderStack();
  if (!stack.isEmpty()) {
    getShapeRenderer().setShapeID(tileEntity.getShapeID());
    getShapeRenderer().renderShape(this,stack,guiLeft,guiTop,showAxis.isPressed(),showOuter.isPressed(),showScan.isPressed(),false);
  }
}
Program: 165635
Project: 165635
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  getShapeRenderer().handleMouseWheel();
  offsetLabel.setText("String_Node_Str" + BlockPosTools.toString(tileEntity.getDataOffset()));
  dimensionLabel.setText("String_Node_Str" + BlockPosTools.toString(tileEntity.getDataDim()));
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  boolean instack=inventorySlots.getSlot(ScannerTileEntity.SLOT_IN).getHasStack();
  if (currentRF < ScannerConfiguration.SCANNER_PERTICK) {
    instack=false;
  }
  if (tileEntity.getScanProgress() >= 0) {
    instack=false;
    progressLabel.setText(tileEntity.getScanProgress() + "String_Node_Str");
  }
 else {
    progressLabel.setText("String_Node_Str");
  }
  scanButton.setEnabled(instack);
  ItemStack stack=tileEntity.getRenderStack();
  if (!stack.isEmpty()) {
    int cnt=countFilters();
    if (cnt != filterCnt) {
      filterCnt=cnt;
      move(0,0,0);
    }
    getShapeRenderer().setShapeID(getShapeID());
    getShapeRenderer().renderShape(this,stack,guiLeft,guiTop,showAxis.isPressed(),showOuter.isPressed(),showScan.isPressed(),false);
  }
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int x,int y){
  getShapeRenderer().handleMouseWheel();
  offsetLabel.setText("String_Node_Str" + BlockPosTools.toString(tileEntity.getDataOffset()));
  dimensionLabel.setText("String_Node_Str" + BlockPosTools.toString(tileEntity.getDataDim()));
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
  boolean instack=inventorySlots.getSlot(ScannerTileEntity.SLOT_IN).getHasStack();
  if (currentRF < ScannerConfiguration.SCANNER_PERTICK) {
    instack=false;
  }
  if (tileEntity.getScanProgress() >= 0) {
    instack=false;
    progressLabel.setText(tileEntity.getScanProgress() + "String_Node_Str");
  }
 else {
    progressLabel.setText("String_Node_Str");
  }
  scanButton.setEnabled(instack);
  ItemStack stack=tileEntity.getRenderStack();
  if (!stack.isEmpty()) {
    int cnt=countFilters();
    if (cnt != filterCnt) {
      filterCnt=cnt;
      move(0,0,0);
    }
    getShapeRenderer().setShapeID(getShapeID());
    getShapeRenderer().renderShape(this,stack,guiLeft,guiTop,showAxis.isPressed(),showOuter.isPressed(),showScan.isPressed(),false);
  }
}
Program: 165636
Project: 165636
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populateFilters();
  enableButtons();
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  colorSelector.setCurrentColor(tileEntity.getShieldColor());
  tileEntity.requestRfFromServer(RFTools.MODID);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populateFilters();
  enableButtons();
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  colorSelector.setCurrentColor(tileEntity.getShieldColor());
  tileEntity.requestRfFromServer(RFTools.MODID);
}
Program: 165637
Project: 165637
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}
Program: 165638
Project: 165638
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  showSyringeInfo();
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  showSyringeInfo();
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}
Program: 165640
Project: 165640
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populateReceivers();
  populateTransmitters();
  if (lastDialedTransmitter) {
    showStatus(fromServer_dialResult);
  }
 else   if (lastCheckedReceiver) {
    showStatus(fromServer_receiverStatus);
  }
 else {
    statusLabel.setText("String_Node_Str");
    statusLabel.setColor(0xff000000);
    statusLabel.setFilledBackground(-1);
  }
  enableButtons();
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populateReceivers();
  populateTransmitters();
  if (lastDialedTransmitter) {
    showStatus(fromServer_dialResult);
  }
 else   if (lastCheckedReceiver) {
    showStatus(fromServer_receiverStatus);
  }
 else {
    statusLabel.setText("String_Node_Str");
    statusLabel.setColor(0xff000000);
    statusLabel.setFilledBackground(-1);
  }
  enableButtons();
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}
Program: 165641
Project: 165641
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populatePlayers();
  enableButtons();
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populatePlayers();
  enableButtons();
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}
Program: 165642
Project: 165642
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populatePlayers();
  enableButtons();
  drawWindow();
  int currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float v,int i,int i2){
  requestListsIfNeeded();
  populatePlayers();
  enableButtons();
  drawWindow();
  long currentRF=GenericEnergyStorageTileEntity.getCurrentRF();
  energyBar.setValue(currentRF);
  tileEntity.requestRfFromServer(RFTools.MODID);
}
Program: 165643
Project: 165643
Buggy source:
Class<? extends IClientScreenModule> getClientScreenModule();

Fixed version (ground truth):
Class<? extends IClientScreenModule<?>> getClientScreenModule();
Program: 165644
Project: 165644
Buggy source:
Class<? extends IScreenModule> getServerScreenModule();

Fixed version (ground truth):
Class<? extends IScreenModule<?>> getServerScreenModule();
Program: 165645
Project: 165645
Buggy source:
@Override public IAction[] getActions(){
  return new IAction[]{new DefaultAction<>("String_Node_Str",BuilderTileEntity::restartScan)};
}

Fixed version (ground truth):
@Override public IAction<?>[] getActions(){
  return new IAction<?>[]{new DefaultAction<>("String_Node_Str",BuilderTileEntity::restartScan)};
}
Program: 165646
Project: 165646
Buggy source:
@Override public IAction[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_SETNONE,PowerCellTileEntity::setAllNone),new DefaultAction<>(ACTION_SETINPUT,PowerCellTileEntity::setAllInput),new DefaultAction<>(ACTION_SETOUTPUT,PowerCellTileEntity::setAllOutput),new DefaultAction<>(ACTION_CLEARSTATS,te -> {
    ((PowerCellTileEntity)te).totalExtracted=0;
    ((PowerCellTileEntity)te).totalInserted=0;
    te.markDirty();
  }
)};
}

Fixed version (ground truth):
@Override public IAction<?>[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_SETNONE,PowerCellTileEntity::setAllNone),new DefaultAction<>(ACTION_SETINPUT,PowerCellTileEntity::setAllInput),new DefaultAction<>(ACTION_SETOUTPUT,PowerCellTileEntity::setAllOutput),new DefaultAction<>(ACTION_CLEARSTATS,te -> {
    ((PowerCellTileEntity)te).totalExtracted=0;
    ((PowerCellTileEntity)te).totalInserted=0;
    te.markDirty();
  }
)};
}
Program: 165647
Project: 165647
Buggy source:
private void installModuleGui(int i,final ItemStack slot,IModuleProvider moduleProvider,Class<? extends IClientScreenModule> clientScreenModuleClass){
  buttons[i].setEnabled(true);
  toplevel.removeChild(modulePanels[i]);
  try {
    IClientScreenModule<?> clientScreenModule=clientScreenModuleClass.newInstance();
    clientScreenModules[i]=clientScreenModule;
  }
 catch (  InstantiationException e) {
    throw new RuntimeException(e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
  NBTTagCompound tagCompound=slot.getTagCompound();
  if (tagCompound == null) {
    tagCompound=new NBTTagCompound();
  }
  final NBTTagCompound finalTagCompound=tagCompound;
  final int finalI=i;
  ScreenModuleGuiBuilder guiBuilder=new ScreenModuleGuiBuilder(mc,this,tagCompound,() -> {
    slot.setTagCompound(finalTagCompound);
    tileEntity.setInventorySlotContents(finalI,slot);
    RFToolsMessages.INSTANCE.sendToServer(new PacketModuleUpdate(tileEntity.getPos(),finalI,finalTagCompound));
  }
);
  clientScreenModules[i].createGui(guiBuilder);
  modulePanels[i]=guiBuilder.build();
  modulePanels[i].setLayoutHint(80,8,170,114);
  modulePanels[i].setFilledRectThickness(-2).setFilledBackground(0xff8b8b8b);
  toplevel.addChild(modulePanels[i]);
  buttons[i].setText(moduleProvider.getName());
}

Fixed version (ground truth):
private void installModuleGui(int i,final ItemStack slot,IModuleProvider moduleProvider,Class<? extends IClientScreenModule<?>> clientScreenModuleClass){
  buttons[i].setEnabled(true);
  toplevel.removeChild(modulePanels[i]);
  try {
    IClientScreenModule<?> clientScreenModule=clientScreenModuleClass.newInstance();
    clientScreenModules[i]=clientScreenModule;
  }
 catch (  InstantiationException e) {
    throw new RuntimeException(e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
  NBTTagCompound tagCompound=slot.getTagCompound();
  if (tagCompound == null) {
    tagCompound=new NBTTagCompound();
  }
  final NBTTagCompound finalTagCompound=tagCompound;
  final int finalI=i;
  ScreenModuleGuiBuilder guiBuilder=new ScreenModuleGuiBuilder(mc,this,tagCompound,() -> {
    slot.setTagCompound(finalTagCompound);
    tileEntity.setInventorySlotContents(finalI,slot);
    RFToolsMessages.INSTANCE.sendToServer(new PacketModuleUpdate(tileEntity.getPos(),finalI,finalTagCompound));
  }
);
  clientScreenModules[i].createGui(guiBuilder);
  modulePanels[i]=guiBuilder.build();
  modulePanels[i].setLayoutHint(80,8,170,114);
  modulePanels[i].setFilledRectThickness(-2).setFilledBackground(0xff8b8b8b);
  toplevel.addChild(modulePanels[i]);
  buttons[i].setText(moduleProvider.getName());
}
Program: 165648
Project: 165648
Buggy source:
private void refreshButtons(){
  for (int i=0; i < ScreenContainer.SCREEN_MODULES; i++) {
    final ItemStack slot=tileEntity.getStackInSlot(i);
    if (!slot.isEmpty() && ScreenBlock.hasModuleProvider(slot)) {
      IModuleProvider moduleProvider=ScreenBlock.getModuleProvider(slot);
      Class<? extends IClientScreenModule> clientScreenModuleClass=moduleProvider.getClientScreenModule();
      if (!clientScreenModuleClass.isInstance(clientScreenModules[i])) {
        installModuleGui(i,slot,moduleProvider,clientScreenModuleClass);
      }
    }
 else {
      uninstallModuleGui(i);
    }
    if (modulePanels[i] != null) {
      modulePanels[i].setVisible(selected == i);
      buttons[i].setPressed(selected == i);
    }
  }
}

Fixed version (ground truth):
private void refreshButtons(){
  for (int i=0; i < ScreenContainer.SCREEN_MODULES; i++) {
    final ItemStack slot=tileEntity.getStackInSlot(i);
    if (!slot.isEmpty() && ScreenBlock.hasModuleProvider(slot)) {
      IModuleProvider moduleProvider=ScreenBlock.getModuleProvider(slot);
      Class<? extends IClientScreenModule<?>> clientScreenModuleClass=moduleProvider.getClientScreenModule();
      if (!clientScreenModuleClass.isInstance(clientScreenModules[i])) {
        installModuleGui(i,slot,moduleProvider,clientScreenModuleClass);
      }
    }
 else {
      uninstallModuleGui(i);
    }
    if (modulePanels[i] != null) {
      modulePanels[i].setVisible(selected == i);
      buttons[i].setPressed(selected == i);
    }
  }
}
Program: 165649
Project: 165649
Buggy source:
@Override public IAction[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_SCAN,ScreenControllerTileEntity::scan),new DefaultAction<>(ACTION_DETACH,ScreenControllerTileEntity::detach)};
}

Fixed version (ground truth):
@Override public IAction<?>[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_SCAN,ScreenControllerTileEntity::scan),new DefaultAction<>(ACTION_DETACH,ScreenControllerTileEntity::detach)};
}
Program: 165650
Project: 165650
Buggy source:
@Override public IAction[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_SCAN,ScannerTileEntity::scan)};
}

Fixed version (ground truth):
@Override public IAction<?>[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_SCAN,ScannerTileEntity::scan)};
}
Program: 165651
Project: 165651
Buggy source:
@Override public IValue[] getValues(){
  return new IValue[]{new DefaultValue<>(VALUE_RSMODE,ScannerTileEntity::getRSModeInt,ScannerTileEntity::setRSModeInt),new DefaultValue<>(VALUE_OFFSET,ScannerTileEntity::getDataOffset,ScannerTileEntity::setDataOffset)};
}

Fixed version (ground truth):
@Override public IValue<?,?>[] getValues(){
  return new IValue[]{new DefaultValue<>(VALUE_RSMODE,ScannerTileEntity::getRSModeInt,ScannerTileEntity::setRSModeInt),new DefaultValue<>(VALUE_OFFSET,ScannerTileEntity::getDataOffset,ScannerTileEntity::setDataOffset)};
}
Program: 165653
Project: 165653
Buggy source:
@Override public IAction[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_COMPACT,te -> ((ModularStorageTileEntity)te).compact()),new DefaultAction<>(ACTION_CYCLE,te -> ((ModularStorageTileEntity)te).cycle()),new DefaultAction<>(ACTION_CLEARGRID,te -> ((ModularStorageTileEntity)te).clearGrid())};
}

Fixed version (ground truth):
@Override public IAction<?>[] getActions(){
  return new IAction[]{new DefaultAction<>(ACTION_COMPACT,te -> ((ModularStorageTileEntity)te).compact()),new DefaultAction<>(ACTION_CYCLE,te -> ((ModularStorageTileEntity)te).cycle()),new DefaultAction<>(ACTION_CLEARGRID,te -> ((ModularStorageTileEntity)te).clearGrid())};
}
Program: 165657
Project: 165657
Buggy source:
public void readFromNBT(NBTTagCompound tagCompound){
  this.energy=tagCompound.getInteger("String_Node_Str");
  this.advancedBlocks=tagCompound.getInteger("String_Node_Str");
  this.simpleBlocks=tagCompound.getInteger("String_Node_Str");
  blocks.clear();
  NBTTagList list=tagCompound.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
  for (int i=0; i < list.tagCount(); i++) {
    NBTTagCompound tag=list.getCompoundTagAt(i);
    blocks.add(new GlobalCoordinate(new BlockPos(tag.getInteger("String_Node_Str"),tag.getInteger("String_Node_Str"),tag.getInteger("String_Node_Str")),tag.getInteger("String_Node_Str")));
  }
  if (energy < 0) {
    energy=calculateMaximumEnergy();
  }
}

Fixed version (ground truth):
public void readFromNBT(NBTTagCompound tagCompound){
  this.energy=tagCompound.getInteger("String_Node_Str");
  this.advancedBlocks=tagCompound.getInteger("String_Node_Str");
  this.simpleBlocks=tagCompound.getInteger("String_Node_Str");
  blocks.clear();
  NBTTagList list=tagCompound.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
  for (int i=0; i < list.tagCount(); i++) {
    NBTTagCompound tag=list.getCompoundTagAt(i);
    blocks.add(new GlobalCoordinate(new BlockPos(tag.getInteger("String_Node_Str"),tag.getInteger("String_Node_Str"),tag.getInteger("String_Node_Str")),tag.getInteger("String_Node_Str")));
  }
}
Program: 165658
Project: 165658
Buggy source:
private int receiveEnergyMulti(int maxReceive,boolean simulate){
  PowerCellNetwork.Network network=getNetwork();
  if (getWorld().isRemote) {
    throw new RuntimeException("String_Node_Str");
  }
  int totEnergy=network.calculateMaximumEnergy();
  int maxInsert=Math.min(totEnergy - network.getEnergy(),maxReceive);
  if (maxInsert > 0) {
    if (!simulate) {
      network.receiveEnergy(maxInsert);
      PowerCellNetwork.getChannels(getWorld()).save(getWorld());
    }
  }
  return isCreative() ? maxReceive : maxInsert;
}

Fixed version (ground truth):
private int receiveEnergyMulti(int maxReceive,boolean simulate){
  PowerCellNetwork.Network network=getNetwork();
  if (getWorld().isRemote) {
    throw new RuntimeException("String_Node_Str");
  }
  int totEnergy=PowerCellConfiguration.rfPerNormalCell * (network.getBlockCount() - network.getAdvancedBlockCount() - network.getSimpleBlockCount()) + PowerCellConfiguration.rfPerNormalCell * advancedFactor * network.getAdvancedBlockCount() + +PowerCellConfiguration.rfPerNormalCell * network.getSimpleBlockCount() / simpleFactor;
  int maxInsert=Math.min(totEnergy - network.getEnergy(),maxReceive);
  if (maxInsert > 0) {
    if (!simulate) {
      network.receiveEnergy(maxInsert);
      PowerCellNetwork.getChannels(getWorld()).save(getWorld());
    }
  }
  return isCreative() ? maxReceive : maxInsert;
}
Program: 165659
Project: 165659
Buggy source:
@Override protected void checkRedstone(World world,BlockPos pos){
  IBlockState state=world.getBlockState(pos);
  TileEntity te=world.getTileEntity(pos);
  if (state.getBlock() instanceof LogicSlabBlock && te instanceof AnalogTileEntity) {
    AnalogTileEntity tileEntity=(AnalogTileEntity)te;
    LogicFacing facing=tileEntity.getFacing(state);
    EnumFacing downSide=facing.getSide();
    EnumFacing inputSide=facing.getInputSide();
    EnumFacing rightSide=ThreeLogicBlock.rotateLeft(downSide,inputSide);
    EnumFacing leftSide=ThreeLogicBlock.rotateRight(downSide,inputSide);
    int outputStrength;
    int inputStrength=getInputStrength(world,pos,inputSide);
    int inputLeft=getInputStrength(world,pos,leftSide);
    int inputRight=getInputStrength(world,pos,rightSide);
    if (inputLeft == inputRight) {
      outputStrength=(int)(inputStrength * tileEntity.getMulEqual() + tileEntity.getAddEqual());
    }
 else     if (inputLeft < inputRight) {
      outputStrength=(int)(inputStrength * tileEntity.getMulLess() + tileEntity.getAddLess());
    }
 else {
      outputStrength=(int)(inputStrength * tileEntity.getMulGreater() + tileEntity.getAddGreater());
    }
    int oldPower=tileEntity.getPowerLevel();
    tileEntity.setPowerInput(outputStrength);
    if (oldPower != outputStrength) {
      world.notifyNeighborsOfStateChange(pos,this,false);
    }
  }
}

Fixed version (ground truth):
@Override protected void checkRedstone(World world,BlockPos pos){
  if (loopDetector.contains(pos)) {
    return;
  }
  IBlockState state=world.getBlockState(pos);
  TileEntity te=world.getTileEntity(pos);
  if (state.getBlock() instanceof LogicSlabBlock && te instanceof AnalogTileEntity) {
    loopDetector.add(pos);
    AnalogTileEntity tileEntity=(AnalogTileEntity)te;
    LogicFacing facing=tileEntity.getFacing(state);
    EnumFacing downSide=facing.getSide();
    EnumFacing inputSide=facing.getInputSide();
    EnumFacing rightSide=ThreeLogicBlock.rotateLeft(downSide,inputSide);
    EnumFacing leftSide=ThreeLogicBlock.rotateRight(downSide,inputSide);
    int outputStrength;
    int inputStrength=getInputStrength(world,pos,inputSide);
    int inputLeft=getInputStrength(world,pos,leftSide);
    int inputRight=getInputStrength(world,pos,rightSide);
    if (inputLeft == inputRight) {
      outputStrength=(int)(inputStrength * tileEntity.getMulEqual() + tileEntity.getAddEqual());
    }
 else     if (inputLeft < inputRight) {
      outputStrength=(int)(inputStrength * tileEntity.getMulLess() + tileEntity.getAddLess());
    }
 else {
      outputStrength=(int)(inputStrength * tileEntity.getMulGreater() + tileEntity.getAddGreater());
    }
    int oldPower=tileEntity.getPowerLevel();
    tileEntity.setPowerInput(outputStrength);
    if (oldPower != outputStrength) {
      world.notifyNeighborsOfStateChange(pos,this,false);
    }
    loopDetector.remove(pos);
  }
}