nus-yam/ex-repair huggingface dataset:
Program: 149438
Project: 149438
Buggy source:
private void configurePagingLinks(PagingLinks pagingList){
  List<String> urls=new ArrayList<String>();
  for (long i=0; i < total; i+=limit) {
    UriBuilder builder=UriBuilder.fromUri(baseUrl).queryParam(offsetParameter,startIndex + i).queryParam(limitParameter,limit);
    for (    String curKey : parameters.keySet()) {
      Object[] value=parameters.get(curKey);
      if (value != null && value.length > 0) {
        builder.queryParam(curKey,value);
      }
    }
    urls.add(builder.toString());
    if (i + startIndex == offset) {
      pagingList.setCurLink(builder.toString());
    }
  }
  if (pagingList.getCurLink() == null) {
    pagingList.setCurLink(urls.get(urls.size() - 1));
  }
  pagingList.setLinks(urls);
}

Fixed version (ground truth):
private void configurePagingLinks(PagingLinks pagingList){
  List<String> urls=new ArrayList<String>();
  for (long i=0; i < total; i+=limit) {
    UriBuilder builder=buildUri(i);
    urls.add(builder.toString());
    if (i + startIndex == offset) {
      pagingList.setCurLink(builder.toString());
    }
  }
  if (urls.isEmpty()) {
    urls.add(buildUri(0).toString());
  }
  if (pagingList.getCurLink() == null) {
    pagingList.setCurLink(urls.get(urls.size() - 1));
  }
  pagingList.setLinks(urls);
}
Program: 149439
Project: 149439
Buggy source:
@Override protected void doTunnel(HttpServletRequest req,final HttpServletResponse res){
  String destination=res.getHeader("String_Node_Str");
  int c=0;
  if (destination == null || (c=destination.indexOf("String_Node_Str")) < 0) {
    try {
      res.sendError(HttpServletResponse.SC_BAD_REQUEST);
    }
 catch (    IOException e) {
    }
    return;
  }
  int port=Numbers.parseInt(destination.substring(c + 1));
  String host=destination.substring(0,c);
  Socket socket=null;
  try {
    socket=new Socket(host,port);
    socket.setSoTimeout(DEFAULT_TIMEOUT);
  }
 catch (  IOException e) {
    try {
      res.sendError(HttpServletResponse.SC_BAD_GATEWAY);
    }
 catch (    IOException e1) {
      return;
    }
  }
  final Socket socket_=socket;
  executor.execute(new Runnable(){
    @Override public void run(){
      try {
        onRecvRemote(socket_.getInputStream(),res.getOutputStream());
      }
 catch (      IOException e) {
      }
      closeSocket(socket_);
    }
  }
);
  InputStream in=null;
  try {
    in=req.getInputStream();
    ins.add(in);
    onRecvClient(in,socket.getOutputStream());
  }
 catch (  IOException e) {
  }
 finally {
    if (in != null) {
      ins.remove(in);
    }
  }
  closeSocket(socket);
}

Fixed version (ground truth):
@Override protected void doTunnel(HttpServletRequest req,final HttpServletResponse res){
  String destination=req.getHeader("String_Node_Str");
  int c=0;
  if (destination == null || (c=destination.indexOf("String_Node_Str")) < 0) {
    try {
      res.sendError(HttpServletResponse.SC_BAD_REQUEST);
    }
 catch (    IOException e) {
    }
    return;
  }
  int port=Numbers.parseInt(destination.substring(c + 1));
  String host=destination.substring(0,c);
  Socket socket=null;
  try {
    socket=new Socket(host,port);
    socket.setSoTimeout(DEFAULT_TIMEOUT);
  }
 catch (  IOException e) {
    try {
      res.sendError(HttpServletResponse.SC_BAD_GATEWAY);
    }
 catch (    IOException e1) {
      return;
    }
  }
  final Socket socket_=socket;
  executor.execute(new Runnable(){
    @Override public void run(){
      try {
        onRecvRemote(socket_.getInputStream(),res.getOutputStream());
      }
 catch (      IOException e) {
      }
      closeSocket(socket_);
    }
  }
);
  InputStream in=null;
  try {
    in=req.getInputStream();
    ins.add(in);
    onRecvClient(in,socket.getOutputStream());
  }
 catch (  IOException e) {
  }
 finally {
    if (in != null) {
      ins.remove(in);
    }
  }
  closeSocket(socket);
}
Program: 149440
Project: 149440
Buggy source:
public static boolean handleShutdown(Class<?> clazz,String[] args,final AtomicBoolean running){
  if (args != null && args.length > 0 && args[0].equals("String_Node_Str")) {
    running.set(false);
    return true;
  }
  SignalHandler handler=new SignalHandler(){
    @Override public void handle(    Signal signal){
    }
  }
;
  String command=System.getProperty("String_Node_Str");
  if (command == null || command.isEmpty()) {
    return false;
  }
  if (clazz.getName().equals(command.split("String_Node_Str")[0])) {
    Signal.handle(new Signal("String_Node_Str"),handler);
    Signal.handle(new Signal("String_Node_Str"),handler);
  }
  return false;
}

Fixed version (ground truth):
public static boolean handleShutdown(Class<?> clazz,String[] args,final AtomicBoolean running){
  if (args != null && args.length > 0 && args[0].equals("String_Node_Str")) {
    running.set(false);
    return true;
  }
  SignalHandler handler=new SignalHandler(){
    @Override public void handle(    Signal signal){
      running.set(false);
    }
  }
;
  String command=System.getProperty("String_Node_Str");
  if (command == null || command.isEmpty()) {
    return false;
  }
  if (clazz.getName().equals(command.split("String_Node_Str")[0])) {
    Signal.handle(new Signal("String_Node_Str"),handler);
    Signal.handle(new Signal("String_Node_Str"),handler);
  }
  return false;
}
Program: 149441
Project: 149441
Buggy source:
@Override public void handle(Signal signal){
}

Fixed version (ground truth):
@Override public void handle(Signal signal){
  running.set(false);
}
Program: 149442
Project: 149442
Buggy source:
private static void connect(final Socket socket){
  try (Socket socket_=sf.createSocket(host,port);InputStream is=new BufferedInputStream(socket_.getInputStream());OutputStream os=socket_.getOutputStream()){
    String header=null;
    if (AUTH == null) {
      header=String.format(NO_AUTH_HEADER,path,host,port,destination);
    }
 else {
      header=String.format(path,host,port,destination,new String(Base64.encodeBase64(AUTH.getBytes())));
    }
    os.write(header.getBytes());
    HashMap<String,String> headers=Headers.generateHeaders(is);
    Headers.checkHeaders(headers);
    Executors.execute(new Runnable(){
      @Override public void run(){
        try {
          onRecvLocal(socket.getInputStream(),os);
        }
 catch (        IOException e) {
        }
      }
    }
);
    if ("String_Node_Str".equals(headers.get("String_Node_Str"))) {
      onRecvRemoteChunked(is,os);
    }
 else {
      onRecvRemote(is,os);
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
private static void connect(final Socket socket){
  try (Socket socket_=sf.createSocket(host,port);InputStream is=new BufferedInputStream(socket_.getInputStream());OutputStream os=socket_.getOutputStream()){
    String header=null;
    if (AUTH == null) {
      header=String.format(NO_AUTH_HEADER,path,host,"String_Node_Str" + port,destination);
    }
 else {
      header=String.format(path,host,"String_Node_Str" + port,destination,new String(Base64.encodeBase64(AUTH.getBytes())));
    }
    os.write(header.getBytes());
    HashMap<String,String> headers=Headers.generateHeaders(is);
    Headers.checkHeaders(headers);
    Executors.execute(new Runnable(){
      @Override public void run(){
        try {
          onRecvLocal(socket.getInputStream(),os);
        }
 catch (        IOException e) {
        }
      }
    }
);
    if ("String_Node_Str".equals(headers.get("String_Node_Str"))) {
      onRecvRemoteChunked(is,socket.getOutputStream());
    }
 else {
      onRecvRemote(is,socket.getOutputStream());
    }
  }
 catch (  IOException e) {
  }
  close(socket);
}
Program: 149443
Project: 149443
Buggy source:
public static void init(final int measurements,final String[] events,int... options){
  if (defaultEventSet != -1) {
    Measurement.destroyEventSet(defaultEventSet);
  }
  defaultEventSet=Measurement.createEventSet(measurements,events,options);
}

Fixed version (ground truth):
public static void init(final int measurements,final String[] events,int... options){
  if (defaultEventSet != -1) {
    Measurement.destroyEventSet(defaultEventSet);
    defaultEventSet=-1;
  }
  defaultEventSet=Measurement.createEventSet(measurements,events,options);
}
Program: 149444
Project: 149444
Buggy source:
public void addDataRow(long[] row){
  data.add(row);
}

Fixed version (ground truth):
void addDataRow(long[] row){
  long copy[]=new long[row.length];
  for (int i=0; i < row.length; i++) {
    copy[i]=row[i];
  }
  data.add(copy);
}
Program: 149445
Project: 149445
Buggy source:
@Override public LabelledItem next(){
  index++;
  return new LabelledItem(testingSet[_class][index - 1],_class);
}

Fixed version (ground truth):
@Override public LabelledItem next(){
  index++;
  return new LabelledItem(trainingSet[_class][index - 1],_class);
}
Program: 149446
Project: 149446
Buggy source:
@Override public boolean hasNext(){
  return index < testingSet[_class].length;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return index < trainingSet[_class].length;
}
Program: 149447
Project: 149447
Buggy source:
@Override public double validate(double[] inputVector,RestrictedBoltzmannMachine machine){
  double distributiveError=0.0;
  for (int i=0; i < iterations; i++) {
    distributiveError+=machine.calcError(inputVector,inputVector);
  }
  distributiveError/=iterations;
  return distributiveError;
}

Fixed version (ground truth):
@Override public double validate(double[] inputVector,RestrictedBoltzmannMachine machine){
  double distributiveError=0.0;
  double[] values=new double[inputVector.length];
  for (int i=0; i < iterations; i++) {
    machine.calculateNetwork(inputVector);
    double[] tmp=machine.getVisibleNeurons();
    for (int j=0; j < tmp.length; j++) {
      values[j]+=tmp[j];
    }
  }
  for (int i=0; i < values.length; i++) {
    values[i]/=iterations;
  }
  return Utilities.calcError(inputVector,values);
}
Program: 149448
Project: 149448
Buggy source:
@Override public void trainNetwork(double[] targetValues){
  double[] fullTargetValues=new double[networkChimney.getSizeOfOutputVector() + sizeOfOutputVector];
  System.arraycopy(transformedInput,0,fullTargetValues,0,transformedInput.length);
  System.arraycopy(targetValues,0,fullTargetValues,transformedInput.length,targetValues.length);
  super.trainMachine(fullTargetValues);
}

Fixed version (ground truth):
@Override public void trainNetwork(double[] targetValues){
  double[] fullTargetValues=new double[networkChimney.getSizeOfOutputVector() + sizeOfOutputVector];
  System.arraycopy(transformedInput,0,fullTargetValues,0,transformedInput.length);
  System.arraycopy(targetValues,0,fullTargetValues,transformedInput.length,sizeOfOutputVector);
  super.trainMachine(fullTargetValues);
}
Program: 149449
Project: 149449
Buggy source:
private void nullOutputPartOfVector(){
  for (int i=this.getSizeOfInputVector() - 1; i >= this.getSizeOfInputVector() - sizeOfOutputVector; i--) {
    visibleNeurons[i]=0.0;
  }
}

Fixed version (ground truth):
private void nullOutputPartOfVector(){
  for (int i=networkChimney.getSizeOfOutputVector(), j=0; i < visibleNeurons.length; i++, j++) {
    visibleNeurons[i]=0.0;
    temporaryOutputValues[j]=0.0;
  }
}
Program: 149450
Project: 149450
Buggy source:
@Override public boolean onBlockActivated(World par1,int par2,int par3,int par4,EntityPlayer par5,int par6,float par7,float par8,float par9){
  int meta=par1.getBlockMetadata(par2,par3,par4);
  if (par5.isSneaking() && !this.ignoreRightClick[meta]) {
    return false;
  }
  if (this.ItemNoRightClick[meta]) {
    return false;
  }
  if (!par1.isRemote) {
    int guiID=getGuiIDForMeta(meta);
    if (guiID != -1) {
      SpmodMod mod=getModInstance(meta);
      if (mod == null) {
        mod=SpmodAPI.instance;
      }
      par5.openGui(mod,guiID,par1,par2,par3,par4);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World par1,int par2,int par3,int par4,EntityPlayer par5,int par6,float par7,float par8,float par9){
  int meta=par1.getBlockMetadata(par2,par3,par4);
  if (par5.isSneaking() && !this.ignoreRightClick[meta]) {
    return false;
  }
  if (this.ItemNoRightClick[meta]) {
    return false;
  }
  int guiID=getGuiIDForMeta(meta);
  if (guiID != -1) {
    SpmodMod mod=getModInstance(meta);
    if (mod == null) {
      mod=SpmodAPI.instance;
    }
    par5.openGui(mod,guiID,par1,par2,par3,par4);
    return true;
  }
  return false;
}
Program: 149451
Project: 149451
Buggy source:
@Override public int getRenderType(){
  return requiresRender() ? RenderHelper.getGlobalRenderID() : 0;
}

Fixed version (ground truth):
@Override public int getRenderType(){
  return requiresRender() ? SpmodAPI.core.getRenderID() : 0;
}
Program: 149452
Project: 149452
Buggy source:
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this);
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this).setAutoDrawing();
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}
Program: 149453
Project: 149453
Buggy source:
public int getCurrentID(){
  if (Item.itemsList[ID + 256] != null) {
    int end=ID + 256;
    throw new IndexOutOfBoundsException("String_Node_Str" + end);
  }
  return ID;
}

Fixed version (ground truth):
public int getCurrentID(){
  if (Item.itemsList[ID + 256] != null) {
    int end=ID + 256;
    throw new IndexOutOfBoundsException("String_Node_Str" + end + "String_Node_Str"+ Item.itemsList[ID + 256].getUnlocalizedName());
  }
  return ID;
}
Program: 149454
Project: 149454
Buggy source:
@ForgeSubscribe public void onDeath(LivingDeathEvent evt){
  EntityLivingBase entity=evt.entityLiving;
  if (entity != null && !entity.worldObj.isRemote) {
    if (entity instanceof EntityMob) {
      EntityMob mob=(EntityMob)entity;
      ArrayList<TileEntity> tiles=WorldReading.getTileWithAABB((int)mob.posX,(int)mob.posY,(int)mob.posZ,mob.worldObj,10,APIBlocks.blockUtils.blockID,1);
      for (      TileEntity tile : tiles) {
        if (tile != null && tile instanceof IExpProvider) {
          IExpProvider pro=(IExpProvider)tile;
          if (pro.absorbDeath()) {
            pro.addExp(mob.experienceValue);
          }
        }
      }
    }
    if (entity instanceof EntityAgeable) {
      EntityAgeable age=(EntityAgeable)entity;
      AnimalChunkLoader.onEntityDeath(age);
      if (gas.isValidEntity(age) && rand.nextInt(3) == 0) {
        IEntityGasInfo gasInfo=gas.getGasInfo(age.getClass());
        int min=gasInfo.getMinProducingGas(age);
        int max=gasInfo.getMaxProducingGas(age);
        if (max > 0 && max <= 10) {
          int newMax=Math.max(min,rand.nextInt(max + 1));
          int x=(int)age.posX;
          int y=(int)age.posY;
          int z=(int)age.posZ;
          if (newMax > 0 && age.worldObj.getBlockId(x,y + 1,z) == 0) {
            age.worldObj.setBlock(x,y + 1,z,APIBlocks.animalGas.blockID,newMax,3);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onDeath(LivingDeathEvent evt){
  EntityLivingBase entity=evt.entityLiving;
  if (entity != null && !entity.worldObj.isRemote) {
    if (entity instanceof EntityMob) {
      EntityMob mob=(EntityMob)entity;
      ArrayList<TileEntity> tiles=WorldReading.getTileWithAABB((int)mob.posX,(int)mob.posY,(int)mob.posZ,mob.worldObj,10,APIBlocks.blockUtils.blockID,1);
      for (      TileEntity tile : tiles) {
        if (tile != null && tile instanceof IExpProvider) {
          IExpProvider pro=(IExpProvider)tile;
          if (pro.absorbDeath()) {
            pro.addExp(mob.experienceValue);
          }
        }
      }
    }
    Entity en=evt.source.getSourceOfDamage();
    if (entity instanceof EntityAgeable && en != null && en instanceof EntityPlayer) {
      EntityAgeable age=(EntityAgeable)entity;
      AnimalChunkLoader.onEntityDeath(age);
      if (gas.isValidEntity(age) && rand.nextInt(3) == 0) {
        IEntityGasInfo gasInfo=gas.getGasInfo(age.getClass());
        int min=gasInfo.getMinProducingGas(age);
        int max=gasInfo.getMaxProducingGas(age);
        if (max > 0 && max <= 10) {
          int newMax=Math.max(min,rand.nextInt(max + 1));
          int x=(int)age.posX;
          int y=(int)age.posY;
          int z=(int)age.posZ;
          if (newMax > 0 && age.worldObj.getBlockId(x,y + 1,z) == 0) {
            age.worldObj.setBlock(x,y + 1,z,APIBlocks.animalGas.blockID,newMax,3);
          }
        }
      }
    }
  }
}
Program: 149456
Project: 149456
Buggy source:
@Override protected void drawGuiContainerForegroundLayer(int par1,int par2){
  String s="String_Node_Str";
  fontRenderer.drawString(s,xSize / 2 - fontRenderer.getStringWidth(s) / 2,6,4210752);
  fontRenderer.drawString(I18n.getString("String_Node_Str"),8,ySize - 96 + 2,4210752);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  int k=(width - xSize) / 2;
  int l=(height - ySize) / 2;
  setTexture(engine.getTexture("String_Node_Str"));
  defineSlot("String_Node_Str");
  this.drawTexturedModalRect(k - 52,l,getX(),getY(),23,16);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerForegroundLayer(int par1,int par2){
  String s="String_Node_Str";
  fontRenderer.drawString(s,xSize / 2 - fontRenderer.getStringWidth(s) / 2,6,4210752);
  fontRenderer.drawString(I18n.getString("String_Node_Str"),8,ySize - 96 + 2,4210752);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  int k=(width - xSize) / 2;
  int l=(height - ySize) / 2;
  setTexture(engine.getTexture("String_Node_Str"));
  defineSlot("String_Node_Str");
  this.drawTexturedModalRect(75,35,getX(),getY(),23,16);
}
Program: 149457
Project: 149457
Buggy source:
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this);
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this).setAutoDrawing();
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}
Program: 149458
Project: 149458
Buggy source:
public void doWork(){
  if (heat >= MaxHeat) {
    PressureRecipeList list=PressureRecipeList.getInstance();
    if (currentRecipe != null && !currentRecipe.recipeMatches(inv[1],inv[2],inv[3],1)) {
      currentRecipe=null;
    }
    if (currentRecipe == null && list.hasRecipe(inv[1],inv[2],inv[3])) {
      currentRecipe=list.getRecipe(inv[1],inv[2],inv[3]);
    }
    if (paused) {
      paused=false;
      return;
    }
    if (currentRecipe != null) {
      if (canRun()) {
        progress++;
        fuel--;
        int maxProgress=Math.max(currentRecipe.getRequiredCookTime(),100);
        if (progress >= maxProgress) {
          progress=0;
          int max=currentRecipe.isMultiRecipe() ? 5 : 1;
          for (; max > 1 && !currentRecipe.recipeMatches(inv[1],inv[2],inv[3],max); ) {
            max--;
          }
          currentRecipe.runRecipe(inv[1],inv[2],inv[3],max);
          ItemStack result=currentRecipe.getOutput().copy();
          result.stackSize*=max;
          storedExp+=(double)(FurnaceRecipes.smelting().getExperience(result) * max);
          for (int i=1; i < 4; i++) {
            if (inv[i] != null && inv[i].stackSize <= 0) {
              inv[i]=null;
            }
          }
          if (inv[4] == null) {
            inv[4]=result;
          }
 else {
            inv[4].stackSize+=result.stackSize;
          }
        }
      }
 else {
        progress=0;
      }
    }
 else {
      progress=0;
    }
  }
}

Fixed version (ground truth):
public void doWork(){
  if (heat >= MaxHeat) {
    PressureRecipeList list=PressureRecipeList.getInstance();
    if (currentRecipe != null && !currentRecipe.recipeMatches(inv[1],inv[2],inv[3],1)) {
      currentRecipe=null;
    }
    if (currentRecipe == null && list.hasRecipe(inv[1],inv[2],inv[3])) {
      currentRecipe=list.getRecipe(inv[1],inv[2],inv[3]);
    }
    if (paused) {
      paused=false;
      return;
    }
    if (currentRecipe != null) {
      if (canRun()) {
        progress++;
        fuel--;
        int maxProgress=Math.max(currentRecipe.getRequiredCookTime(),100);
        if (progress >= maxProgress) {
          progress=0;
          int max=currentRecipe.isMultiRecipe() ? 5 : 1;
          for (; max > 1 && (!currentRecipe.recipeMatches(inv[1],inv[2],inv[3],max) || (inv[4] != null && inv[4].stackSize + (currentRecipe.getOutput().stackSize * max) > inv[4].getMaxStackSize())); ) {
            max--;
          }
          currentRecipe.runRecipe(inv[1],inv[2],inv[3],max);
          ItemStack result=currentRecipe.getOutput().copy();
          result.stackSize*=max;
          storedExp+=(double)(FurnaceRecipes.smelting().getExperience(result) * max);
          for (int i=1; i < 4; i++) {
            if (inv[i] != null && inv[i].stackSize <= 0) {
              inv[i]=null;
            }
          }
          if (inv[4] == null) {
            inv[4]=result;
          }
 else {
            inv[4].stackSize+=result.stackSize;
          }
        }
      }
 else {
        progress=0;
      }
    }
 else {
      progress=0;
    }
  }
}
Program: 149459
Project: 149459
Buggy source:
public static void init(){
  if (Loader.isModLoaded("String_Node_Str")) {
    IC2IridiumPlugin.init();
  }
}

Fixed version (ground truth):
public static void init(){
  if (Loader.isModLoaded("String_Node_Str")) {
    IC2IridiumPlugin.init();
  }
  if (IC2Classic.isIc2ClassicLoaded()) {
    PressureRecipeList.getInstance().addRecipe(new RedefinedIron());
  }
}
Program: 149460
Project: 149460
Buggy source:
public void loadPlugins(){
  List<IPlugin> plugins=getPlugins("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  IPlugin plugin : plugins) {
    initPlugin(plugin);
  }
}

Fixed version (ground truth):
public void loadPlugins(){
  List<IPlugin> plugins=getPlugins("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  IPlugin plugin : plugins) {
    initPlugin(plugin);
  }
  PressureRecipeList list=PressureRecipeList.getInstance();
  FurnaceRecipes furnace=FurnaceRecipes.smelting();
  Map<Integer,ItemStack> map=furnace.getSmeltingList();
  for (  Entry<Integer,ItemStack> cu : map.entrySet()) {
    list.addRecipe(new FurnaceRecipe(cu.getKey(),cu.getValue()));
  }
  for (  Entry<List<Integer>,ItemStack> cu : furnace.getMetaSmeltingList().entrySet()) {
    list.addRecipe(new FurnaceRecipe(cu.getKey(),cu.getValue()));
  }
}
Program: 149461
Project: 149461
Buggy source:
public static void registerServer(){
  regist(new RetrogenSave());
  GameRegistry.registerWorldGenerator(SpmodWorldGen.getWorldGen());
  regist(ChunkCollector.getInstance());
  regist(new BlockDetector());
  TickRegistry.registerTickHandler(new CountdownTick(),Side.SERVER);
  regist(new WorldCrafter());
  StructureStorage.registerForgeEvent();
  TickRegistry.registerTickHandler(new ServerTick(),Side.SERVER);
  if (SpmodConfig.booleanInfos.get("String_Node_Str")) {
    TickRegistry.registerTickHandler(RetroGenTickHandler.getTicks(),Side.SERVER);
  }
  if (!SpmodConfig.booleanInfos.get("String_Node_Str")) {
    regist(new BucketHandler());
    regist(LivingHandler.instance);
  }
}

Fixed version (ground truth):
public static void registerServer(){
  regist(new RetrogenSave());
  GameRegistry.registerWorldGenerator(SpmodWorldGen.getWorldGen());
  regist(ChunkCollector.getInstance());
  regist(new BlockDetector());
  TickRegistry.registerTickHandler(new CountdownTick(),Side.SERVER);
  StructureStorage.registerForgeEvent();
  TickRegistry.registerTickHandler(new ServerTick(),Side.SERVER);
  if (SpmodConfig.booleanInfos.get("String_Node_Str")) {
    TickRegistry.registerTickHandler(RetroGenTickHandler.getTicks(),Side.SERVER);
  }
  if (!SpmodConfig.booleanInfos.get("String_Node_Str")) {
    regist(new BucketHandler());
    regist(LivingHandler.instance);
  }
}
Program: 149462
Project: 149462
Buggy source:
public void registerServer(){
  GameRegistry.registerCraftingHandler(new TinyCraftingHandler());
  FuelHandler.init();
  DataStorage.registerNBTReciver((ItemNetherCrystal)TinyItems.netherCrystal);
  new RenderCommand();
  initHopperUpgrades();
}

Fixed version (ground truth):
public void registerServer(){
  GameRegistry.registerCraftingHandler(new TinyCraftingHandler());
  FuelHandler.init();
  DataStorage.registerNBTReciver((ItemNetherCrystal)TinyItems.netherCrystal);
  new RenderCommand();
  initHopperUpgrades();
  ForgeRegister.regist(new WorldCrafter());
}
Program: 149463
Project: 149463
Buggy source:
@Override public boolean onBlockActivated(World par1,int par2,int par3,int par4,EntityPlayer par5,int par6,float par7,float par8,float par9){
  int meta=par1.getBlockMetadata(par2,par3,par4);
  if (par5.isSneaking() && !this.ignoreRightClick[meta]) {
    return false;
  }
  if (this.ItemNoRightClick[meta]) {
    return false;
  }
  if (!par1.isRemote) {
    int guiID=getGuiIDForMeta(meta);
    if (guiID != -1) {
      SpmodMod mod=getModInstance(meta);
      if (mod == null) {
        mod=SpmodAPI.instance;
      }
      par5.openGui(mod,guiID,par1,par2,par3,par4);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World par1,int par2,int par3,int par4,EntityPlayer par5,int par6,float par7,float par8,float par9){
  int meta=par1.getBlockMetadata(par2,par3,par4);
  if (par5.isSneaking() && !this.ignoreRightClick[meta]) {
    return false;
  }
  if (this.ItemNoRightClick[meta]) {
    return false;
  }
  int guiID=getGuiIDForMeta(meta);
  if (guiID != -1) {
    SpmodMod mod=getModInstance(meta);
    if (mod == null) {
      mod=SpmodAPI.instance;
    }
    par5.openGui(mod,guiID,par1,par2,par3,par4);
    return true;
  }
  return false;
}
Program: 149464
Project: 149464
Buggy source:
@Override public int getRenderType(){
  return requiresRender() ? RenderHelper.getGlobalRenderID() : 0;
}

Fixed version (ground truth):
@Override public int getRenderType(){
  return requiresRender() ? SpmodAPI.core.getRenderID() : 0;
}
Program: 149465
Project: 149465
Buggy source:
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this);
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this).setAutoDrawing();
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}
Program: 149466
Project: 149466
Buggy source:
public int getCurrentID(){
  if (Item.itemsList[ID + 256] != null) {
    int end=ID + 256;
    throw new IndexOutOfBoundsException("String_Node_Str" + end);
  }
  return ID;
}

Fixed version (ground truth):
public int getCurrentID(){
  if (Item.itemsList[ID + 256] != null) {
    int end=ID + 256;
    throw new IndexOutOfBoundsException("String_Node_Str" + end + "String_Node_Str"+ Item.itemsList[ID + 256].getUnlocalizedName());
  }
  return ID;
}
Program: 149467
Project: 149467
Buggy source:
@ForgeSubscribe public void onDeath(LivingDeathEvent evt){
  EntityLivingBase entity=evt.entityLiving;
  if (entity != null && !entity.worldObj.isRemote) {
    if (entity instanceof EntityMob) {
      EntityMob mob=(EntityMob)entity;
      ArrayList<TileEntity> tiles=WorldReading.getTileWithAABB((int)mob.posX,(int)mob.posY,(int)mob.posZ,mob.worldObj,10,APIBlocks.blockUtils.blockID,1);
      for (      TileEntity tile : tiles) {
        if (tile != null && tile instanceof IExpProvider) {
          IExpProvider pro=(IExpProvider)tile;
          if (pro.absorbDeath()) {
            pro.addExp(mob.experienceValue);
          }
        }
      }
    }
    if (entity instanceof EntityAgeable) {
      EntityAgeable age=(EntityAgeable)entity;
      AnimalChunkLoader.onEntityDeath(age);
      if (gas.isValidEntity(age) && rand.nextInt(3) == 0) {
        IEntityGasInfo gasInfo=gas.getGasInfo(age.getClass());
        int min=gasInfo.getMinProducingGas(age);
        int max=gasInfo.getMaxProducingGas(age);
        if (max > 0 && max <= 10) {
          int newMax=Math.max(min,rand.nextInt(max + 1));
          int x=(int)age.posX;
          int y=(int)age.posY;
          int z=(int)age.posZ;
          if (newMax > 0 && age.worldObj.getBlockId(x,y + 1,z) == 0) {
            age.worldObj.setBlock(x,y + 1,z,APIBlocks.animalGas.blockID,newMax,3);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onDeath(LivingDeathEvent evt){
  EntityLivingBase entity=evt.entityLiving;
  if (entity != null && !entity.worldObj.isRemote) {
    if (entity instanceof EntityMob) {
      EntityMob mob=(EntityMob)entity;
      ArrayList<TileEntity> tiles=WorldReading.getTileWithAABB((int)mob.posX,(int)mob.posY,(int)mob.posZ,mob.worldObj,10,APIBlocks.blockUtils.blockID,1);
      for (      TileEntity tile : tiles) {
        if (tile != null && tile instanceof IExpProvider) {
          IExpProvider pro=(IExpProvider)tile;
          if (pro.absorbDeath()) {
            pro.addExp(mob.experienceValue);
          }
        }
      }
    }
    Entity en=evt.source.getSourceOfDamage();
    if (entity instanceof EntityAgeable && en != null && en instanceof EntityPlayer) {
      EntityAgeable age=(EntityAgeable)entity;
      AnimalChunkLoader.onEntityDeath(age);
      if (gas.isValidEntity(age) && rand.nextInt(3) == 0) {
        IEntityGasInfo gasInfo=gas.getGasInfo(age.getClass());
        int min=gasInfo.getMinProducingGas(age);
        int max=gasInfo.getMaxProducingGas(age);
        if (max > 0 && max <= 10) {
          int newMax=Math.max(min,rand.nextInt(max + 1));
          int x=(int)age.posX;
          int y=(int)age.posY;
          int z=(int)age.posZ;
          if (newMax > 0 && age.worldObj.getBlockId(x,y + 1,z) == 0) {
            age.worldObj.setBlock(x,y + 1,z,APIBlocks.animalGas.blockID,newMax,3);
          }
        }
      }
    }
  }
}
Program: 149469
Project: 149469
Buggy source:
@Override protected void drawGuiContainerForegroundLayer(int par1,int par2){
  String s="String_Node_Str";
  fontRenderer.drawString(s,xSize / 2 - fontRenderer.getStringWidth(s) / 2,6,4210752);
  fontRenderer.drawString(I18n.getString("String_Node_Str"),8,ySize - 96 + 2,4210752);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  int k=(width - xSize) / 2;
  int l=(height - ySize) / 2;
  setTexture(engine.getTexture("String_Node_Str"));
  defineSlot("String_Node_Str");
  this.drawTexturedModalRect(k - 52,l,getX(),getY(),23,16);
}

Fixed version (ground truth):
@Override protected void drawGuiContainerForegroundLayer(int par1,int par2){
  String s="String_Node_Str";
  fontRenderer.drawString(s,xSize / 2 - fontRenderer.getStringWidth(s) / 2,6,4210752);
  fontRenderer.drawString(I18n.getString("String_Node_Str"),8,ySize - 96 + 2,4210752);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  int k=(width - xSize) / 2;
  int l=(height - ySize) / 2;
  setTexture(engine.getTexture("String_Node_Str"));
  defineSlot("String_Node_Str");
  this.drawTexturedModalRect(75,35,getX(),getY(),23,16);
}
Program: 149470
Project: 149470
Buggy source:
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this);
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public GuiInventoryCore getGui(InventoryPlayer par1){
  if (guiClass != null) {
    try {
      return guiClass.getConstructor(InventoryPlayer.class,AdvTile.class).newInstance(par1,this).setAutoDrawing();
    }
 catch (    Exception e) {
    }
  }
  return super.getGui(par1);
}
Program: 149471
Project: 149471
Buggy source:
public void doWork(){
  if (heat >= MaxHeat) {
    PressureRecipeList list=PressureRecipeList.getInstance();
    if (currentRecipe != null && !currentRecipe.recipeMatches(inv[1],inv[2],inv[3],1)) {
      currentRecipe=null;
    }
    if (currentRecipe == null && list.hasRecipe(inv[1],inv[2],inv[3])) {
      currentRecipe=list.getRecipe(inv[1],inv[2],inv[3]);
    }
    if (paused) {
      paused=false;
      return;
    }
    if (currentRecipe != null) {
      if (canRun()) {
        progress++;
        fuel--;
        int maxProgress=Math.max(currentRecipe.getRequiredCookTime(),100);
        if (progress >= maxProgress) {
          progress=0;
          int max=currentRecipe.isMultiRecipe() ? 5 : 1;
          for (; max > 1 && !currentRecipe.recipeMatches(inv[1],inv[2],inv[3],max); ) {
            max--;
          }
          currentRecipe.runRecipe(inv[1],inv[2],inv[3],max);
          ItemStack result=currentRecipe.getOutput().copy();
          result.stackSize*=max;
          storedExp+=(double)(FurnaceRecipes.smelting().getExperience(result) * max);
          for (int i=1; i < 4; i++) {
            if (inv[i] != null && inv[i].stackSize <= 0) {
              inv[i]=null;
            }
          }
          if (inv[4] == null) {
            inv[4]=result;
          }
 else {
            inv[4].stackSize+=result.stackSize;
          }
        }
      }
 else {
        progress=0;
      }
    }
 else {
      progress=0;
    }
  }
}

Fixed version (ground truth):
public void doWork(){
  if (heat >= MaxHeat) {
    PressureRecipeList list=PressureRecipeList.getInstance();
    if (currentRecipe != null && !currentRecipe.recipeMatches(inv[1],inv[2],inv[3],1)) {
      currentRecipe=null;
    }
    if (currentRecipe == null && list.hasRecipe(inv[1],inv[2],inv[3])) {
      currentRecipe=list.getRecipe(inv[1],inv[2],inv[3]);
    }
    if (paused) {
      paused=false;
      return;
    }
    if (currentRecipe != null) {
      if (canRun()) {
        progress++;
        fuel--;
        int maxProgress=Math.max(currentRecipe.getRequiredCookTime(),100);
        if (progress >= maxProgress) {
          progress=0;
          int max=currentRecipe.isMultiRecipe() ? 5 : 1;
          for (; max > 1 && (!currentRecipe.recipeMatches(inv[1],inv[2],inv[3],max) || (inv[4] != null && inv[4].stackSize + (currentRecipe.getOutput().stackSize * max) > inv[4].getMaxStackSize())); ) {
            max--;
          }
          currentRecipe.runRecipe(inv[1],inv[2],inv[3],max);
          ItemStack result=currentRecipe.getOutput().copy();
          result.stackSize*=max;
          storedExp+=(double)(FurnaceRecipes.smelting().getExperience(result) * max);
          for (int i=1; i < 4; i++) {
            if (inv[i] != null && inv[i].stackSize <= 0) {
              inv[i]=null;
            }
          }
          if (inv[4] == null) {
            inv[4]=result;
          }
 else {
            inv[4].stackSize+=result.stackSize;
          }
        }
      }
 else {
        progress=0;
      }
    }
 else {
      progress=0;
    }
  }
}
Program: 149472
Project: 149472
Buggy source:
public static void init(){
  if (Loader.isModLoaded("String_Node_Str")) {
    IC2IridiumPlugin.init();
  }
}

Fixed version (ground truth):
public static void init(){
  if (Loader.isModLoaded("String_Node_Str")) {
    IC2IridiumPlugin.init();
  }
  if (IC2Classic.isIc2ClassicLoaded()) {
    PressureRecipeList.getInstance().addRecipe(new RedefinedIron());
  }
}
Program: 149473
Project: 149473
Buggy source:
public void loadPlugins(){
  List<IPlugin> plugins=getPlugins("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  IPlugin plugin : plugins) {
    initPlugin(plugin);
  }
}

Fixed version (ground truth):
public void loadPlugins(){
  List<IPlugin> plugins=getPlugins("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  for (  IPlugin plugin : plugins) {
    initPlugin(plugin);
  }
  PressureRecipeList list=PressureRecipeList.getInstance();
  FurnaceRecipes furnace=FurnaceRecipes.smelting();
  Map<Integer,ItemStack> map=furnace.getSmeltingList();
  for (  Entry<Integer,ItemStack> cu : map.entrySet()) {
    list.addRecipe(new FurnaceRecipe(cu.getKey(),cu.getValue()));
  }
  for (  Entry<List<Integer>,ItemStack> cu : furnace.getMetaSmeltingList().entrySet()) {
    list.addRecipe(new FurnaceRecipe(cu.getKey(),cu.getValue()));
  }
}
Program: 149474
Project: 149474
Buggy source:
public static void renderBlockStandart(IBlockRenderer par1,BlockStack par2,RenderBlocks par3){
  BlockRendererSpmodCore.instance.renderBlock(par1,par2,par3);
}

Fixed version (ground truth):
public static void renderBlockStandart(Icon[] texture,float[] sides,Block block,float[] sizes,RenderBlocks render){
  if (sizes == null || sizes.length != 3) {
    sizes=new float[]{-0.5F,-0.5F,-0.5F};
  }
  Tessellator tessellator=Tessellator.instance;
  block.setBlockBounds(sides[0],sides[1],sides[2],sides[3],sides[4],sides[5]);
  block.setBlockBoundsForItemRender();
  render.setRenderBoundsFromBlock(block);
  GL11.glTranslatef(sizes[0],sizes[1],sizes[2]);
  tessellator.startDrawingQuads();
  tessellator.setNormal(0.0F,-1.0F,0.0F);
  render.renderFaceYNeg(block,0.0D,0.0D,0.0D,texture[0]);
  tessellator.draw();
  tessellator.startDrawingQuads();
  tessellator.setNormal(0.0F,1.0F,0.0F);
  render.renderFaceYPos(block,0.0D,0.0D,0.0D,texture[0]);
  tessellator.draw();
  tessellator.startDrawingQuads();
  tessellator.setNormal(0.0F,0.0F,-1.0F);
  render.renderFaceZNeg(block,0.0D,0.0D,0.0D,texture[0]);
  tessellator.draw();
  tessellator.startDrawingQuads();
  tessellator.setNormal(0.0F,0.0F,1.0F);
  render.renderFaceZPos(block,0.0D,0.0D,0.0D,texture[0]);
  tessellator.draw();
  tessellator.startDrawingQuads();
  tessellator.setNormal(-1.0F,0.0F,0.0F);
  render.renderFaceXNeg(block,0.0D,0.0D,0.0D,texture[0]);
  tessellator.draw();
  tessellator.startDrawingQuads();
  tessellator.setNormal(1.0F,0.0F,0.0F);
  render.renderFaceXPos(block,0.0D,0.0D,0.0D,texture[0]);
  tessellator.draw();
  GL11.glTranslatef(0.5F,0.5F,0.5F);
  block.setBlockBounds(0.0F,0.0F,0.0F,1.0F,1.0F,1.0F);
}
Program: 149476
Project: 149476
Buggy source:
@Override public void renderItem(ItemRenderType type,ItemStack item,Object... data){
  BlockStack stack=new BlockStack(item);
  IBlockRenderer render=stack.getCastedBlock(IBlockRenderer.class);
  if (render != null) {
    if (render.renderItemBlockBasic(item.getItemDamage())) {
      renderBlock(render,stack,(RenderBlocks)data[0]);
    }
 else {
      float[] key=render.getXYZForItemRenderer(type,stack.getMeta());
      if (key == null || key.length != 3) {
        key=new float[]{0.5F,0.5F,0.5F};
      }
      int renderPasses=render.getItemRenderPasses(stack.getMeta());
      if (renderPasses <= 0) {
        renderPasses=1;
      }
      for (int i=0; i < renderPasses; i++) {
        if (type == type.INVENTORY) {
          render.onItemRendering(helper,type,stack,i,key[0],key[1],key[2],item,data[0]);
        }
 else {
          render.onItemRendering(helper,type,stack,i,key[0],key[1],key[2],item,data[0],data[1]);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void renderItem(ItemRenderType type,ItemStack item,Object... data){
  BlockStack stack=new BlockStack(item);
  IBlockRenderer render=stack.getCastedBlock(IBlockRenderer.class);
  if (render != null) {
    if (render.renderItemBlockBasic(item.getItemDamage())) {
      renderBlock(render,stack,(RenderBlocks)data[0],type);
    }
 else {
      float[] key=render.getXYZForItemRenderer(type,stack.getMeta());
      if (key == null || key.length != 3) {
        key=new float[]{0.5F,0.5F,0.5F};
      }
      int renderPasses=render.getItemRenderPasses(stack.getMeta());
      if (renderPasses <= 0) {
        renderPasses=1;
      }
      for (int i=0; i < renderPasses; i++) {
        if (type == type.INVENTORY) {
          render.onItemRendering(helper,type,stack,i,key[0],key[1],key[2],item,data[0]);
        }
 else {
          render.onItemRendering(helper,type,stack,i,key[0],key[1],key[2],item,data[0],data[1]);
        }
      }
    }
  }
}
Program: 149477
Project: 149477
Buggy source:
@Override @SideOnly(Side.CLIENT) public Icon getBlockTexture(IBlockAccess par1iBlockAccess,int par2,int par3,int par4,int par5){
  AdvTile tile=this.getAdvTile(par1iBlockAccess,par2,par3,par4);
  if (tile != null) {
    return TextureEngine.getTextures().getIconSafe(tile.getIconFromSideAndMetadata(par5,0));
  }
  int meta=par1iBlockAccess.getBlockMetadata(par2,par3,par4);
  return getIcon(par5,meta);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public Icon getBlockTexture(IBlockAccess par1iBlockAccess,int par2,int par3,int par4,int par5){
  AdvTile tile=this.getAdvTile(par1iBlockAccess,par2,par3,par4);
  int meta=par1iBlockAccess.getBlockMetadata(par2,par3,par4);
  if (tile != null) {
    if (requiresRenderPass(meta)) {
      return TextureEngine.getTextures().getIconSafe(tile.getIconFromSideAndMetadata(par5,getRenderPass(meta)));
    }
    return TextureEngine.getTextures().getIconSafe(tile.getIconFromSideAndMetadata(par5,0));
  }
  return getIcon(par5,meta);
}
Program: 149478
Project: 149478
Buggy source:
@Override public void onItemRendering(BlockRendererHelper render,ItemRenderType type,BlockStack stack,int renderPass,float x,float y,float z,Object... data){
  render.renderBlockStandart(this,stack,(RenderBlocks)data[1]);
  Tessellator tessellator=Tessellator.instance;
  tessellator.startDrawingQuads();
  tessellator.setNormal(1.0F,1.0F,0.0F);
  Minecraft mc=FMLClientHandler.instance().getClient();
  mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
  ((RenderBlocks)data[1]).renderFaceXPos(this,-0.5D,0.0D,0.0D,TextureEngine.getTextures().getIconSafe(Item.porkRaw.getIconFromDamage(0)));
  tessellator.draw();
  mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
}

Fixed version (ground truth):
@Override public void onItemRendering(BlockRendererHelper render,ItemRenderType type,BlockStack stack,int renderPass,float x,float y,float z,Object... data){
  render.renderBlockStandart(this,stack,(RenderBlocks)data[1],type);
  Tessellator tessellator=Tessellator.instance;
  tessellator.startDrawingQuads();
  tessellator.setNormal(1.0F,1.0F,0.0F);
  Minecraft mc=FMLClientHandler.instance().getClient();
  mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
  ((RenderBlocks)data[1]).renderFaceXPos(this,-0.5D,0.0D,0.0D,TextureEngine.getTextures().getIconSafe(Item.porkRaw.getIconFromDamage(0)));
  tessellator.draw();
  mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
}
Program: 149479
Project: 149479
Buggy source:
@Override public void runCommand(ICommandSender par1,ISubCommand sub,String[] arg){
  AdvancedRetrogen gen=AdvancedRetrogen.getInstance();
  if (gen.doesRetrogenWork()) {
    if (arg.length == 1) {
      if (arg[0].equalsIgnoreCase("String_Node_Str") || arg[0].equalsIgnoreCase("String_Node_Str")) {
        boolean result=Boolean.parseBoolean(arg[0]);
        gen.setAdvancedRetrogenState(!result);
        par1.sendChatToPlayer(LangProxy.getText(result ? "String_Node_Str" : "String_Node_Str"));
      }
 else {
        par1.sendChatToPlayer(LangProxy.getText("String_Node_Str"));
      }
    }
 else {
      HashMap<Integer,ArrayList<ChunkData>> list=gen.getData();
      Iterator<Entry<Integer,ArrayList<ChunkData>>> iter=list.entrySet().iterator();
      for (; iter.hasNext(); ) {
        Entry<Integer,ArrayList<ChunkData>> data=iter.next();
        WorldProvider pro=DimensionManager.getProvider(data.getKey());
        par1.sendChatToPlayer(LangProxy.getText("String_Node_Str" + data.getKey() + "String_Node_Str"+ pro.getDimensionName()+ "String_Node_Str"+ data.getValue().size()+ "String_Node_Str"+ MathUtils.getTicksInTimeShort((data.getValue().size() * 1024) * gen.getTickSpeed())+ "String_Node_Str"));
      }
    }
  }
 else {
    par1.sendChatToPlayer(LangProxy.getText("String_Node_Str",EnumChatFormatting.DARK_RED));
  }
}

Fixed version (ground truth):
@Override public void runCommand(ICommandSender par1,ISubCommand sub,String[] arg){
  AdvancedRetrogen gen=AdvancedRetrogen.getInstance();
  if (gen.doesRetrogenWork()) {
    if (arg.length == 1) {
      if (arg[0].equalsIgnoreCase("String_Node_Str") || arg[0].equalsIgnoreCase("String_Node_Str")) {
        boolean result=Boolean.parseBoolean(arg[0]);
        gen.setAdvancedRetrogenState(!result);
        par1.sendChatToPlayer(LangProxy.getText(result ? "String_Node_Str" : "String_Node_Str"));
      }
 else {
        par1.sendChatToPlayer(LangProxy.getText("String_Node_Str"));
      }
    }
 else {
      HashMap<Integer,ArrayList<ChunkData>> list=gen.getData();
      Iterator<Entry<Integer,ArrayList<ChunkData>>> iter=list.entrySet().iterator();
      for (; iter.hasNext(); ) {
        Entry<Integer,ArrayList<ChunkData>> data=iter.next();
        WorldProvider pro=DimensionManager.getProvider(data.getKey());
        par1.sendChatToPlayer(LangProxy.getText("String_Node_Str" + data.getKey() + "String_Node_Str"+ pro.getDimensionName()+ "String_Node_Str"+ data.getValue().size()+ "String_Node_Str"+ MathUtils.getTicksInTimeShort((gen.getSizeFromList(data.getValue())) * gen.getTickSpeed())+ "String_Node_Str"));
      }
    }
  }
 else {
    par1.sendChatToPlayer(LangProxy.getText("String_Node_Str",EnumChatFormatting.DARK_RED));
  }
}