nus-yam/ex-repair huggingface dataset:
Program: 86584
Project: 86584
Buggy source:
/** 
 * Finds a free location on the map, one in which the supplied   {@link PlayerEntity} will not collide with.
 * @param player
 * @return the {@link Vector2f} that is suitable for the {@link PlayerEntity}
 */
public Vector2f findFreeSpot(PlayerEntity player){
  Vector2f freeSpot=player.getPos();
  int safety=100000;
  while ((map.rectCollides(player.getBounds()) || map.hasWorldCollidableTile((int)player.getCenterPos().x,(int)player.getCenterPos().y)) && safety > 0) {
    int w=(player.getBounds().width + 5);
    int h=(player.getBounds().height + 5);
    int x=random.nextInt(map.getMapWidth() - w);
    int y=random.nextInt(map.getMapHeight() - h);
    if (x <= w) {
      x=w;
    }
    if (y <= h) {
      y=h;
    }
    freeSpot.set(x,y);
    player.moveTo(freeSpot);
    safety--;
  }
  return freeSpot;
}

Fixed version (ground truth):
/** 
 * Finds a free location on the map, one in which the supplied   {@link PlayerEntity} will not collide with.
 * @param player
 * @return the {@link Vector2f} that is suitable for the {@link PlayerEntity}
 */
public Vector2f findFreeSpot(PlayerEntity player){
  Vector2f freeSpot=player.getPos();
  int safety=100000;
  while ((map.rectCollides(player.getBounds()) || map.hasWorldCollidableTile((int)player.getCenterPos().x,(int)player.getCenterPos().y) || doesTouchOthers(player,false)|| doesTouchMapObject(player,false)) && safety > 0) {
    int w=(player.getBounds().width + 5);
    int h=(player.getBounds().height + 5);
    int x=random.nextInt(map.getMapWidth() - w);
    int y=random.nextInt(map.getMapHeight() - h);
    if (x <= w) {
      x=w;
    }
    if (y <= h) {
      y=h;
    }
    freeSpot.set(x,y);
    player.moveTo(freeSpot);
    safety--;
  }
  return freeSpot;
}
Program: 86585
Project: 86585
Buggy source:
public boolean doesTouchMapObject(Entity ent){
  List<MapObject> mapObjects=getMapObjects();
  for (int i=0; i < mapObjects.size(); i++) {
    MapObject object=mapObjects.get(i);
    if (object.isCollidable()) {
      if (object.isTouching(ent) && ent.onMapObjectTouch != null) {
        ent.onMapObjectTouch.onTouch(ent,object);
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean doesTouchMapObject(Entity ent,boolean invokeTouch){
  List<MapObject> mapObjects=getMapObjects();
  for (int i=0; i < mapObjects.size(); i++) {
    MapObject object=mapObjects.get(i);
    if (object.isCollidable()) {
      if (object.isTouching(ent)) {
        if (!invokeTouch) {
          return true;
        }
        if (ent.onMapObjectTouch != null) {
          ent.onMapObjectTouch.onTouch(ent,object);
          return true;
        }
      }
    }
  }
  return false;
}
Program: 86586
Project: 86586
Buggy source:
@Override public boolean doesTouchOthers(Entity ent){
  for (int i=0; i < this.entities.length; i++) {
    Entity other=this.entities[i];
    if (other != null) {
      if (other != ent && ent.isTouching(other)) {
        if (ent.onTouch != null) {
          ent.onTouch.onTouch(ent,other);
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean doesTouchOthers(Entity ent,boolean invokeTouch){
  for (int i=0; i < this.entities.length; i++) {
    Entity other=this.entities[i];
    if (other != null) {
      if (other != ent && ent.isTouching(other)) {
        if (!invokeTouch) {
          return true;
        }
        if (ent.onTouch != null) {
          ent.onTouch.onTouch(ent,other);
          return true;
        }
      }
    }
  }
  return false;
}
Program: 86587
Project: 86587
Buggy source:
/** 
 * Determines if the supplied entity touches another entity.  If the   {@link Entity#onTouch} listeneris implemented, it will invoke it.
 * @param ent
 * @return true if it does.
 */
public abstract boolean doesTouchOthers(Entity ent);

Fixed version (ground truth):
public abstract boolean doesTouchOthers(Entity ent,boolean invokeTouch);
Program: 86588
Project: 86588
Buggy source:
/** 
 * Spawns a new   {@link BombTarget}
 * @param position
 * @return the bomb target
 */
public BombTarget newBombTarget(Vector2f position){
  final BombTarget target=new BombTarget(position,this);
  target.onKill=new KilledListener(){
    @Override public void onKill(    Entity entity,    Entity killer){
      bombTargets.remove(target);
    }
  }
;
  this.bombTargets.add(target);
  addEntity(target);
  return target;
}

Fixed version (ground truth):
/** 
 * Spawns a new   {@link BombTarget}
 * @param position
 * @return the bomb target
 */
public BombTarget newBombTarget(Team owner,Vector2f position){
  final BombTarget target=new BombTarget(owner,position,this);
  target.onKill=new KilledListener(){
    @Override public void onKill(    Entity entity,    Entity killer){
      bombTargets.remove(target);
    }
  }
;
  this.bombTargets.add(target);
  addEntity(target);
  return target;
}
Program: 86589
Project: 86589
Buggy source:
/** 
 * @param position
 * @param game
 */
public BombTarget(Vector2f position,Game game){
  super(game.getNextPersistantId(),position,0,game,Type.BOMB_TARGET);
  this.bounds.width=64;
  this.bounds.height=32;
  this.bounds.setLocation(position);
  this.netBombTarget=new NetBombTarget();
  setNetEntity(netBombTarget);
}

Fixed version (ground truth):
/** 
 * @param position
 * @param game
 */
public BombTarget(Team owner,Vector2f position,Game game){
  super(game.getNextPersistantId(),position,0,game,Type.BOMB_TARGET);
  this.owner=owner;
  this.bounds.width=64;
  this.bounds.height=32;
  this.bounds.setLocation(position);
  this.netBombTarget=new NetBombTarget();
  setNetEntity(netBombTarget);
}
Program: 86590
Project: 86590
Buggy source:
/** 
 * Handles a   {@link BombTarget}, meaning this will either plant or disarm the   {@link BombTarget}.
 * @param target
 */
protected void handleBombTarget(BombTarget target){
  if (target != null) {
    if (target.bombActive()) {
      Bomb bomb=target.getBomb();
      bomb.disarm(this);
      game.emitSound(getId(),SoundType.BOMB_DISARM,getPos());
    }
 else {
      if (!target.isBombAttached()) {
        Bomb bomb=game.newBomb(target);
        bomb.plant(this,target);
        target.attachBomb(bomb);
        game.emitSound(getId(),SoundType.BOMB_PLANT,getPos());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Handles a   {@link BombTarget}, meaning this will either plant or disarm the   {@link BombTarget}.
 * @param target
 */
protected void handleBombTarget(BombTarget target){
  if (target != null) {
    if (target.getOwner().equals(getTeam())) {
      if (target.bombActive()) {
        Bomb bomb=target.getBomb();
        bomb.disarm(this);
        game.emitSound(getId(),SoundType.BOMB_DISARM,getPos());
      }
    }
 else {
      if (!target.isBombAttached()) {
        Bomb bomb=game.newBomb(target);
        bomb.plant(this,target);
        target.attachBomb(bomb);
        game.emitSound(getId(),SoundType.BOMB_PLANT,getPos());
      }
    }
  }
}
Program: 86591
Project: 86591
Buggy source:
@Override public void init(Game game){
  target=game.newBombTarget(position);
  if (rotated) {
    target.rotate90();
  }
}

Fixed version (ground truth):
@Override public void init(Game game){
  target=game.newBombTarget(game.getGameType().getDefender(),position);
  if (rotated) {
    target.rotate90();
  }
}
Program: 86592
Project: 86592
Buggy source:
/** 
 * @return the attacker
 */
public Team getAttacker(){
  return attacker;
}

Fixed version (ground truth):
/** 
 * @return the attacker
 */
@Override public Team getAttacker(){
  return attacker;
}
Program: 86593
Project: 86593
Buggy source:
/** 
 * @return the defender
 */
public Team getDefender(){
  return defender;
}

Fixed version (ground truth):
/** 
 * @return the defender
 */
@Override public Team getDefender(){
  return defender;
}
Program: 86594
Project: 86594
Buggy source:
/** 
 * @param position
 * @param speed
 * @param game
 */
public PlayerEntity(int id,Vector2f position,Game game){
  super(id,position,PLAYER_SPEED,game,Type.PLAYER);
  this.player=new NetPlayer();
  this.player.id=id;
  this.partialPlayer=new NetPlayerPartial();
  this.partialPlayer.id=id;
  this.bounds.set(position,PLAYER_WIDTH,PLAYER_HEIGHT);
  this.inputVel=new Vector2f();
  this.enemyDir=new Vector2f();
  this.headshot=new Rectangle(4,4);
  this.limbshot=new Rectangle(10,10);
  this.bulletDir=new Vector2f();
  this.inventory=new Inventory(MAX_PRIMARY_WEAPONS);
  this.hearingBounds=new Rectangle(PLAYER_HEARING_RADIUS,PLAYER_HEARING_RADIUS);
  this.stamina=MAX_STAMINA;
  this.visualBounds=new Rectangle(5000,5000);
  setLineOfSight(WeaponConstants.DEFAULT_LINE_OF_SIGHT);
  setHearingRadius(PLAYER_HEARING_RADIUS);
}

Fixed version (ground truth):
/** 
 * @param position
 * @param speed
 * @param game
 */
public PlayerEntity(int id,Vector2f position,Game game){
  super(id,position,PLAYER_SPEED,game,Type.PLAYER);
  this.player=new NetPlayer();
  this.player.id=id;
  this.partialPlayer=new NetPlayerPartial();
  this.partialPlayer.id=id;
  this.bounds.set(position,PLAYER_WIDTH,PLAYER_HEIGHT);
  this.inputVel=new Vector2f();
  this.enemyDir=new Vector2f();
  this.headshot=new Rectangle(4,4);
  this.limbshot=new Rectangle(10,10);
  this.bulletDir=new Vector2f();
  this.inventory=new Inventory(MAX_PRIMARY_WEAPONS);
  this.hearingBounds=new Rectangle(PLAYER_HEARING_RADIUS,PLAYER_HEARING_RADIUS);
  this.stamina=MAX_STAMINA;
  this.visualBounds=new Rectangle(2000,2000);
  setLineOfSight(WeaponConstants.DEFAULT_LINE_OF_SIGHT);
  setHearingRadius(PLAYER_HEARING_RADIUS);
}
Program: 86597
Project: 86597
Buggy source:
/** 
 * Sets the absolute position (the other setPos functions account  for the lightSize)
 * @param pos
 */
public void setAbsolutePos(Vector2f pos){
  this.pos.set(pos);
}

Fixed version (ground truth):
/** 
 * Sets the absolute position (the other setPos functions account  for the lightSize)
 * @param pos
 */
public void setAbsolutePos(Vector2f pos){
  this.pos.set(pos);
  this.absolutePos.set(pos);
}
Program: 86598
Project: 86598
Buggy source:
@Override public void setLightSize(int lightSize){
  this.lightSize=lightSize;
}

Fixed version (ground truth):
@Override public void setLightSize(int lightSize){
  int previousLightSize=this.lightSize;
  this.lightSize=lightSize;
  if (previousLightSize != lightSize) {
    setPos(this.absolutePos);
  }
}
Program: 86599
Project: 86599
Buggy source:
@Override public void setPos(float x,float y){
  this.pos.set(x,y);
  this.pos.x-=lightSize / 2;
  this.pos.y-=lightSize / 2;
}

Fixed version (ground truth):
@Override public void setPos(float x,float y){
  this.pos.set(x,y);
  this.absolutePos.set(pos);
  this.pos.x-=lightSize / 2;
  this.pos.y-=lightSize / 2;
}
Program: 86600
Project: 86600
Buggy source:
/** 
 * @param pos
 */
public ImageLight(LightSystem lightSystem,Vector2f pos){
  this.lightSystem=lightSystem;
  this.pos=pos;
  this.orientation=0;
  this.color=new Vector3f(0.3f,0.3f,0.7f);
  this.luminacity=0.5f;
  this.lightOscillate=false;
  this.on=true;
  this.flickerTime=70;
  setTexture(Art.lightMap);
  lightSize=512;
}

Fixed version (ground truth):
/** 
 * @param pos
 */
public ImageLight(LightSystem lightSystem,Vector2f pos){
  this.lightSystem=lightSystem;
  this.pos=pos;
  this.absolutePos=new Vector2f(pos);
  this.orientation=0;
  this.color=new Vector3f(0.3f,0.3f,0.7f);
  this.luminacity=0.5f;
  this.lightOscillate=false;
  this.on=true;
  this.flickerTime=70;
  setTexture(Art.lightMap);
  lightSize=512;
}
Program: 86601
Project: 86601
Buggy source:
@Override public void read(IOBuffer buffer){
  super.read(buffer);
  state=buffer.getByte();
  orientation=BufferIO.readAngle(buffer);
  turretOrientation=BufferIO.readAngle(buffer);
  primaryWeaponState=buffer.getByte();
  secondaryWeaponState=buffer.getByte();
  operatorId=buffer.getUnsignedByte();
}

Fixed version (ground truth):
@Override public void read(IOBuffer buffer){
  super.read(buffer);
  state=buffer.getByte();
  orientation=BufferIO.readAngle(buffer);
  turretOrientation=BufferIO.readAngle(buffer);
  primaryWeaponState=buffer.getByte();
  secondaryWeaponState=buffer.getByte();
  operatorId=BufferIO.readPlayerId(buffer);
}
Program: 86602
Project: 86602
Buggy source:
@Override public void write(IOBuffer buffer){
  super.write(buffer);
  buffer.putByte(state);
  BufferIO.writeAngle(buffer,orientation);
  BufferIO.writeAngle(buffer,turretOrientation);
  buffer.putByte(primaryWeaponState);
  buffer.putByte(secondaryWeaponState);
  buffer.putUnsignedByte(operatorId);
}

Fixed version (ground truth):
@Override public void write(IOBuffer buffer){
  super.write(buffer);
  buffer.putByte(state);
  BufferIO.writeAngle(buffer,orientation);
  BufferIO.writeAngle(buffer,turretOrientation);
  buffer.putByte(primaryWeaponState);
  buffer.putByte(secondaryWeaponState);
  BufferIO.writePlayerId(buffer,operatorId);
}
Program: 86603
Project: 86603
Buggy source:
@Override public void read(IOBuffer buffer){
  id=BufferIO.readTeamId(buffer);
  hasPlayers=buffer.getBooleanBit();
  isAttacker=buffer.getBooleanBit();
  isDefender=!isAttacker;
  if (hasPlayers) {
    byte len=buffer.getByteBits(4);
    playerIds=new int[len];
    for (byte i=0; i < len; i++) {
      playerIds[i]=buffer.getUnsignedByte();
    }
  }
}

Fixed version (ground truth):
@Override public void read(IOBuffer buffer){
  id=BufferIO.readTeamId(buffer);
  hasPlayers=buffer.getBooleanBit();
  isAttacker=buffer.getBooleanBit();
  isDefender=!isAttacker;
  if (hasPlayers) {
    byte len=buffer.getByteBits(BufferIO.numPlayerIdBits());
    playerIds=new int[len];
    for (byte i=0; i < len; i++) {
      playerIds[i]=buffer.getUnsignedByte();
    }
  }
}
Program: 86604
Project: 86604
Buggy source:
@Override public void write(IOBuffer buffer){
  hasPlayers=playerIds != null && playerIds.length > 0;
  BufferIO.writeTeamId(buffer,id);
  buffer.putBooleanBit(hasPlayers);
  buffer.putBooleanBit(isAttacker);
  if (hasPlayers) {
    buffer.putByteBits((byte)playerIds.length,4);
    for (int i=0; i < playerIds.length; i++) {
      buffer.putUnsignedByte(playerIds[i]);
    }
  }
}

Fixed version (ground truth):
@Override public void write(IOBuffer buffer){
  hasPlayers=playerIds != null && playerIds.length > 0;
  BufferIO.writeTeamId(buffer,id);
  buffer.putBooleanBit(hasPlayers);
  buffer.putBooleanBit(isAttacker);
  if (hasPlayers) {
    buffer.putByteBits((byte)playerIds.length,BufferIO.numPlayerIdBits());
    for (int i=0; i < playerIds.length; i++) {
      buffer.putUnsignedByte(playerIds[i]);
    }
  }
}
Program: 86605
Project: 86605
Buggy source:
/** 
 * Enables/Disables weapon recoil (camera shaking)
 * @param recoilEnabled
 */
public void setWeaponRecoilEnabled(boolean recoilEnabled){
  this.config.set(recoilEnabled,KEYS[6]);
}

Fixed version (ground truth):
/** 
 * Enables/Disables weapon recoil (camera shaking)
 * @param recoilEnabled
 */
public void setWeaponRecoilEnabled(boolean recoilEnabled){
  this.config.set(recoilEnabled,KEYS[7]);
}
Program: 86606
Project: 86606
Buggy source:
/** 
 * Sets the camera offset for following the reticle
 * @param offset
 */
public void setFollowReticleOffset(float offset){
  this.config.set(offset,KEYS[9]);
}

Fixed version (ground truth):
/** 
 * Sets the camera offset for following the reticle
 * @param offset
 */
public void setFollowReticleOffset(float offset){
  this.config.set(offset,KEYS[10]);
}
Program: 86607
Project: 86607
Buggy source:
/** 
 * @return true if blood is shown
 */
public boolean getBloodEnabled(){
  return this.config.getBool(true,KEYS[7]);
}

Fixed version (ground truth):
/** 
 * @return true if blood is shown
 */
public boolean getBloodEnabled(){
  return this.config.getBool(true,KEYS[8]);
}
Program: 86608
Project: 86608
Buggy source:
/** 
 * @return true if the weapon shows weapon recoiling (camera shaking)
 */
public boolean getWeaponRecoilEnabled(){
  return this.config.getBool(true,KEYS[6]);
}

Fixed version (ground truth):
/** 
 * @return true if the weapon shows weapon recoiling (camera shaking)
 */
public boolean getWeaponRecoilEnabled(){
  return this.config.getBool(true,KEYS[7]);
}
Program: 86609
Project: 86609
Buggy source:
public boolean getFollowReticleEnabled(){
  return this.config.getBool(false,KEYS[8]);
}

Fixed version (ground truth):
public boolean getFollowReticleEnabled(){
  return this.config.getBool(false,KEYS[9]);
}
Program: 86610
Project: 86610
Buggy source:
/** 
 * Enables/Disables blood/guts
 * @param bloodEnabled
 */
public void setBloodEnabled(boolean bloodEnabled){
  this.config.set(bloodEnabled,KEYS[7]);
}

Fixed version (ground truth):
/** 
 * Enables/Disables blood/guts
 * @param bloodEnabled
 */
public void setBloodEnabled(boolean bloodEnabled){
  this.config.set(bloodEnabled,KEYS[8]);
}
Program: 86611
Project: 86611
Buggy source:
public void showDebugInfo(boolean show){
  this.config.set(show,KEYS[10]);
}

Fixed version (ground truth):
public void showDebugInfo(boolean show){
  this.config.set(show,KEYS[11]);
}
Program: 86612
Project: 86612
Buggy source:
/** 
 * @return The camera offset for following the reticle
 */
public float getFollowReticleOffset(){
  return this.config.getFloat(80f,KEYS[9]);
}

Fixed version (ground truth):
/** 
 * @return The camera offset for following the reticle
 */
public float getFollowReticleOffset(){
  return this.config.getFloat(80f,KEYS[10]);
}
Program: 86613
Project: 86613
Buggy source:
/** 
 * The in-game debug console background color
 * @return The in-game debug console background color
 */
public int getConsoleBackgroundColor(){
  return this.config.getInt(0x8f0000FF,KEYS[5]);
}

Fixed version (ground truth):
/** 
 * The in-game debug console background color
 * @return The in-game debug console background color
 */
public int getConsoleBackgroundColor(){
  return this.config.getInt(0x8f0000FF,KEYS[6]);
}
Program: 86614
Project: 86614
Buggy source:
public void setFollowReticleEnabled(boolean enabled){
  this.config.set(enabled,KEYS[8]);
}

Fixed version (ground truth):
public void setFollowReticleEnabled(boolean enabled){
  this.config.set(enabled,KEYS[9]);
}
Program: 86615
Project: 86615
Buggy source:
public void showFps(boolean show){
  this.config.set(show,KEYS[11]);
}

Fixed version (ground truth):
public void showFps(boolean show){
  this.config.set(show,KEYS[12]);
}
Program: 86616
Project: 86616
Buggy source:
/** 
 * The in-game debug console foreground color
 * @return The in-game debug console foreground color
 */
public int getConsoleForegroundColor(){
  return this.config.getInt(0xffFFFF00,KEYS[4]);
}

Fixed version (ground truth):
/** 
 * The in-game debug console foreground color
 * @return The in-game debug console foreground color
 */
public int getConsoleForegroundColor(){
  return this.config.getInt(0xffFFFF00,KEYS[5]);
}
Program: 86617
Project: 86617
Buggy source:
public static void init(ClientSeventhConfig cfg){
  try {
    Cons.println("String_Node_Str");
    Cons.getImpl().addCommand(getVolumeCommand());
    config=cfg;
    volume=config.getVolume();
    SoundSystemConfig.setMasterGain(volume);
    SoundSystemConfig.setLogger(new SoundSystemLogger(){
      @Override public void errorMessage(      String message,      String error,      int code){
        Cons.println("String_Node_Str" + message + "String_Node_Str"+ error+ "String_Node_Str"+ code);
      }
      @Override public void message(      String message,      int code){
        Cons.println("String_Node_Str" + message + "String_Node_Str"+ code);
      }
      @Override public void importantMessage(      String message,      int code){
        Cons.println("String_Node_Str" + message + "String_Node_Str"+ code);
      }
    }
);
    SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
    SoundSystemConfig.setCodec("String_Node_Str",CodecWav.class);
    SoundSystemConfig.setDefaultFadeDistance(10000f);
    soundSystem=new SoundSystem(LibraryLWJGLOpenAL.class);
    setVolume(volume);
    for (int i=0; i < channels.length; i++) {
      channels[i]=createChannel();
    }
    Cons.println("String_Node_Str");
  }
 catch (  SoundSystemException e) {
    Cons.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void init(ClientSeventhConfig cfg){
  try {
    Cons.println("String_Node_Str");
    Cons.getImpl().addCommand(getVolumeCommand());
    config=cfg;
    volume=config.getVolume();
    SoundSystemConfig.setMasterGain(volume);
    SoundSystemConfig.setLogger(new SoundSystemLogger(){
      @Override public void errorMessage(      String message,      String error,      int code){
        Cons.println("String_Node_Str" + message + "String_Node_Str"+ error+ "String_Node_Str"+ code);
      }
      @Override public void message(      String message,      int code){
        Cons.println("String_Node_Str" + message + "String_Node_Str"+ code);
      }
      @Override public void importantMessage(      String message,      int code){
        Cons.println("String_Node_Str" + message + "String_Node_Str"+ code);
      }
    }
);
    SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
    SoundSystemConfig.setCodec("String_Node_Str",CodecWav.class);
    SoundSystemConfig.setDefaultFadeDistance(10000f);
    SoundSystemConfig.setNumberNormalChannels(cfg.getNumberOfSoundChannels());
    soundSystem=new SoundSystem(LibraryLWJGLOpenAL.class);
    setVolume(volume);
    for (int i=0; i < channels.length; i++) {
      channels[i]=createChannel();
    }
    Cons.println("String_Node_Str");
  }
 catch (  SoundSystemException e) {
    Cons.println("String_Node_Str");
  }
}
Program: 86618
Project: 86618
Buggy source:
/** 
 * Loads any map scripts and/or special entities associated with the game map.  This should be invoked every time a new Round begins  
 */
private void loadMapScripts(){
  File propertiesFile=new File(gameMap.getMapFileName() + "String_Node_Str");
  if (propertiesFile.exists()) {
    try {
      Leola runtime=Scripting.newSandboxedRuntime();
      runtime.loadStatics(SeventhScriptingCommonLibrary.class);
      GameServerLeolaLibrary gLib=new GameServerLeolaLibrary(this);
      runtime.loadLibrary(gLib,"String_Node_Str");
      AILeolaLibrary aiLib=new AILeolaLibrary(this.aiSystem);
      runtime.loadLibrary(aiLib,"String_Node_Str");
      runtime.put("String_Node_Str",this);
      runtime.eval(propertiesFile);
      final Map map=getMap();
      Layer[] layers=map.getBackgroundLayers();
      for (int i=0; i < layers.length; i++) {
        Layer layer=layers[i];
        if (layer != null && layer.isLightLayer()) {
          layer.foreach(new LayerTileIterator(){
            @Override public void onTile(            Tile tile,            int x,            int y){
              if (tile != null) {
                LightBulb light=newLight(map.tileToWorld(x,y));
                light.setColor(0.9f,0.85f,0.85f);
                light.setLuminacity(0.95f);
              }
            }
          }
);
        }
      }
    }
 catch (    Exception e) {
      Cons.println("String_Node_Str" + propertiesFile.getName() + "String_Node_Str");
      Cons.println(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Loads any map scripts and/or special entities associated with the game map.  This should be invoked every time a new Round begins  
 */
private void loadMapScripts(){
  File propertiesFile=new File(gameMap.getMapFileName() + "String_Node_Str");
  if (propertiesFile.exists()) {
    try {
      this.eventRegistration.unregisterListeners();
      Leola runtime=Scripting.newSandboxedRuntime();
      runtime.loadStatics(SeventhScriptingCommonLibrary.class);
      GameServerLeolaLibrary gLib=new GameServerLeolaLibrary(this);
      runtime.loadLibrary(gLib,"String_Node_Str");
      AILeolaLibrary aiLib=new AILeolaLibrary(this.aiSystem);
      runtime.loadLibrary(aiLib,"String_Node_Str");
      runtime.put("String_Node_Str",this);
      runtime.eval(propertiesFile);
      final Map map=getMap();
      Layer[] layers=map.getBackgroundLayers();
      for (int i=0; i < layers.length; i++) {
        Layer layer=layers[i];
        if (layer != null && layer.isLightLayer()) {
          layer.foreach(new LayerTileIterator(){
            @Override public void onTile(            Tile tile,            int x,            int y){
              if (tile != null) {
                LightBulb light=newLight(map.tileToWorld(x,y));
                light.setColor(0.9f,0.85f,0.85f);
                light.setLuminacity(0.95f);
              }
            }
          }
);
        }
      }
    }
 catch (    Exception e) {
      Cons.println("String_Node_Str" + propertiesFile.getName() + "String_Node_Str");
      Cons.println(e);
    }
  }
}
Program: 86619
Project: 86619
Buggy source:
public void setTurretOrientationNow(float desiredOrientation){
  final float fullCircle=FastMath.fullCircle;
  if (desiredOrientation < 0) {
    desiredOrientation+=fullCircle;
  }
  this.turretOrientation=desiredOrientation;
}

Fixed version (ground truth):
public void setTurretOrientationNow(float desiredOrientation){
  final float fullCircle=FastMath.fullCircle;
  if (desiredOrientation < 0) {
    desiredOrientation+=fullCircle;
  }
  this.turretOrientation=desiredOrientation;
  this.desiredTurretOrientation=desiredOrientation;
}
Program: 86620
Project: 86620
Buggy source:
public void setOrientationNow(float desiredOrientation){
  final float fullCircle=FastMath.fullCircle;
  if (desiredOrientation < 0) {
    desiredOrientation+=fullCircle;
  }
  this.orientation=desiredOrientation;
  syncOOB(this.orientation,pos);
}

Fixed version (ground truth):
public void setOrientationNow(float desiredOrientation){
  final float fullCircle=FastMath.fullCircle;
  if (desiredOrientation < 0) {
    desiredOrientation+=fullCircle;
  }
  this.orientation=desiredOrientation;
  this.desiredOrientation=desiredOrientation;
  syncOOB(this.orientation,pos);
}
Program: 86621
Project: 86621
Buggy source:
/** 
 * @param dispatcher
 */
public EventRegistration(EventDispatcher dispatcher){
  this.dispatcher=dispatcher;
}

Fixed version (ground truth):
/** 
 * @param dispatcher
 */
public EventRegistration(EventDispatcher dispatcher){
  this.dispatcher=dispatcher;
  this.registeredListeners=new ArrayList<>();
}
Program: 86624
Project: 86624
Buggy source:
@Override public void update(TimeStep timeStep){
  ShaderProgram shader=this.shader.getShader();
  shader.begin();
{
    shader.setUniformi("String_Node_Str",1);
    shader.setUniformf("String_Node_Str",ambientColor.x,ambientColor.y,ambientColor.z,ambientIntensity);
    shader.setUniformf("String_Node_Str",SeventhGame.DEFAULT_MINIMIZED_SCREEN_WIDTH,SeventhGame.DEFAULT_MINIMIZED_SCREEN_HEIGHT);
  }
  shader.end();
  for (int i=0; i < this.lights.size(); i++) {
    Light light=this.lights.get(i);
    light.update(timeStep);
  }
}

Fixed version (ground truth):
@Override public void update(TimeStep timeStep){
  ShaderProgram shader=this.shader.getShader();
  shader.begin();
{
    shader.setUniformi("String_Node_Str",1);
    shader.setUniformf("String_Node_Str",ambientColor.x,ambientColor.y,ambientColor.z,ambientIntensity);
    shader.setUniformf("String_Node_Str",Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
  }
  shader.end();
  for (int i=0; i < this.lights.size(); i++) {
    Light light=this.lights.get(i);
    light.update(timeStep);
  }
}
Program: 86625
Project: 86625
Buggy source:
/** 
 * Adds an input listener to the front
 * @param inputs
 */
public void addInputToFront(Inputs inputs){
  this.inputs.addProcessor(0,inputs);
}

Fixed version (ground truth):
/** 
 * Adds an input listener to the front
 * @param inputs
 */
public void addInputToFront(Inputs inputs){
  this.inputs.removeProcessor(inputs);
  this.inputs.addProcessor(0,inputs);
}
Program: 86626
Project: 86626
Buggy source:
private void updateInputs(Screen previousScreen){
  if (previousScreen != null) {
    this.inputs.removeProcessor(previousScreen.getInputs());
  }
  Screen screen=this.sm.getCurrentState();
  if (screen != null) {
    Inputs inputs=screen.getInputs();
    this.inputs.addProcessor(inputs);
  }
}

Fixed version (ground truth):
private void updateInputs(Screen previousScreen){
  if (previousScreen != null) {
    removeInput(previousScreen.getInputs());
  }
  Screen screen=this.sm.getCurrentState();
  if (screen != null) {
    Inputs inputs=screen.getInputs();
    this.inputs.addProcessor(inputs);
  }
}
Program: 86627
Project: 86627
Buggy source:
/** 
 * Adds an input listener
 * @param inputs
 */
public void addInput(Inputs inputs){
  this.inputs.addProcessor(inputs);
}

Fixed version (ground truth):
/** 
 * Adds an input listener
 * @param inputs
 */
public void addInput(Inputs inputs){
  this.inputs.removeProcessor(inputs);
  this.inputs.addProcessor(inputs);
}
Program: 86628
Project: 86628
Buggy source:
private void dialogMenu(){
  if (getDialog().isOpen()) {
    app.removeInput(app.getUiManager());
    getDialog().close();
    Sounds.playGlobalSound(Sounds.uiNavigate);
  }
 else   if (!getSayTxtBx().isDisabled()) {
    hideTextBox(getSayTxtBx());
  }
 else   if (!getTeamSayTxtBx().isDisabled()) {
    hideTextBox(getTeamSayTxtBx());
  }
 else {
    createUI();
    Sounds.playGlobalSound(Sounds.uiNavigate);
  }
}

Fixed version (ground truth):
private void dialogMenu(){
  if (getDialog().isOpen()) {
    app.removeInput(app.getUiManager());
    getDialog().close();
    Sounds.playGlobalSound(Sounds.uiNavigate);
  }
 else   if (!getSayTxtBx().isDisabled()) {
    hideTextBox(getSayTxtBx());
  }
 else   if (!getTeamSayTxtBx().isDisabled()) {
    hideTextBox(getTeamSayTxtBx());
  }
 else {
    createDialogUI();
    Sounds.playGlobalSound(Sounds.uiNavigate);
  }
}
Program: 86630
Project: 86630
Buggy source:
private void createUI(){
  if (this.dialog != null) {
    this.dialog.destroy();
  }
  this.aiShortcutsMenu.hide();
  this.dialog=new InGameOptionsDialog(app.getConsole(),connection,app.getTheme());
  this.dialog.setOnHide(new OnHideListener(){
    @Override public void onShow(){
      game.activateCamera(false);
      uiManager.menuCursor();
    }
    @Override public void onHide(){
      game.activateCamera(true);
      uiManager.gameCursor();
    }
  }
);
  ClientPlayer player=game.getLocalPlayer();
  if (player != null) {
    this.dialog.setTeam(player.getTeam());
  }
  this.dialog.show();
  this.dialog.setBounds(new Rectangle(0,0,400,380));
  this.dialog.getBounds().centerAround(new Vector2f(app.getScreenWidth() / 2,app.getScreenHeight() / 2));
  this.dialog.getLeaveGameBtn().addOnButtonClickedListener(new OnButtonClickedListener(){
    @Override public void onButtonClicked(    ButtonEvent event){
      connection.disconnect();
      app.getConsole().execute("String_Node_Str");
      app.goToMenuScreen();
    }
  }
);
  this.dialog.getOptions().addOnButtonClickedListener(new OnButtonClickedListener(){
    @Override public void onButtonClicked(    ButtonEvent event){
      app.pushScreen(new OptionsScreen(app));
    }
  }
);
  this.dialogView=new InGameOptionsDialogView(dialog);
  if (this.sayTxtBx != null) {
    this.sayTxtBx.destroy();
  }
  this.sayTxtBx=new TextBox();
  this.sayTxtBx.setLabelText("String_Node_Str");
  this.sayTxtBxView=new TextBoxView(sayTxtBx);
  setupTextbox(sayTxtBx);
  if (this.teamSayTxtBx != null) {
    this.teamSayTxtBx.destroy();
  }
  this.teamSayTxtBx=new TextBox();
  this.teamSayTxtBx.setLabelText("String_Node_Str");
  this.teamSayTxtBxView=new TextBoxView(teamSayTxtBx);
  setupTextbox(teamSayTxtBx);
  this.app.addInputToFront(app.getUiManager());
}

Fixed version (ground truth):
private void createUI(){
  createSayBoxesUI();
  createDialogUI();
}
Program: 86631
Project: 86631
Buggy source:
/** 
 */
public InGameScreen(final SeventhGame app,final ClientGame game){
  this.app=app;
  this.game=game;
  this.connection=app.getClientConnection();
  this.uiManager=app.getUiManager();
  this.inputMessage=new PlayerInputMessage();
  this.keyMap=app.getKeyMap();
  this.isDebugMode=false;
  this.debugEffects=new Effects();
  this.cursor=app.getUiManager().getCursor();
  List<AIShortcut> commands=new ArrayList<AIShortcut>();
  commands.add(new FollowMeAIShortcut(Keys.P));
  commands.add(new SurpressFireAIShortcut(Keys.O));
  commands.add(new MoveToAIShortcut(Keys.I));
  commands.add(new PlantBombAIShortcut(Keys.J));
  commands.add(new DefuseBombAIShortcut(Keys.K));
  commands.add(new DefendPlantedBombAIShortcut(Keys.L));
  commands.add(new TakeCoverAIShortcut(Keys.U));
  this.aiShortcuts=new AIShortcuts(this.keyMap,commands,commands.get(2),commands.get(1));
  this.aiShortcutsMenu=new AIShortcutsMenu(game,keyMap,aiShortcuts);
  createUI();
  this.controllerInput=new JoystickGameController();
}

Fixed version (ground truth):
/** 
 */
public InGameScreen(final SeventhGame app,final ClientGame game){
  this.app=app;
  this.game=game;
  this.connection=app.getClientConnection();
  this.uiManager=app.getUiManager();
  this.inputMessage=new PlayerInputMessage();
  this.keyMap=app.getKeyMap();
  this.isDebugMode=false;
  this.debugEffects=new Effects();
  this.cursor=app.getUiManager().getCursor();
  List<AIShortcut> commands=new ArrayList<AIShortcut>();
  commands.add(new FollowMeAIShortcut(Keys.P));
  commands.add(new SurpressFireAIShortcut(Keys.O));
  commands.add(new MoveToAIShortcut(Keys.I));
  commands.add(new PlantBombAIShortcut(Keys.J));
  commands.add(new DefuseBombAIShortcut(Keys.K));
  commands.add(new DefendPlantedBombAIShortcut(Keys.L));
  commands.add(new TakeCoverAIShortcut(Keys.U));
  this.aiShortcuts=new AIShortcuts(this.keyMap,commands,commands.get(2),commands.get(1));
  this.aiShortcutsMenu=new AIShortcutsMenu(game,keyMap,aiShortcuts);
  this.controllerInput=new JoystickGameController();
  createUI();
}
Program: 86633
Project: 86633
Buggy source:
@Override public void destroy(){
}

Fixed version (ground truth):
@Override public void destroy(){
  this.optionsPanel.destroy();
}
Program: 86634
Project: 86634
Buggy source:
@Override public void exit(){
  this.optionsPanel.hide();
}

Fixed version (ground truth):
@Override public void exit(){
  this.optionsPanel.destroy();
}
Program: 86635
Project: 86635
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args) throws Exception {
  ClientSeventhConfig config=null;
  try {
    Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler(){
      @Override public void uncaughtException(      Thread t,      Throwable e){
        if (t.getName().equals("String_Node_Str")) {
          catchException(e);
        }
      }
    }
);
    config=loadConfig();
    VideoConfig vConfig=config.getVideo();
    DisplayMode displayMode=findBestDimensions(vConfig);
    LwjglApplicationConfiguration.disableAudio=true;
    LwjglApplicationConfiguration cfg=new LwjglApplicationConfiguration();
    cfg.setFromDisplayMode(displayMode);
    cfg.fullscreen=vConfig.isFullscreen();
    cfg.title="String_Node_Str" + SeventhGame.getVersion();
    cfg.forceExit=true;
    cfg.resizable=false;
    cfg.useGL30=vConfig.useGL30();
    cfg.vSyncEnabled=vConfig.isVsync();
    if (!cfg.fullscreen) {
      cfg.width=1024;
      cfg.height=768;
    }
    new LwjglApplication(new SeventhGame(config),cfg);
  }
 catch (  Exception e) {
    catchException(e);
  }
 finally {
    if (config != null) {
    }
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args) throws Exception {
  ClientSeventhConfig config=null;
  try {
    Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler(){
      @Override public void uncaughtException(      Thread t,      Throwable e){
        if (t.getName().equals("String_Node_Str")) {
          catchException(e);
        }
      }
    }
);
    config=loadConfig();
    VideoConfig vConfig=config.getVideo();
    DisplayMode displayMode=findBestDimensions(vConfig);
    LwjglApplicationConfiguration.disableAudio=true;
    LwjglApplicationConfiguration cfg=new LwjglApplicationConfiguration();
    cfg.setFromDisplayMode(displayMode);
    cfg.fullscreen=vConfig.isFullscreen();
    cfg.title="String_Node_Str" + SeventhGame.getVersion();
    cfg.forceExit=true;
    cfg.resizable=false;
    cfg.useGL30=vConfig.useGL30();
    cfg.vSyncEnabled=vConfig.isVsync();
    if (!cfg.fullscreen) {
      cfg.width=840;
      cfg.height=480;
    }
    new LwjglApplication(new SeventhGame(config),cfg);
  }
 catch (  Exception e) {
    catchException(e);
  }
 finally {
    if (config != null) {
    }
  }
}
Program: 86636
Project: 86636
Buggy source:
public void drawLine(float x1,float y1,float x2,float y2,Integer color);

Fixed version (ground truth):
public void drawLine(float x1,float y1,float x2,float y2,Integer color,float thickness);
Program: 86637
Project: 86637
Buggy source:
/** 
 * Retrieve the desired font and size (may load the font if not cached).
 * @param alias
 * @param size
 * @return the font
 */
private BitmapFont getFont(String alias,int size){
  BitmapFont font=null;
  String mask=alias + "String_Node_Str" + size;
  if (this.fonts.containsKey(mask)) {
    font=this.fonts.get(mask);
  }
 else   if (this.generators.containsKey(alias)) {
    FreeTypeFontParameter params=new FreeTypeFontParameter();
    params.size=size;
    params.characters=FreeTypeFontGenerator.DEFAULT_CHARS;
    params.flip=true;
    font=this.generators.get(alias).generateFont(params);
    this.fonts.put(mask,font);
  }
  return font;
}

Fixed version (ground truth):
/** 
 * Retrieve the desired font and size (may load the font if not cached).
 * @param alias
 * @param size
 * @return the font
 */
private BitmapFont getFont(String alias,int size){
  BitmapFont font=null;
  String mask=alias + "String_Node_Str" + size;
  if (this.fonts.containsKey(mask)) {
    font=this.fonts.get(mask);
  }
 else   if (this.generators.containsKey(alias)) {
    FreeTypeFontParameter params=new FreeTypeFontParameter();
    params.size=size;
    params.characters=FreeTypeFontGenerator.DEFAULT_CHARS;
    params.flip=true;
    params.magFilter=TextureFilter.Linear;
    params.minFilter=TextureFilter.Linear;
    font=this.generators.get(alias).generateFont(params);
    this.fonts.put(mask,font);
  }
  return font;
}
Program: 86638
Project: 86638
Buggy source:
@Override public void drawLine(float x1,float y1,float x2,float y2,Integer color){
  Color c=setTempColor(color);
  Gdx.gl.glEnable(GL20.GL_BLEND);
  Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA,GL20.GL_ONE_MINUS_SRC_ALPHA);
  this.shapes.setColor(c);
  this.shapes.begin(ShapeType.Line);
  this.shapes.line(x1,y1,x2,y2);
  this.shapes.end();
  Gdx.gl.glDisable(GL20.GL_BLEND);
}

Fixed version (ground truth):
@Override public void drawLine(float x1,float y1,float x2,float y2,Integer color,float thickness){
  Color c=setTempColor(color);
  Gdx.gl.glEnable(GL20.GL_BLEND);
  Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA,GL20.GL_ONE_MINUS_SRC_ALPHA);
  Gdx.gl.glLineWidth(thickness);
  this.shapes.setColor(c);
  this.shapes.begin(ShapeType.Line);
  this.shapes.line(x1,y1,x2,y2);
  this.shapes.end();
  Gdx.gl.glDisable(GL20.GL_BLEND);
}
Program: 86640
Project: 86640
Buggy source:
/** 
 */
public InGameOptionsDialog(Console console,ClientConnection network,Theme theme){
  super(new EventDispatcher());
  this.theme=theme;
  this.weaponDialog=new WeaponClassDialog(this,network,theme);
  this.weaponDialog.setBounds(new Rectangle(400,680));
  this.weaponDialog.hide();
  this.switchTeamDialog=new SwitchTeamDialog(this,console,theme);
  this.switchTeamDialog.setBounds(new Rectangle(400,380));
  this.switchTeamDialog.hide();
  createUI();
}

Fixed version (ground truth):
/** 
 */
public InGameOptionsDialog(Console console,ClientConnection network,Theme theme){
  super(new EventDispatcher());
  this.theme=theme;
  this.weaponDialog=new WeaponClassDialog(this,network,theme);
  this.weaponDialog.setBounds(new Rectangle(400,440));
  this.weaponDialog.hide();
  this.switchTeamDialog=new SwitchTeamDialog(this,console,theme);
  this.switchTeamDialog.setBounds(new Rectangle(400,380));
  this.switchTeamDialog.hide();
  createUI();
}
Program: 86643
Project: 86643
Buggy source:
private Button setupButton(Vector2f pos,final Type type){
  final Button btn=new Button();
  btn.setBounds(new Rectangle((int)pos.x,(int)pos.y,320,70));
  btn.setBorder(false);
  btn.addOnButtonClickedListener(new OnButtonClickedListener(){
    @Override public void onButtonClicked(    ButtonEvent event){
      if (connection.isConnected()) {
        PlayerSwitchWeaponClassMessage msg=new PlayerSwitchWeaponClassMessage();
        msg.weaponType=type;
        connection.getClientProtocol().sendPlayerSwitchWeaponClassMessage(msg);
      }
      owner.close();
    }
  }
);
  addWidget(btn);
  return btn;
}

Fixed version (ground truth):
private Button setupButton(Vector2f pos,final Type type){
  final Button btn=new Button();
  btn.setBounds(new Rectangle((int)pos.x,(int)pos.y,320,40));
  btn.setBorder(false);
  btn.addOnButtonClickedListener(new OnButtonClickedListener(){
    @Override public void onButtonClicked(    ButtonEvent event){
      if (connection.isConnected()) {
        PlayerSwitchWeaponClassMessage msg=new PlayerSwitchWeaponClassMessage();
        msg.weaponType=type;
        connection.getClientProtocol().sendPlayerSwitchWeaponClassMessage(msg);
      }
      owner.close();
    }
  }
);
  addWidget(btn);
  return btn;
}
Program: 86644
Project: 86644
Buggy source:
private Label setupLabel(Vector2f pos,final Type type){
  Label lbl=new Label(this.getClassDescription(type));
  lbl.setBounds(new Rectangle((int)pos.x + 80,(int)pos.y + 5,220,80));
  lbl.setTextSize(14);
  lbl.setForegroundColor(this.theme.getForegroundColor());
  lbl.setShadow(false);
  lbl.setFont("String_Node_Str");
  lbl.setHorizontalTextAlignment(TextAlignment.LEFT);
  lbl.setVerticalTextAlignment(TextAlignment.TOP);
  lbl.hide();
  addWidget(lbl);
  return lbl;
}

Fixed version (ground truth):
private Label setupLabel(Vector2f pos,final Type type){
  Label lbl=new Label(this.getClassDescription(type));
  lbl.setBounds(new Rectangle((int)pos.x + 80,(int)pos.y,220,60));
  lbl.setTextSize(12);
  lbl.setForegroundColor(this.theme.getForegroundColor());
  lbl.setShadow(false);
  lbl.setFont("String_Node_Str");
  lbl.setHorizontalTextAlignment(TextAlignment.LEFT);
  lbl.setVerticalTextAlignment(TextAlignment.TOP);
  lbl.hide();
  addWidget(lbl);
  return lbl;
}
Program: 86645
Project: 86645
Buggy source:
private void createUI(){
  destroyChildren();
  Rectangle bounds=getBounds();
  this.title=new Label("String_Node_Str");
  this.title.setTheme(theme);
  this.title.setBounds(new Rectangle(bounds));
  this.title.getBounds().height=30;
  this.title.getBounds().y+=30;
  this.title.setFont(theme.getSecondaryFontName());
  this.title.setHorizontalTextAlignment(TextAlignment.CENTER);
  this.title.setTextSize(28);
  refreshButtons();
  this.cancel=new Button();
  this.cancel.setText("String_Node_Str");
  this.cancel.setBounds(new Rectangle(0,0,100,40));
  this.cancel.getBounds().centerAround(bounds.x + 205,bounds.y + bounds.height - 20);
  this.cancel.setEnableGradiant(false);
  this.cancel.setTheme(theme);
  this.cancel.getTextLabel().setFont(theme.getSecondaryFontName());
  this.cancel.getTextLabel().setForegroundColor(theme.getForegroundColor());
  this.cancel.setTextSize(22);
  this.cancel.setHoverTextSize(26);
  this.cancel.addOnButtonClickedListener(new OnButtonClickedListener(){
    @Override public void onButtonClicked(    ButtonEvent event){
      owner.close();
    }
  }
);
  addWidget(cancel);
  addWidget(title);
}

Fixed version (ground truth):
private void createUI(){
  destroyChildren();
  Rectangle bounds=getBounds();
  this.title=new Label("String_Node_Str");
  this.title.setTheme(theme);
  this.title.setBounds(new Rectangle(bounds));
  this.title.getBounds().height=15;
  this.title.getBounds().y+=20;
  this.title.setFont(theme.getSecondaryFontName());
  this.title.setHorizontalTextAlignment(TextAlignment.CENTER);
  this.title.setTextSize(22);
  refreshButtons();
  this.cancel=new Button();
  this.cancel.setText("String_Node_Str");
  this.cancel.setBounds(new Rectangle(0,0,100,40));
  this.cancel.getBounds().centerAround(bounds.x + 205,bounds.y + bounds.height - 10);
  this.cancel.setEnableGradiant(false);
  this.cancel.setTheme(theme);
  this.cancel.getTextLabel().setFont(theme.getSecondaryFontName());
  this.cancel.getTextLabel().setForegroundColor(theme.getForegroundColor());
  this.cancel.setTextSize(22);
  this.cancel.setHoverTextSize(26);
  this.cancel.addOnButtonClickedListener(new OnButtonClickedListener(){
    @Override public void onButtonClicked(    ButtonEvent event){
      owner.close();
    }
  }
);
  addWidget(cancel);
  addWidget(title);
}
Program: 86647
Project: 86647
Buggy source:
private TextureRegion scale(TextureRegion tex){
  TextureRegion sprite=new TextureRegion(tex);
  sprite.setRegionWidth(350);
  return sprite;
}

Fixed version (ground truth):
private TextureRegion scale(TextureRegion tex){
  Sprite sprite=new Sprite(tex);
  sprite.setSize(110,45);
  return sprite;
}
Program: 86649
Project: 86649
Buggy source:
@Override public void onRoundStarted(RoundStartedEvent event){
  for (  Tile tile : map.getRemovedTiles()) {
    graph.removeNode(tile.getXIndex(),tile.getYIndex());
  }
  map.restoreDestroyedTiles();
  loadMapScripts();
  aiSystem.startOfRound(Game.this);
}

Fixed version (ground truth):
@Override public void onRoundStarted(RoundStartedEvent event){
  for (int i=MAX_PLAYERS; i < deadFrames.length; i++) {
    deadFrames[i]=999;
  }
  for (  Tile tile : map.getRemovedTiles()) {
    graph.removeNode(tile.getXIndex(),tile.getYIndex());
  }
  map.restoreDestroyedTiles();
  loadMapScripts();
  aiSystem.startOfRound(Game.this);
}
Program: 86651
Project: 86651
Buggy source:
/** 
 * Calculates the next valid ID.  If there are no entity slots available,  this will create room by destroying a volatile object.
 * @return a valid id.
 */
public int getNextEntityId(){
  lastValidId=0;
  for (int i=MAX_PLAYERS + MAX_PERSISTANT_ENTITIES + lastValidId; i < MAX_ENTITIES; i++) {
    if (entities[i] == null && deadFrames[i] > 10) {
      lastValidId++;
      return i;
    }
  }
  for (int i=MAX_PLAYERS; i < MAX_ENTITIES; i++) {
    Entity ent=entities[i];
    if (ent != null) {
      Type type=ent.getType();
      if (type == Type.DROPPED_ITEM || type == Type.BULLET) {
        ent.softKill();
        return i;
      }
    }
  }
  return MAX_PLAYERS;
}

Fixed version (ground truth):
/** 
 * Calculates the next valid ID.  If there are no entity slots available,  this will create room by destroying a volatile object.
 * @return a valid id.
 */
public int getNextEntityId(){
  lastValidId=0;
  for (int i=MAX_PLAYERS + MAX_PERSISTANT_ENTITIES + lastValidId; i < MAX_ENTITIES; i++) {
    if (entities[i] == null && deadFrames[i] > 10) {
      lastValidId++;
      return i;
    }
  }
  for (int i=MAX_PLAYERS; i < MAX_ENTITIES; i++) {
    Entity ent=entities[i];
    if (ent != null) {
      Type type=ent.getType();
      if (type == Type.DROPPED_ITEM || type == Type.BULLET) {
        ent.softKill();
        return i;
      }
    }
  }
  return MAX_ENTITIES - 1;
}
Program: 86655
Project: 86655
Buggy source:
@Override public void updateState(NetEntity state,long time){
  super.updateState(state,time);
  NetBullet bullet=(NetBullet)state;
  if (this.ownerId < 0) {
    emitBulletCasing(bullet.ownerId);
  }
  this.ownerId=bullet.ownerId;
  if (vel.isZero()) {
{
      Vector2f.Vector2fSubtract(getPos(),getOrigin(),vel);
      Vector2f.Vector2fNormalize(vel,vel);
      facing.set(vel);
      movementDir.set(vel);
    }
  }
}

Fixed version (ground truth):
@Override public void updateState(NetEntity state,long time){
  super.updateState(state,time);
  NetBullet bullet=(NetBullet)state;
  if (this.ownerId < 0) {
    emitBulletCasing(bullet.ownerId);
  }
  this.ownerId=bullet.ownerId;
  this.iterations++;
  if (vel.isZero()) {
{
      Vector2f.Vector2fSubtract(getPos(),getOrigin(),vel);
      Vector2f.Vector2fNormalize(vel,vel);
      facing.set(vel);
      movementDir.set(vel);
    }
  }
}
Program: 86656
Project: 86656
Buggy source:
@Override public void reset(){
  super.reset();
  origin.zeroOut();
  vel.zeroOut();
  ownerId=-1;
  lastUpdate=0;
  prevState=null;
  nextState=null;
  trailEffect.reset();
}

Fixed version (ground truth):
@Override public void reset(){
  super.reset();
  origin.zeroOut();
  vel.zeroOut();
  ownerId=-1;
  lastUpdate=0;
  prevState=null;
  nextState=null;
  iterations=0;
  trailEffect.reset();
}
Program: 86657
Project: 86657
Buggy source:
@Override public void render(Canvas canvas,Camera camera,float alpha){
  trailEffect.render(canvas,camera,alpha);
}

Fixed version (ground truth):
@Override public void render(Canvas canvas,Camera camera,float alpha){
  if (iterations > 2) {
    trailEffect.render(canvas,camera,alpha);
  }
}