Program: 30806
Project: 30806
Buggy source:
@Override public void detectAndSendChanges(){
  delay++;
  if (Platform.isServer() && delay > 15 && network != null) {
    delay=0;
    IEnergyGrid eg=network.getCache(IEnergyGrid.class);
    if (eg != null) {
      avgAddition=(long)(100.0 * eg.getAvgPowerInjection());
      powerUsage=(long)(100.0 * eg.getAvgPowerUsage());
      lo_avgAddition=(int)(avgAddition & 0xffffffffL);
      hi_avgAddition=(int)(avgAddition >> 32L);
      lo_powerUsage=(int)(powerUsage & 0xffffffffL);
      hi_powerUsage=(int)(powerUsage >> 32L);
      for (      Object c : this.crafters) {
        ICrafting icrafting=(ICrafting)c;
        icrafting.sendProgressBarUpdate(this,0,(int)lo_avgAddition);
        icrafting.sendProgressBarUpdate(this,1,(int)hi_avgAddition);
        icrafting.sendProgressBarUpdate(this,2,(int)lo_powerUsage);
        icrafting.sendProgressBarUpdate(this,3,(int)hi_powerUsage);
      }
    }
    PacketMEInventoryUpdate piu;
    try {
      piu=new PacketMEInventoryUpdate();
      for (      Class<? extends IGridHost> machineClass : network.getMachinesClasses()) {
        IItemList<IAEItemStack> list=AEApi.instance().storage().createItemList();
        for (        IGridNode machine : network.getMachines(machineClass)) {
          IGridBlock blk=machine.getGridBlock();
          ItemStack is=blk.getMachineRepresentation();
          if (is != null) {
            IAEItemStack ais=AEItemStack.create(is);
            ais.setStackSize(1);
            ais.setCountRequestable((long)(blk.getIdlePowerUsage() * 100.0));
            list.add(ais);
          }
        }
        for (        IAEItemStack ais : list)         piu.appendItem(ais);
      }
      for (      Object c : this.crafters) {
        if (c instanceof EntityPlayer)         NetworkHandler.instance.sendTo(piu,(EntityPlayerMP)c);
      }
    }
 catch (    IOException e) {
    }
  }
  super.detectAndSendChanges();
}

Fixed version (ground truth):
@Override public void detectAndSendChanges(){
  delay++;
  if (Platform.isServer() && delay > 15 && network != null) {
    delay=0;
    IEnergyGrid eg=network.getCache(IEnergyGrid.class);
    if (eg != null) {
      avgAddition=(long)(100.0 * eg.getAvgPowerInjection());
      powerUsage=(long)(100.0 * eg.getAvgPowerUsage());
      lo_avgAddition=(int)(avgAddition & 0xffffffffL);
      hi_avgAddition=(int)(avgAddition >> 32L);
      lo_powerUsage=(int)(powerUsage & 0xffffffffL);
      hi_powerUsage=(int)(powerUsage >> 32L);
      for (      Object c : this.crafters) {
        ICrafting icrafting=(ICrafting)c;
        icrafting.sendProgressBarUpdate(this,0,(int)lo_avgAddition);
        icrafting.sendProgressBarUpdate(this,1,(int)hi_avgAddition);
        icrafting.sendProgressBarUpdate(this,2,(int)lo_powerUsage);
        icrafting.sendProgressBarUpdate(this,3,(int)hi_powerUsage);
      }
    }
    PacketMEInventoryUpdate piu;
    try {
      piu=new PacketMEInventoryUpdate();
      for (      Class<? extends IGridHost> machineClass : network.getMachinesClasses()) {
        IItemList<IAEItemStack> list=AEApi.instance().storage().createItemList();
        for (        IGridNode machine : network.getMachines(machineClass)) {
          IGridBlock blk=machine.getGridBlock();
          ItemStack is=blk.getMachineRepresentation();
          if (is != null && is.getItem() != null) {
            IAEItemStack ais=AEItemStack.create(is);
            ais.setStackSize(1);
            ais.setCountRequestable((long)(blk.getIdlePowerUsage() * 100.0));
            list.add(ais);
          }
        }
        for (        IAEItemStack ais : list)         piu.appendItem(ais);
      }
      for (      Object c : this.crafters) {
        if (c instanceof EntityPlayer)         NetworkHandler.instance.sendTo(piu,(EntityPlayerMP)c);
      }
    }
 catch (    IOException e) {
    }
  }
  super.detectAndSendChanges();
}