nus-yam/ex-repair huggingface dataset:
Program: 81864
Project: 81864
Buggy source:
/** 
 * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
 */
protected void mouseDragged(Minecraft par1Minecraft,int par2,int par3){
}

Fixed version (ground truth):
/** 
 * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
 */
@Override protected void mouseDragged(Minecraft par1Minecraft,int par2,int par3){
}
Program: 81865
Project: 81865
Buggy source:
/** 
 * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.
 */
public int getHoverState(boolean par1){
  byte var2=1;
  if (par1) {
    var2=2;
  }
 else   if (!this.enabled) {
    var2=0;
  }
  return var2;
}

Fixed version (ground truth):
/** 
 * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.
 */
@Override public int getHoverState(boolean par1){
  byte var2=1;
  if (par1) {
    var2=2;
  }
 else   if (!this.enabled) {
    var2=0;
  }
  return var2;
}
Program: 81866
Project: 81866
Buggy source:
/** 
 * Draws this button to the screen.
 */
public void drawButton(Minecraft par1Minecraft,int par2,int par3){
  if (this.visible) {
    FontRenderer fontrenderer=par1Minecraft.fontRenderer;
    par1Minecraft.getTextureManager().bindTexture(BUTTON_TEXTURES);
    GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
    this.hovered=par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
    int k=this.getHoverState(this.hovered);
    this.drawTexturedModalRect(this.x,this.y,0,46 + k * 20,this.width / 2,this.height);
    this.drawTexturedModalRect(this.x + this.width / 2,this.y,200 - this.width / 2,46 + k * 20,this.width / 2,this.height);
    this.mouseDragged(par1Minecraft,par2,par3);
    int l=14737632;
    if (!this.enabled) {
      l=-6250336;
    }
 else     if (this.hovered) {
      l=16777120;
    }
    String str="String_Node_Str";
    if (boolState) {
      str="String_Node_Str" + '2' + strEnabled;
    }
 else {
      str="String_Node_Str" + 'c' + strDisabled;
    }
    this.drawCenteredString(fontrenderer,str,this.x + this.width / 2,this.y + (this.height - 8) / 2,l);
  }
}

Fixed version (ground truth):
/** 
 * Draws this button to the screen.
 */
@Override public void drawButton(Minecraft par1Minecraft,int par2,int par3,float partialTicks){
  if (this.visible) {
    FontRenderer fontrenderer=par1Minecraft.fontRenderer;
    par1Minecraft.getTextureManager().bindTexture(BUTTON_TEXTURES);
    GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
    this.hovered=par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
    int k=this.getHoverState(this.hovered);
    this.drawTexturedModalRect(this.x,this.y,0,46 + k * 20,this.width / 2,this.height);
    this.drawTexturedModalRect(this.x + this.width / 2,this.y,200 - this.width / 2,46 + k * 20,this.width / 2,this.height);
    this.mouseDragged(par1Minecraft,par2,par3);
    int l=14737632;
    if (!this.enabled) {
      l=-6250336;
    }
 else     if (this.hovered) {
      l=16777120;
    }
    String str="String_Node_Str";
    if (boolState) {
      str="String_Node_Str" + '2' + strEnabled;
    }
 else {
      str="String_Node_Str" + 'c' + strDisabled;
    }
    this.drawCenteredString(fontrenderer,str,this.x + this.width / 2,this.y + (this.height - 8) / 2,l);
  }
}
Program: 81867
Project: 81867
Buggy source:
/** 
 * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e).
 */
public boolean mousePressed(Minecraft par1Minecraft,int par2,int par3){
  return this.visible && par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
}

Fixed version (ground truth):
/** 
 * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e).
 */
@Override public boolean mousePressed(Minecraft par1Minecraft,int par2,int par3){
  return this.visible && par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
}
Program: 81868
Project: 81868
Buggy source:
/** 
 * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e).
 */
public void mouseReleased(int par1,int par2){
}

Fixed version (ground truth):
/** 
 * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e).
 */
@Override public void mouseReleased(int par1,int par2){
}
Program: 81869
Project: 81869
Buggy source:
/** 
 * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
 */
protected void mouseDragged(Minecraft par1Minecraft,int par2,int par3){
}

Fixed version (ground truth):
/** 
 * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
 */
@Override protected void mouseDragged(Minecraft par1Minecraft,int par2,int par3){
}
Program: 81870
Project: 81870
Buggy source:
/** 
 * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.
 */
public int getHoverState(boolean par1){
  byte var2=1;
  if (par1) {
    var2=2;
  }
 else   if (!this.enabled) {
    var2=0;
  }
  return var2;
}

Fixed version (ground truth):
/** 
 * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.
 */
@Override public int getHoverState(boolean par1){
  byte var2=1;
  if (par1) {
    var2=2;
  }
 else   if (!this.enabled) {
    var2=0;
  }
  return var2;
}
Program: 81871
Project: 81871
Buggy source:
/** 
 * Draws this button to the screen.
 */
public void drawButton(Minecraft par1Minecraft,int par2,int par3){
  if (this.visible) {
    FontRenderer fontrenderer=par1Minecraft.fontRenderer;
    par1Minecraft.getTextureManager().bindTexture(BUTTON_TEXTURES);
    GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
    this.hovered=par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
    int k=this.getHoverState(this.hovered);
    this.drawTexturedModalRect(this.x,this.y,0,46 + k * 20,this.width / 2,this.height);
    this.drawTexturedModalRect(this.x + this.width / 2,this.y,200 - this.width / 2,46 + k * 20,this.width / 2,this.height);
    this.mouseDragged(par1Minecraft,par2,par3);
    int l=14737632;
    if (!this.enabled) {
      l=-6250336;
    }
 else     if (this.hovered) {
      l=16777120;
    }
    String str="String_Node_Str";
    str=getDisplayString();
    this.drawCenteredString(fontrenderer,str,this.x + this.width / 2,this.y + (this.height - 8) / 2,l);
  }
}

Fixed version (ground truth):
/** 
 * Draws this button to the screen.
 */
@Override public void drawButton(Minecraft par1Minecraft,int par2,int par3,float partialTicks){
  if (this.visible) {
    FontRenderer fontrenderer=par1Minecraft.fontRenderer;
    par1Minecraft.getTextureManager().bindTexture(BUTTON_TEXTURES);
    GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
    this.hovered=par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
    int k=this.getHoverState(this.hovered);
    this.drawTexturedModalRect(this.x,this.y,0,46 + k * 20,this.width / 2,this.height);
    this.drawTexturedModalRect(this.x + this.width / 2,this.y,200 - this.width / 2,46 + k * 20,this.width / 2,this.height);
    this.mouseDragged(par1Minecraft,par2,par3);
    int l=14737632;
    if (!this.enabled) {
      l=-6250336;
    }
 else     if (this.hovered) {
      l=16777120;
    }
    String str="String_Node_Str";
    str=getDisplayString();
    this.drawCenteredString(fontrenderer,str,this.x + this.width / 2,this.y + (this.height - 8) / 2,l);
  }
}
Program: 81872
Project: 81872
Buggy source:
/** 
 * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e).
 */
public boolean mousePressed(Minecraft par1Minecraft,int par2,int par3){
  return this.visible && par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
}

Fixed version (ground truth):
/** 
 * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e).
 */
@Override public boolean mousePressed(Minecraft par1Minecraft,int par2,int par3){
  return this.visible && par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
}
Program: 81874
Project: 81874
Buggy source:
public Block getBlock(){
  return this.block;
}

Fixed version (ground truth):
/** 
 * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
 */
public Block getBlock(){
  return this.block;
}
Program: 81875
Project: 81875
Buggy source:
public ItemSandLayer(Block block){
  super(block);
  this.setMaxDamage(0);
  this.setHasSubtypes(true);
}

Fixed version (ground truth):
public ItemSandLayer(Block block){
  super(block);
  this.setMaxDamage(0);
}
Program: 81881
Project: 81881
Buggy source:
public void onRenderScreenTick(){
  Minecraft mc=FMLClientHandler.instance().getClient();
  if (mc.currentScreen instanceof GuiIngameMenu) {
    ScaledResolution scaledresolution=new ScaledResolution(mc);
    int i=scaledresolution.getScaledWidth();
    int j=scaledresolution.getScaledHeight();
    int k=Mouse.getX() * i / mc.displayWidth;
    int l=j - Mouse.getY() * j / mc.displayHeight - 1;
    configButton=new GuiButton(0,(i / 2) - 100,0,200,20,"String_Node_Str");
    configButton.drawButton(mc,k,l);
    if (k >= configButton.xPosition && l >= configButton.yPosition && k < configButton.xPosition + 200 && l < configButton.yPosition + 20) {
      if (Mouse.isButtonDown(0)) {
        mc.displayGuiScreen(new GuiEZConfig());
      }
    }
  }
}

Fixed version (ground truth):
public void onRenderScreenTick(){
  Minecraft mc=FMLClientHandler.instance().getClient();
  if (mc.currentScreen instanceof GuiIngameMenu) {
    ScaledResolution scaledresolution=new ScaledResolution(mc);
    int i=scaledresolution.getScaledWidth();
    int j=scaledresolution.getScaledHeight();
    int k=Mouse.getX() * i / mc.displayWidth;
    int l=j - Mouse.getY() * j / mc.displayHeight - 1;
    configButton=new GuiButton(0,(i / 2) - 100,0,200,20,"String_Node_Str");
    configButton.drawButton(mc,k,l);
    if (k >= configButton.x && l >= configButton.y && k < configButton.x + 200 && l < configButton.y + 20) {
      if (Mouse.isButtonDown(0)) {
        mc.displayGuiScreen(new GuiEZConfig());
      }
    }
  }
}
Program: 81885
Project: 81885
Buggy source:
public void renderIconNew(double x,double y,double z,int width,int height,float angle,TextureAtlasSprite parIcon){
  float f6=parIcon.getMinU();
  float f7=parIcon.getMaxU();
  float f9=parIcon.getMinV();
  float f8=parIcon.getMaxV();
  float var12=0.6F;
  float var13=0.016666668F * var12;
  GlStateManager.pushMatrix();
  GlStateManager.translate((float)x + 0.5F,(float)y,(float)z + 0.5F);
  GL11.glNormal3f(0.0F,1.0F,0.0F);
  GlStateManager.rotate(-angle,0.0F,1.0F,0.0F);
  GlStateManager.scale(-var13,-var13,var13);
  int borderSize=2;
  Tessellator tessellator=Tessellator.getInstance();
  VertexBuffer worldrenderer=tessellator.getBuffer();
  GlStateManager.disableFog();
  this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
  worldrenderer.begin(7,DefaultVertexFormats.POSITION_TEX_COLOR);
  float r=1F;
  float g=1F;
  float b=1F;
  worldrenderer.pos((double)(-width / 2 - borderSize),(double)(-borderSize),0.0D).tex(f6,f9).color(r,g,b,1.0F).endVertex();
  worldrenderer.pos((double)(-width / 2 - borderSize),(double)(height),0.0D).tex(f6,f8).color(r,g,b,1.0F).endVertex();
  worldrenderer.pos((double)(width / 2 + borderSize),(double)(height),0.0D).tex(f7,f8).color(r,g,b,1.0F).endVertex();
  worldrenderer.pos((double)(width / 2 + borderSize),(double)(-borderSize),0.0D).tex(f7,f9).color(r,g,b,1.0F).endVertex();
  tessellator.draw();
  GL11.glPopMatrix();
}

Fixed version (ground truth):
public void renderIconNew(double x,double y,double z,int width,int height,float angle,TextureAtlasSprite parIcon){
  float f6=parIcon.getMinU();
  float f7=parIcon.getMaxU();
  float f9=parIcon.getMinV();
  float f8=parIcon.getMaxV();
  float var12=0.6F;
  float var13=0.016666668F * var12;
  GlStateManager.pushMatrix();
  GlStateManager.translate((float)x + 0.5F,(float)y,(float)z + 0.5F);
  GL11.glNormal3f(0.0F,1.0F,0.0F);
  GlStateManager.rotate(-angle,0.0F,1.0F,0.0F);
  GlStateManager.scale(-var13,-var13,var13);
  int borderSize=2;
  Tessellator tessellator=Tessellator.getInstance();
  BufferBuilder worldrenderer=tessellator.getBuffer();
  GlStateManager.disableFog();
  this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
  worldrenderer.begin(7,DefaultVertexFormats.POSITION_TEX_COLOR);
  float r=1F;
  float g=1F;
  float b=1F;
  worldrenderer.pos((double)(-width / 2 - borderSize),(double)(-borderSize),0.0D).tex(f6,f9).color(r,g,b,1.0F).endVertex();
  worldrenderer.pos((double)(-width / 2 - borderSize),(double)(height),0.0D).tex(f6,f8).color(r,g,b,1.0F).endVertex();
  worldrenderer.pos((double)(width / 2 + borderSize),(double)(height),0.0D).tex(f7,f8).color(r,g,b,1.0F).endVertex();
  worldrenderer.pos((double)(width / 2 + borderSize),(double)(-borderSize),0.0D).tex(f7,f9).color(r,g,b,1.0F).endVertex();
  tessellator.draw();
  GL11.glPopMatrix();
}
Program: 81889
Project: 81889
Buggy source:
public void drawTexturedModalRect(int x,int y,int textureX,int textureY,int width,int height){
  float f=0.00390625F / 2F;
  float f1=0.00390625F / 2F;
  Tessellator tessellator=Tessellator.getInstance();
  VertexBuffer worldrenderer=tessellator.getBuffer();
  worldrenderer.begin(7,DefaultVertexFormats.POSITION_TEX);
  worldrenderer.pos((double)(x + 0),(double)(y + height),(double)this.zLevel).tex((double)((float)(textureX + 0) * f),(double)((float)(textureY + height) * f1)).endVertex();
  worldrenderer.pos((double)(x + width),(double)(y + height),(double)this.zLevel).tex((double)((float)(textureX + width) * f),(double)((float)(textureY + height) * f1)).endVertex();
  worldrenderer.pos((double)(x + width),(double)(y + 0),(double)this.zLevel).tex((double)((float)(textureX + width) * f),(double)((float)(textureY + 0) * f1)).endVertex();
  worldrenderer.pos((double)(x + 0),(double)(y + 0),(double)this.zLevel).tex((double)((float)(textureX + 0) * f),(double)((float)(textureY + 0) * f1)).endVertex();
  tessellator.draw();
}

Fixed version (ground truth):
public void drawTexturedModalRect(int x,int y,int textureX,int textureY,int width,int height){
  float f=0.00390625F / 2F;
  float f1=0.00390625F / 2F;
  Tessellator tessellator=Tessellator.getInstance();
  BufferBuilder worldrenderer=tessellator.getBuffer();
  worldrenderer.begin(7,DefaultVertexFormats.POSITION_TEX);
  worldrenderer.pos((double)(x + 0),(double)(y + height),(double)this.zLevel).tex((double)((float)(textureX + 0) * f),(double)((float)(textureY + height) * f1)).endVertex();
  worldrenderer.pos((double)(x + width),(double)(y + height),(double)this.zLevel).tex((double)((float)(textureX + width) * f),(double)((float)(textureY + height) * f1)).endVertex();
  worldrenderer.pos((double)(x + width),(double)(y + 0),(double)this.zLevel).tex((double)((float)(textureX + width) * f),(double)((float)(textureY + 0) * f1)).endVertex();
  worldrenderer.pos((double)(x + 0),(double)(y + 0),(double)this.zLevel).tex((double)((float)(textureX + 0) * f),(double)((float)(textureY + 0) * f1)).endVertex();
  tessellator.draw();
}
Program: 81891
Project: 81891
Buggy source:
@Override public int quantityDropped(IBlockState state,int fortune,Random random){
  return ((Integer)state.getValue(LAYERS)) + 1;
}

Fixed version (ground truth):
@Override public int quantityDropped(IBlockState state,int fortune,Random random){
  return ((Integer)state.getValue(LAYERS));
}
Program: 81899
Project: 81899
Buggy source:
public void nbtSyncFromServer(NBTTagCompound parNBT){
  ID=parNBT.getLong("String_Node_Str");
  pos=new Vec3(parNBT.getDouble("String_Node_Str"),parNBT.getDouble("String_Node_Str"),parNBT.getDouble("String_Node_Str"));
  size=parNBT.getInteger("String_Node_Str");
  maxSize=parNBT.getInteger("String_Node_Str");
  this.stormType=EnumStormType.get(parNBT.getInteger("String_Node_Str"));
}

Fixed version (ground truth):
public void nbtSyncFromServer(NBTTagCompound parNBT){
  ID=parNBT.getLong("String_Node_Str");
  pos=new Vec3(parNBT.getDouble("String_Node_Str"),parNBT.getDouble("String_Node_Str"),parNBT.getDouble("String_Node_Str"));
  size=parNBT.getInteger("String_Node_Str");
  maxSize=parNBT.getInteger("String_Node_Str");
  this.weatherObjectType=EnumWeatherObjectType.get(parNBT.getInteger("String_Node_Str"));
}
Program: 81900
Project: 81900
Buggy source:
public NBTTagCompound nbtSyncForClient(NBTTagCompound nbt){
  nbt.setDouble("String_Node_Str",pos.xCoord);
  nbt.setDouble("String_Node_Str",pos.yCoord);
  nbt.setDouble("String_Node_Str",pos.zCoord);
  nbt.setLong("String_Node_Str",ID);
  nbt.setInteger("String_Node_Str",size);
  nbt.setInteger("String_Node_Str",maxSize);
  nbt.setInteger("String_Node_Str",this.stormType.ordinal());
  return nbt;
}

Fixed version (ground truth):
public NBTTagCompound nbtSyncForClient(NBTTagCompound nbt){
  nbt.setDouble("String_Node_Str",pos.xCoord);
  nbt.setDouble("String_Node_Str",pos.yCoord);
  nbt.setDouble("String_Node_Str",pos.zCoord);
  nbt.setLong("String_Node_Str",ID);
  nbt.setInteger("String_Node_Str",size);
  nbt.setInteger("String_Node_Str",maxSize);
  nbt.setInteger("String_Node_Str",this.weatherObjectType.ordinal());
  return nbt;
}
Program: 81901
Project: 81901
Buggy source:
public WeatherObjectSandstorm(WeatherManagerBase parManager){
  super(parManager);
  this.stormType=EnumStormType.SAND;
  if (parManager.getWorld().isRemote) {
    listParticlesCloud=new ArrayList<EntityRotFX>();
  }
}

Fixed version (ground truth):
public WeatherObjectSandstorm(WeatherManagerBase parManager){
  super(parManager);
  this.weatherObjectType=EnumWeatherObjectType.SAND;
  if (parManager.getWorld().isRemote) {
    listParticlesCloud=new ArrayList<EntityRotFX>();
  }
}
Program: 81903
Project: 81903
Buggy source:
@SideOnly(Side.CLIENT) public void tickClient(){
  Minecraft mc=FMLClientHandler.instance().getClient();
  if (this.lastPlayTime < System.currentTimeMillis()) {
    Vec3 pos=new Vec3(getPos().getX(),getPos().getY(),getPos().getZ());
    StormObject so=ClientTickHandler.weatherManager.getClosestStorm(pos,ConfigMisc.sirenActivateDistance,StormObject.STATE_FORMING);
    if (so != null) {
      this.lastPlayTime=System.currentTimeMillis() + 13000L;
      WeatherUtilSound.playNonMovingSound(pos,"String_Node_Str",1.0F,1.0F,120);
    }
 else {
      WeatherObjectSandstorm sandstorm=ClientTickHandler.weatherManager.getClosestSandstormByIntensity(pos);
      if (sandstorm != null) {
        List<Vec3> points=sandstorm.getSandstormAsShape();
        float distMax=75F;
        boolean inStorm=CoroUtilPhysics.isInConvexShape(pos,points);
        double dist=Math.min(distMax,CoroUtilPhysics.getDistanceToShape(pos,points));
        if (inStorm || dist < distMax) {
          String soundToPlay="String_Node_Str";
          if (getWorld().rand.nextBoolean()) {
            soundToPlay="String_Node_Str";
          }
          float distScale=Math.max(0.1F,1F - (float)((dist) / distMax));
          if (inStorm)           distScale=1F;
          this.lastPlayTime=System.currentTimeMillis() + 15000L;
          WeatherUtilSound.playNonMovingSound(pos,"String_Node_Str" + soundToPlay,1F,distScale,distMax);
        }
      }
    }
  }
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public void tickClient(){
  Minecraft mc=FMLClientHandler.instance().getClient();
  if (this.lastPlayTime < System.currentTimeMillis()) {
    Vec3 pos=new Vec3(getPos().getX(),getPos().getY(),getPos().getZ());
    StormObject so=ClientTickHandler.weatherManager.getClosestStorm(pos,ConfigMisc.sirenActivateDistance,StormObject.STATE_FORMING);
    if (so != null) {
      this.lastPlayTime=System.currentTimeMillis() + 13000L;
      WeatherUtilSound.playNonMovingSound(pos,"String_Node_Str",1.0F,1.0F,120);
    }
 else {
      if (!ConfigSand.Sandstorm_Siren_PleaseNoDarude) {
        WeatherObjectSandstorm sandstorm=ClientTickHandler.weatherManager.getClosestSandstormByIntensity(pos);
        if (sandstorm != null) {
          List<Vec3> points=sandstorm.getSandstormAsShape();
          float distMax=75F;
          boolean inStorm=CoroUtilPhysics.isInConvexShape(pos,points);
          double dist=Math.min(distMax,CoroUtilPhysics.getDistanceToShape(pos,points));
          if (inStorm || dist < distMax) {
            String soundToPlay="String_Node_Str";
            if (getWorld().rand.nextBoolean()) {
              soundToPlay="String_Node_Str";
            }
            float distScale=Math.max(0.1F,1F - (float)((dist) / distMax));
            if (inStorm)             distScale=1F;
            this.lastPlayTime=System.currentTimeMillis() + 15000L;
            WeatherUtilSound.playNonMovingSound(pos,"String_Node_Str" + soundToPlay,1F,distScale,distMax);
          }
        }
      }
    }
  }
}
Program: 81904
Project: 81904
Buggy source:
@Override public void readFromNBT(NBTTagCompound var1){
  super.readFromNBT(var1);
  weatherType=var1.getInteger("String_Node_Str");
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound var1){
  super.readFromNBT(var1);
  weatherType=var1.getInteger("String_Node_Str");
  if (var1.hasKey("String_Node_Str")) {
    lastTickStormObjectID=var1.getLong("String_Node_Str");
  }
}
Program: 81906
Project: 81906
Buggy source:
@Override public NBTTagCompound writeToNBT(NBTTagCompound var1){
  var1.setInteger("String_Node_Str",weatherType);
  return super.writeToNBT(var1);
}

Fixed version (ground truth):
@Override public NBTTagCompound writeToNBT(NBTTagCompound var1){
  var1.setInteger("String_Node_Str",weatherType);
  var1.setLong("String_Node_Str",lastTickStormObjectID);
  return super.writeToNBT(var1);
}
Program: 81910
Project: 81910
Buggy source:
@Override public void readSpawnData(ByteBuf data){
  System.out.println("String_Node_Str");
  tile=(Block)Block.blockRegistry.getObject(new ResourceLocation(ByteBufUtils.readUTF8String(data)));
  metadata=data.readInt();
}

Fixed version (ground truth):
@Override public void readSpawnData(ByteBuf data){
  tile=(Block)Block.blockRegistry.getObject(new ResourceLocation(ByteBufUtils.readUTF8String(data)));
  metadata=data.readInt();
}
Program: 81911
Project: 81911
Buggy source:
@Override public void writeSpawnData(ByteBuf data){
  System.out.println("String_Node_Str");
  ByteBufUtils.writeUTF8String(data,Block.blockRegistry.getNameForObject(tile).toString());
  data.writeInt(metadata);
}

Fixed version (ground truth):
@Override public void writeSpawnData(ByteBuf data){
  ByteBufUtils.writeUTF8String(data,Block.blockRegistry.getNameForObject(tile).toString());
  data.writeInt(metadata);
}
Program: 81912
Project: 81912
Buggy source:
public BlockUpdateSnapshot(int dimID,IBlockState state,BlockPos pos){
  this.dimID=dimID;
  this.state=state;
  this.pos=pos;
}

Fixed version (ground truth):
public BlockUpdateSnapshot(int dimID,IBlockState state,IBlockState statePrev,BlockPos pos,boolean createEntityForBlockRemoval){
  this.dimID=dimID;
  this.state=state;
  this.statePrev=statePrev;
  this.pos=pos;
  this.createEntityForBlockRemoval=createEntityForBlockRemoval;
}
Program: 81915
Project: 81915
Buggy source:
public StormObject getClosestStorm(Vec3 parPos,double maxDist,int severityFlagMin,boolean orRain){
  StormObject closestStorm=null;
  double closestDist=9999999;
  for (int i=0; i < getStormObjects().size(); i++) {
    StormObject storm=getStormObjects().get(i);
    if (storm.isDead)     continue;
    double dist=storm.pos.distanceTo(parPos);
    if (dist < closestDist && dist <= maxDist) {
      if ((storm.attrib_precipitation && orRain) || (severityFlagMin == -1 || storm.levelCurIntensityStage >= severityFlagMin)) {
        closestStorm=storm;
        closestDist=dist;
      }
    }
  }
  return closestStorm;
}

Fixed version (ground truth):
public StormObject getClosestStorm(Vec3 parPos,double maxDist,int severityFlagMin,boolean orRain){
  StormObject closestStorm=null;
  double closestDist=9999999;
  List<StormObject> listStorms=getStormObjects();
  for (int i=0; i < listStorms.size(); i++) {
    StormObject storm=listStorms.get(i);
    if (storm == null || storm.isDead)     continue;
    double dist=storm.pos.distanceTo(parPos);
    if (dist < closestDist && dist <= maxDist) {
      if ((storm.attrib_precipitation && orRain) || (severityFlagMin == -1 || storm.levelCurIntensityStage >= severityFlagMin)) {
        closestStorm=storm;
        closestDist=dist;
      }
    }
  }
  return closestStorm;
}
Program: 81916
Project: 81916
Buggy source:
@Override public void onEnable(){
  enabled=true;
  modules.values().forEach((module) -> {
    if (module.isEnabled())     return;
    eventManager.fire(new ModuleEnableEvent(this,module),event -> {
      if (!event.isCancelled())       module.onEnable();
    }
);
  }
);
}

Fixed version (ground truth):
@Override public void onEnable(){
  enabled=true;
  modules.values().forEach((module) -> {
    if (module.isEnabled())     return;
    eventManager.fire(new ModuleEnableEvent(this,module),event -> {
      if (!event.isCancelled())       module.enable();
    }
);
  }
);
}
Program: 81917
Project: 81917
Buggy source:
@Override public void onDisable(){
  enabled=false;
  modules.values().forEach((module) -> {
    if (!module.isEnabled())     return;
    eventManager.fire(new ModuleDisableEvent(this,module),event -> {
      if (!event.isCancelled())       module.onDisable();
    }
);
  }
);
}

Fixed version (ground truth):
@Override public void onDisable(){
  enabled=false;
  modules.values().forEach((module) -> {
    if (!module.isEnabled())     return;
    eventManager.fire(new ModuleDisableEvent(this,module),event -> {
      if (!event.isCancelled())       module.disable();
    }
);
  }
);
}
Program: 81918
Project: 81918
Buggy source:
boolean isEnabled();

Fixed version (ground truth):
public abstract boolean isEnabled();
Program: 81919
Project: 81919
Buggy source:
void onEnable();

Fixed version (ground truth):
protected void onEnable(){
}
Program: 81920
Project: 81920
Buggy source:
void onDisable();

Fixed version (ground truth):
protected void onDisable(){
}
Program: 81921
Project: 81921
Buggy source:
@Override default boolean isEnabled(){
  return instances.getOrDefault(this,false);
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  return instances.getOrDefault(this,false);
}
Program: 81922
Project: 81922
Buggy source:
@Override public Collection<ServerModule> setModules(Collection<ServerModule> currentModules,Server server){
  LoggingServerModule loggingModule=new LoggingServerModule(server);
  SchedulerServerModule schedulerModule=new SchedulerServerModule(server);
  PlayerServerModule playerModule=new PlayerServerModule(server);
  currentModules.add(loggingModule);
  currentModules.add(schedulerModule);
  currentModules.add(playerModule);
  System.out.println("String_Node_Str" + currentModules.size() + "String_Node_Str");
  return currentModules;
}

Fixed version (ground truth):
@Override public Collection<ServerModule> setModules(Collection<ServerModule> currentModules,Server server){
  LoggingModule loggingModule=new LoggingModule(server);
  SchedulerServerModule schedulerModule=new SchedulerServerModule(server);
  PlayerModule playerModule=new PlayerModule(server);
  currentModules.add(loggingModule);
  currentModules.add(schedulerModule);
  currentModules.add(playerModule);
  System.out.println("String_Node_Str" + currentModules.size() + "String_Node_Str");
  return currentModules;
}
Program: 81923
Project: 81923
Buggy source:
public static void main(String[] args){
  Server server=new Server(new CoreModuleLoader(),new JarModuleLoader());
  new EventListener<ModuleEnableEvent,ModuleEnableEvent>(){
    @Override public void onEvent(    ModuleEnableEvent event){
    }
  }
.register(ModuleEnableEvent.class,server.getEventManager());
  Runtime.getRuntime().addShutdownHook(new Thread(server::onDisable));
  server.onEnable();
  server.getModule(LoggingServerModule.class).info("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args){
  Server server=new Server(new CoreModuleLoader(),new JarModuleLoader());
  new EventListener<ModuleEnableEvent,ModuleEnableEvent>(){
    @Override public void onEvent(    ModuleEnableEvent event){
    }
  }
.register(ModuleEnableEvent.class,server.getEventManager());
  Runtime.getRuntime().addShutdownHook(new Thread(server::onDisable));
  server.onEnable();
  server.getModule(LoggingModule.class).info("String_Node_Str");
}
Program: 81924
Project: 81924
Buggy source:
public Player(InetSocketAddress address,String name,UUID UUID){
  this.address=address;
  this.name=name;
  this.UUID=UUID;
}

Fixed version (ground truth):
public Player(Server server,InetSocketAddress address,String name,UUID UUID){
  this.server=server;
  this.address=address;
  this.name=name;
  this.UUID=UUID;
}
Program: 81925
Project: 81925
Buggy source:
/** 
 * Opens a new session, and adds the specified   {@linkplain Player} to the list of online {@linkplain Player}s. <br> NOTE: THIS METHOD IS FOR INTERNAL USE ONLY!
 * @param address ({@linkplain InetSocketAddress}): The new   {@linkplain Player}'s   {@linkplain InetSocketAddress}.
 * @param name ({@linkplain String}): The new   {@linkplain Player}'s   {@linkplain String}.
 * @param UUID ({@linkplain UUID}): The new   {@linkplain Player}'s   {@linkplain UUID}.
 * @param provider {{@linkplain NetworkProvider}}: The   {@linkplain Player}'s   {@linkplain NetworkProvider} that is usedto communicate with the client.
 */
public void internalOpenSession(InetSocketAddress address,String name,UUID UUID,NetworkProvider provider){
  players.add(new Player(getServer(),address,name,UUID,provider));
  getServer().getModule(LoggingModule.class).debug("String_Node_Str" + address.getHostString() + "String_Node_Str"+ address.getPort());
}

Fixed version (ground truth):
/** 
 * Opens a new session, and adds the specified   {@linkplain Player} to the list of online {@linkplain Player}s. <br> NOTE: THIS METHOD IS FOR INTERNAL USE ONLY!
 * @param address ({@linkplain InetSocketAddress}): The new   {@linkplain Player}'s   {@linkplain InetSocketAddress}.
 * @param name ({@linkplain String}): The new   {@linkplain Player}'s   {@linkplain String}.
 * @param UUID ({@linkplain UUID}): The new   {@linkplain Player}'s   {@linkplain UUID}.
 * @param provider {{@linkplain NetworkProvider}}: The   {@linkplain Player}'s   {@linkplain NetworkProvider} that is usedto communicate with the client.
 */
public void internalOpenSession(InetSocketAddress address,String name,UUID UUID,NetworkProvider provider){
  players.add(new Player(getServer(),address,name,UUID));
  getServer().getModule(LoggingModule.class).debug("String_Node_Str" + address.getHostString() + "String_Node_Str"+ address.getPort());
}
Program: 81926
Project: 81926
Buggy source:
@Override public Collection<Module> setModules(Collection<Module> currentModules,Server server){
  LoggingModule loggingModule=new LoggingModule(server);
  SchedulerModule schedulerModule=new SchedulerModule(server);
  PlayerModule playerModule=new PlayerModule(server);
  NetworkModule networkModule=new MessageModule(server,schedulerModule);
  currentModules.add(loggingModule);
  currentModules.add(schedulerModule);
  currentModules.add(playerModule);
  currentModules.add(networkModule);
  System.out.println("String_Node_Str" + currentModules.size() + "String_Node_Str");
  return currentModules;
}

Fixed version (ground truth):
@Override public Collection<Module> setModules(Collection<Module> currentModules,Server server){
  LoggingModule loggingModule=new LoggingModule(server);
  SchedulerModule schedulerModule=new SchedulerModule(server);
  PlayerModule playerModule=new PlayerModule(server);
  currentModules.add(loggingModule);
  currentModules.add(schedulerModule);
  currentModules.add(playerModule);
  System.out.println("String_Node_Str" + currentModules.size() + "String_Node_Str");
  return currentModules;
}
Program: 81927
Project: 81927
Buggy source:
public MessageManager(Server server,NetworkConverter converter){
  super(server);
  this.converter=converter;
  listener=new ServerEventListener<MessageSendEvent>(){
    @Override public void onEvent(    MessageSendEvent event){
      if (!event.isCancelled())       queuePacket(converter.toPacket(event.getMessage()));
    }
  }
.priority(Priority.INTERNAL).post();
}

Fixed version (ground truth):
public MessageManager(Server server,NetworkConverter converter){
  super(server);
  this.converter=converter;
  listener=new ServerEventListener<MessageSendEvent>(){
    @Override public void onEvent(    MessageSendEvent event){
      if (!event.isCancelled())       provide(converter.toPacket(event.getMessage()));
    }
  }
.priority(Priority.INTERNAL).post();
}
Program: 81928
Project: 81928
Buggy source:
@Override public void dispatch(RawPacket packet){
  getServer().getExecutorService().execute(() -> getServer().getEventManager().fire(new MessageReciveEvent<>(converter.toMessage(packet))));
}

Fixed version (ground truth):
@Override public void dispatch(RawPacket packet){
  getServer().getExecutorService().execute(() -> getServer().getEventManager().fire(new MessageReceiveEvent<>(converter.toMessage(packet))));
}
Program: 81929
Project: 81929
Buggy source:
@Override public void onEvent(MessageSendEvent event){
  if (!event.isCancelled())   queuePacket(converter.toPacket(event.getMessage()));
}

Fixed version (ground truth):
@Override public void onEvent(MessageSendEvent event){
  if (!event.isCancelled())   provide(converter.toPacket(event.getMessage()));
}
Program: 81930
Project: 81930
Buggy source:
public PacketEventManager(Server server){
  super(server);
  listener=new ServerEventListener<PacketSendEvent>(){
    @Override public void onEvent(    PacketSendEvent event){
      if (!event.isCancelled())       queuePacket(event.getPacket());
    }
  }
.priority(Priority.INTERNAL).post();
}

Fixed version (ground truth):
public PacketEventManager(Server server){
  super(server);
  listener=new ServerEventListener<PacketSendEvent>(){
    @Override public void onEvent(    PacketSendEvent event){
      if (!event.isCancelled())       provide(event.getPacket());
    }
  }
.priority(Priority.INTERNAL).post();
}
Program: 81931
Project: 81931
Buggy source:
@Override public void onEvent(PacketSendEvent event){
  if (!event.isCancelled())   queuePacket(event.getPacket());
}

Fixed version (ground truth):
@Override public void onEvent(PacketSendEvent event){
  if (!event.isCancelled())   provide(event.getPacket());
}
Program: 81932
Project: 81932
Buggy source:
@Override public Collection<ServerModule> setModules(Collection<ServerModule> currentModules,Server server){
  LoggingModule loggingModule=new LoggingModule(server);
  SchedulerServerModule schedulerModule=new SchedulerServerModule(server);
  PlayerModule playerModule=new PlayerModule(server);
  currentModules.add(loggingModule);
  currentModules.add(schedulerModule);
  currentModules.add(playerModule);
  System.out.println("String_Node_Str" + currentModules.size() + "String_Node_Str");
  return currentModules;
}

Fixed version (ground truth):
@Override public Collection<ServerModule> setModules(Collection<ServerModule> currentModules,Server server){
  LoggingModule loggingModule=new LoggingModule(server);
  SchedulerModule schedulerModule=new SchedulerModule(server);
  PlayerModule playerModule=new PlayerModule(server);
  currentModules.add(loggingModule);
  currentModules.add(schedulerModule);
  currentModules.add(playerModule);
  System.out.println("String_Node_Str" + currentModules.size() + "String_Node_Str");
  return currentModules;
}
Program: 81934
Project: 81934
Buggy source:
public ConfigModule(Server server){
  super(server);
}

Fixed version (ground truth):
public ConfigModule(Server server,FileModule fileModule){
  super(server);
  this.fileModule=fileModule;
}
Program: 81935
Project: 81935
Buggy source:
@Override public void dispatch(RawPacket packet){
  getServer().getExecutorService().execute(() -> getServer().getEventManager().fire(new MessageReceiveEvent<>(converter.toMessage(packet))));
}

Fixed version (ground truth):
@Override public void dispatch(RawPacket packet){
  executorModule.getExecutorService().execute(() -> getServer().getEventManager().fire(new MessageReceiveEvent<>(converter.toMessage(packet))));
}
Program: 81936
Project: 81936
Buggy source:
public MessageModule(Server server,NetworkPipelineHandler handler,NetworkConverter converter){
  super(server,handler);
  this.converter=converter;
  listener=new ServerEventListener<MessageSendEvent>(){
    @Override public void onEvent(    MessageSendEvent event){
      if (!event.isCancelled())       provide(converter.toPacket(event.getMessage()));
    }
  }
.priority(Priority.INTERNAL).post();
}

Fixed version (ground truth):
public MessageModule(Server server,ExecutorModule executorModule,NetworkPipelineHandler handler,NetworkConverter converter){
  super(server,handler);
  this.executorModule=executorModule;
  this.converter=converter;
  listener=new ServerEventListener<MessageSendEvent>(){
    @Override public void onEvent(    MessageSendEvent event){
      if (!event.isCancelled())       provide(converter.toPacket(event.getMessage()));
    }
  }
.priority(Priority.INTERNAL).post();
}
Program: 81937
Project: 81937
Buggy source:
public SchedulerModule(Server server){
  super(server);
}

Fixed version (ground truth):
public SchedulerModule(Server server,ExecutorModule executorModule){
  super(server);
  this.executorModule=executorModule;
}
Program: 81938
Project: 81938
Buggy source:
public static void main(String[] args){
  Server server=new Server(new CoreModuleLoader(),new JarModuleLoader());
  new EventListener<ModuleEnableEvent,ModuleEnableEvent>(){
    @Override public void onEvent(    ModuleEnableEvent event){
      System.out.println(event.getModule().getClass().getName());
    }
  }
.register(ModuleEnableEvent.class,server.getEventManager());
  Runtime.getRuntime().addShutdownHook(new Thread(server::onDisable));
  server.onEnable();
  server.getModule(LoggingModule.class).info("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args){
  Server server=new Server(new CoreModuleLoader(),new JarModuleLoader());
  new EventListener<ModuleEnableEvent,ModuleEnableEvent>(){
    @Override public void onEvent(    ModuleEnableEvent event){
      System.out.println(event.getModule().getClass().getName());
    }
  }
.register(ModuleEnableEvent.class,server.getEventManager());
  Runtime.getRuntime().addShutdownHook(new Thread(server::disable));
  server.enable();
  server.getModule(LoggingModule.class).info("String_Node_Str");
}
Program: 81939
Project: 81939
Buggy source:
public void sendMessage(Message message){
  adapter.sendMessage(message);
}

Fixed version (ground truth):
public void sendMessage(Message message){
  adapter.sendMessage(message,address);
}
Program: 81940
Project: 81940
Buggy source:
protected void onMessage(MessageHandleEvent event){
  if (players.containsKey(event.getMessage().getAddress().toString())) {
    players.get(event.getMessage().getAddress().toString()).handleMessage(event.getMessage());
    return;
  }
  Player player=new Player(getServer(),event.getMessage().getAddress());
  players.put(player.getAddress().toString(),player);
  player.handleMessage(event.getMessage());
}

Fixed version (ground truth):
protected void onMessage(MessageHandleEvent event){
  if (players.containsKey(event.getMessage().getAddress().toString())) {
    players.get(event.getMessage().getAddress().toString()).handleMessage(event.getMessage());
    return;
  }
  Player player=new Player(getServer(),(InetSocketAddress)event.getMessage().getAddress());
  players.put(player.getAddress().toString(),player);
  player.handleMessage(event.getMessage());
}
Program: 81941
Project: 81941
Buggy source:
@Override public void run(){
  setName("String_Node_Str");
  udp.getServer().getLogger().info("String_Node_Str",addr.toString());
  try {
    socket=new DatagramSocket(null);
    socket.setBroadcast(true);
    socket.setSendBufferSize(1024 * 1024 * 8);
    socket.setReceiveBufferSize(1024 * 1024);
    try {
      socket.bind(addr);
    }
 catch (    BindException e) {
      getServer().getLogger().fatal("String_Node_Str",addr.toString());
      throw new RuntimeException(e);
    }
    socket.setSoTimeout(0);
    getServer().registerShutdownFunction(new Callable(this,"String_Node_Str",boolean.class));
    while (running) {
      byte[] buffer=new byte[1024 * 1024];
      DatagramPacket pk=new DatagramPacket(buffer,buffer.length);
      socket.receive(pk);
      pk.setData(Arrays.copyOf(buffer,pk.getLength()));
synchronized (receivedPacketQueue) {
        receivedPacketQueue.add(pk);
      }
    }
    socket.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  NoSuchMethodException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  setName("String_Node_Str");
  udp.getServer().getLogger().info("String_Node_Str",addr.toString());
  try {
    socket=new DatagramSocket(null);
    socket.setBroadcast(true);
    socket.setSendBufferSize(1024 * 1024 * 8);
    socket.setReceiveBufferSize(1024 * 1024);
    try {
      socket.bind(addr);
    }
 catch (    BindException e) {
      getServer().getLogger().fatal("String_Node_Str",addr.toString());
      throw new RuntimeException(e);
    }
    socket.setSoTimeout(0);
    getServer().registerShutdownFunction(new Callable(this,"String_Node_Str"));
    while (running) {
      byte[] buffer=new byte[1024 * 1024];
      DatagramPacket pk=new DatagramPacket(buffer,buffer.length);
      socket.receive(pk);
      pk.setData(Arrays.copyOf(buffer,pk.getLength()));
synchronized (receivedPacketQueue) {
        receivedPacketQueue.add(pk);
      }
    }
    socket.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  NoSuchMethodException e) {
    e.printStackTrace();
  }
}
Program: 81942
Project: 81942
Buggy source:
public PeProtocolSession(ProtocolManager mgr,NetworkBridge bridge,SocketAddress addr,PeProtocol pocket){
  this.mgr=mgr;
  this.bridge=bridge;
  this.addr=addr;
  this.pocket=pocket;
  subprotocols=pocket.getSubprotocols();
  try {
    getServer().getTicker().addRepeatingTask(new CallableTask(this,"String_Node_Str",long.class),10);
  }
 catch (  NoSuchMethodException e) {
    e.printStackTrace();
  }
  ACKQueue=new ArrayList<Integer>();
  NACKQueue=new ArrayList<Integer>();
  recoveryQueue=new HashMap<Integer,RaknetSentCustomPacket>();
  currentQueue=new RaknetSentCustomPacket();
  getServer().getLogger().debug("String_Node_Str",addr.toString());
}

Fixed version (ground truth):
public PeProtocolSession(ProtocolManager mgr,NetworkBridge bridge,SocketAddress addr,PeProtocol pocket){
  this.mgr=mgr;
  this.bridge=bridge;
  this.addr=addr;
  this.pocket=pocket;
  subprotocols=pocket.getSubprotocols();
  try {
    getServer().getTicker().addRepeatingTask(new CallableTask(this,"String_Node_Str"),10);
  }
 catch (  NoSuchMethodException e) {
    e.printStackTrace();
  }
  ACKQueue=new ArrayList<Integer>();
  NACKQueue=new ArrayList<Integer>();
  recoveryQueue=new HashMap<Integer,RaknetSentCustomPacket>();
  currentQueue=new RaknetSentCustomPacket();
  getServer().getLogger().debug("String_Node_Str",addr.toString());
}
Program: 81943
Project: 81943
Buggy source:
public synchronized void update(long ticks){
synchronized (ACKQueue) {
    if (ACKQueue.size() > 0) {
      int[] numbers=new int[ACKQueue.size()];
      int offset=0;
      for (      Integer i : ACKQueue) {
        numbers[offset++]=i;
      }
      ACKPacket ack=new ACKPacket(numbers);
      ack.encode();
      sendPacket(ack.getBuffer());
    }
  }
synchronized (NACKQueue) {
    if (NACKQueue.size() > 0) {
      int[] numbers=new int[NACKQueue.size()];
      int offset=0;
      for (      Integer i : NACKQueue) {
        numbers[offset++]=i;
      }
      NACKPacket nack=new NACKPacket(numbers);
      nack.encode();
      sendPacket(nack.getBuffer());
    }
  }
synchronized (currentQueue) {
    if (currentQueue.packets.size() > 0) {
      currentQueue.seqNumber=currentSequenceNum++;
      currentQueue.send(bridge,getAddress());
      recoveryQueue.put(currentQueue.seqNumber,currentQueue);
      currentQueue.packets.clear();
    }
  }
}

Fixed version (ground truth):
public synchronized void update(){
synchronized (ACKQueue) {
    if (ACKQueue.size() > 0) {
      int[] numbers=new int[ACKQueue.size()];
      int offset=0;
      for (      Integer i : ACKQueue) {
        numbers[offset++]=i;
      }
      ACKPacket ack=new ACKPacket(numbers);
      ack.encode();
      sendPacket(ack.getBuffer());
    }
  }
synchronized (NACKQueue) {
    if (NACKQueue.size() > 0) {
      int[] numbers=new int[NACKQueue.size()];
      int offset=0;
      for (      Integer i : NACKQueue) {
        numbers[offset++]=i;
      }
      NACKPacket nack=new NACKPacket(numbers);
      nack.encode();
      sendPacket(nack.getBuffer());
    }
  }
synchronized (currentQueue) {
    if (currentQueue.packets.size() > 0) {
      currentQueue.seqNumber=currentSequenceNum++;
      currentQueue.send(bridge,getAddress());
      recoveryQueue.put(currentQueue.seqNumber,currentQueue);
      currentQueue.packets.clear();
    }
  }
}
Program: 81944
Project: 81944
Buggy source:
private void handleCustomPacket(final byte pid,final ByteBuffer bb){
  AntiSpam.act(new Runnable(){
    @Override public void run(){
      byte[] buffer=new byte[bb.remaining()];
      int start=bb.position();
      int end=start + bb.remaining();
      for (int i=start; i < end; i++) {
        buffer[i - start]=bb.get(i);
      }
      StringBuilder sb=new StringBuilder(Integer.toHexString(pid));
      for (      byte b : buffer) {
        String s=Integer.toHexString(b);
        while (s.length() < 2) {
          s="String_Node_Str" + s;
        }
        sb.append(s);
      }
    }
  }
,"String_Node_Str",2000);
  RaknetReceivedCustomPacket cp=new RaknetReceivedCustomPacket(bb);
  acknowledge(cp);
  if (cp.seqNumber - lastSequenceNum == 1) {
    lastSequenceNum=cp.seqNumber;
  }
 else {
synchronized (NACKQueue) {
      for (int i=lastSequenceNum; i < cp.seqNumber; ++i) {
        NACKQueue.add(i);
      }
    }
  }
  for (  RaknetReceivedCustomPacket.ReceivedEncapsulatedPacket pk : cp.packets) {
    handleDataPacket(pk);
  }
}

Fixed version (ground truth):
private void handleCustomPacket(final byte pid,final ByteBuffer bb){
  RaknetReceivedCustomPacket cp=new RaknetReceivedCustomPacket(bb);
  acknowledge(cp);
  if (cp.seqNumber - lastSequenceNum == 1) {
    lastSequenceNum=cp.seqNumber;
  }
 else {
synchronized (NACKQueue) {
      for (int i=lastSequenceNum; i < cp.seqNumber; ++i) {
        NACKQueue.add(i);
      }
    }
  }
  for (  RaknetReceivedCustomPacket.ReceivedEncapsulatedPacket pk : cp.packets) {
    handleDataPacket(pk);
  }
}