nus-yam/ex-repair huggingface dataset:
Program: 86722
Project: 86722
Buggy source:
@Override public Action getAction(Squad squad){
  if (squad.squadSize() > 0) {
    World world=squad.getWorld();
    Brain[] members=squad.getMembers();
    Roles roles=squad.getRoles();
    int squadSize=squad.squadSize();
    if (!directionsToDefend.isEmpty() && squadSize > 0) {
      int increment=1;
      if (directionsToDefend.size() > squadSize) {
        increment=directionsToDefend.size() / squadSize;
      }
      int i=0;
      for (int j=0; j < members.length; j++) {
        Brain member=members[j];
        if (member != null) {
{
            AttackDirection dir=directionsToDefend.get((i+=increment) % directionsToDefend.size());
            Vector2f position=new Vector2f(dir.getDirection());
            return (world.getGoals().guard(position));
          }
        }
      }
    }
  }
  return new WaitAction(500);
}

Fixed version (ground truth):
@Override public Action getAction(Squad squad){
  if (squad.squadSize() > 0) {
    World world=squad.getWorld();
    Brain[] members=squad.getMembers();
    int squadSize=squad.squadSize();
    if (!directionsToDefend.isEmpty() && squadSize > 0) {
      int increment=1;
      if (directionsToDefend.size() > squadSize) {
        increment=directionsToDefend.size() / squadSize;
      }
      int i=0;
      for (int j=0; j < members.length; j++) {
        Brain member=members[j];
        if (member != null) {
{
            AttackDirection dir=directionsToDefend.get((i+=increment) % directionsToDefend.size());
            Vector2f position=new Vector2f(dir.getDirection());
            return (world.getGoals().guard(position));
          }
        }
      }
    }
  }
  return new WaitAction(500);
}
Program: 86723
Project: 86723
Buggy source:
@Override public void start(Brain brain){
  List<AttackDirection> attackDirs=brain.getWorld().getAttackDirections(brain.getEntityOwner());
  this.getActionResult().setSuccess(attackDirs);
}

Fixed version (ground truth):
@Override public void start(Brain brain){
  List<AttackDirection> attackDirs=new ArrayList<>(brain.getWorld().getAttackDirections(brain.getEntityOwner()));
  this.getActionResult().setSuccess(attackDirs);
}
Program: 86724
Project: 86724
Buggy source:
public void drop(){
  if (isBeingCarried()) {
    Vector2f flagPos=new Vector2f(this.carriedBy.getFacing());
    Vector2f.Vector2fMA(this.carriedBy.getCenterPos(),flagPos,40,flagPos);
    if (game.getMap().pointCollides((int)flagPos.x,(int)flagPos.y)) {
      flagPos=this.carriedBy.getCenterPos();
    }
    this.pos.set(flagPos);
    this.bounds.centerAround(this.pos);
    this.carriedBy.dropFlag();
    game.emitSound(getId(),SoundType.WEAPON_DROPPED,flagPos);
    this.resetTimer.reset();
    this.resetTimer.start();
  }
  this.carriedBy=null;
}

Fixed version (ground truth):
public void drop(){
  if (isBeingCarried()) {
    Vector2f flagPos=new Vector2f(this.carriedBy.getFacing());
    Vector2f.Vector2fMA(this.carriedBy.getCenterPos(),flagPos,40,flagPos);
    if (game.getMap().pointCollides((int)flagPos.x,(int)flagPos.y)) {
      flagPos.set(this.carriedBy.getCenterPos());
    }
    this.pos.set(flagPos);
    this.bounds.centerAround(this.pos);
    this.carriedBy.dropFlag();
    game.emitSound(getId(),SoundType.WEAPON_DROPPED,flagPos);
    this.resetTimer.reset();
    this.resetTimer.start();
  }
  this.carriedBy=null;
}
Program: 86725
Project: 86725
Buggy source:
@Override public void update(TimeStep timeStep){
  Vector2f.Vector2fCopy(this.pos,previousPos);
  if (this.updateReceived) {
    previousLastUpdate=lastUpdate;
    lastUpdate=timeStep.getGameClock();
    updateReceived=false;
  }
  interpolate(timeStep);
  if (onUpdate != null) {
    onUpdate.onUpdate(timeStep,this);
  }
}

Fixed version (ground truth):
@Override public void update(TimeStep timeStep){
  Vector2f.Vector2fCopy(this.pos,previousPos);
  if (attachedSounds != null) {
    updateSounds(attachedSounds);
  }
  if (this.updateReceived) {
    previousLastUpdate=lastUpdate;
    lastUpdate=timeStep.getGameClock();
    updateReceived=false;
  }
  interpolate(timeStep);
  if (onUpdate != null) {
    onUpdate.onUpdate(timeStep,this);
  }
}
Program: 86726
Project: 86726
Buggy source:
/** 
 * Reset's this object so that it can be reused  again by the engine.
 */
public void reset(){
  this.isDestroyed=false;
  this.isAlive=true;
  this.previousPos.zeroOut();
  this.renderPos.zeroOut();
  this.pos.zeroOut();
  this.facing.zeroOut();
  this.centerPos.zeroOut();
  this.movementDir.zeroOut();
  this.bounds.setLocation(this.pos);
}

Fixed version (ground truth):
/** 
 * Reset's this object so that it can be reused  again by the engine.
 */
public void reset(){
  this.isDestroyed=false;
  this.isAlive=true;
  this.previousPos.zeroOut();
  this.renderPos.zeroOut();
  this.pos.zeroOut();
  this.facing.zeroOut();
  this.centerPos.zeroOut();
  this.movementDir.zeroOut();
  this.bounds.setLocation(this.pos);
  if (this.attachedSounds != null) {
    for (int i=0; i < this.attachedSounds.length; i++) {
      this.attachedSounds[i]=null;
    }
  }
}
Program: 86728
Project: 86728
Buggy source:
/** 
 * @return true if the flag is at its home base
 */
public boolean isAtHomeBase(){
  return Vector2f.Vector2fEquals(this.pos,getSpawnLocation());
}

Fixed version (ground truth):
/** 
 * @return true if the flag is at its home base
 */
public boolean isAtHomeBase(){
  return Vector2f.Vector2fApproxEquals(this.pos,getSpawnLocation());
}
Program: 86729
Project: 86729
Buggy source:
public void addDroppedPacket(int numberOfPackets){
  this.numberOfDroppedPackets+=numberOfDroppedPackets;
}

Fixed version (ground truth):
public void addDroppedPacket(int numberOfPackets){
  this.numberOfDroppedPackets+=numberOfPackets;
}
Program: 86730
Project: 86730
Buggy source:
/** 
 * Gets a subImage.
 * @param image
 * @param x
 * @param y
 * @param width
 * @param height
 * @return
 */
public static TextureRegion subImage(TextureRegion image,int x,int y,int width,int height){
  return new TextureRegion(image,x,y,width,height);
}

Fixed version (ground truth):
/** 
 * Gets a subImage.
 * @param image
 * @param x
 * @param y
 * @param width
 * @param height
 * @return
 */
public static TextureRegion subImage(TextureRegion image,int x,int y,int width,int height){
  return new TextureRegion(image.getTexture(),x,y,width,height);
}
Program: 86732
Project: 86732
Buggy source:
/** 
 * Loads a game type
 * @param mapFile
 * @param script
 * @return the {@link GameType}
 * @throws Exception
 */
private GameType loadGameType(String mapFile,AbstractGameTypeScript script) throws Exception {
  ServerSeventhConfig config=this.serverContext.getConfig();
  int maxKills=config.getMaxScore();
  long matchTime=config.getMatchTime();
  return script.loadGameType(mapFile,maxKills,matchTime);
}

Fixed version (ground truth):
/** 
 * Loads a game type
 * @param mapFile
 * @param script
 * @return the {@link GameType}
 * @throws Exception
 */
private GameType loadGameType(String mapFile,AbstractGameTypeScript script) throws Exception {
  ServerSeventhConfig config=this.serverContext.getConfig();
  int maxKills=config.getMaxScore();
  long matchTime=config.getMatchTime() * 60L * 1000L;
  return script.loadGameType(mapFile,maxKills,matchTime);
}
Program: 86733
Project: 86733
Buggy source:
/** 
 * @return the match time -- the max amount of time a match should last
 */
public long getMatchTime(){
  return this.config.getInt(20,"String_Node_Str") * 60 * 1000L;
}

Fixed version (ground truth):
/** 
 * @return the match time -- the max amount of time a match should last
 */
public long getMatchTime(){
  return this.config.getInt(20,"String_Node_Str");
}
Program: 86735
Project: 86735
Buggy source:
/** 
 * @param type the type of tank
 */
public NetTank(Type type){
  this.type=type.netValue();
}

Fixed version (ground truth):
/** 
 * @param type the type of tank
 */
public NetTank(Type type){
  this.type=type.netValue();
  this.operatorId=SeventhConstants.INVALID_PLAYER_ID;
}
Program: 86736
Project: 86736
Buggy source:
@Override public NetEntity getNetEntity(){
  super.setNetEntity(netTank);
  netTank.state=getCurrentState().netValue();
  netTank.operatorId=hasOperator() ? this.getOperator().getId() : 0;
  netTank.turretOrientation=(short)Math.toDegrees(turretOrientation);
  netTank.primaryWeaponState=primaryWeapon.getState().netValue();
  netTank.secondaryWeaponState=secondaryWeapon.getState().netValue();
  return netTank;
}

Fixed version (ground truth):
@Override public NetEntity getNetEntity(){
  super.setNetEntity(netTank);
  netTank.state=getCurrentState().netValue();
  netTank.operatorId=hasOperator() ? this.getOperator().getId() : SeventhConstants.INVALID_PLAYER_ID;
  netTank.turretOrientation=(short)Math.toDegrees(turretOrientation);
  netTank.primaryWeaponState=primaryWeapon.getState().netValue();
  netTank.secondaryWeaponState=secondaryWeapon.getState().netValue();
  return netTank;
}
Program: 86738
Project: 86738
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(){
  while (isActive.get()) {
    try {
      WatchKey key=watchService.take();
      if (key.isValid()) {
        List<WatchEvent<?>> events=key.pollEvents();
        for (int i=0; i < events.size(); i++) {
          WatchEvent<?> event=events.get(i);
          WatchEvent.Kind<?> kind=event.kind();
          if (kind == StandardWatchEventKinds.OVERFLOW) {
            continue;
          }
          WatchEvent<Path> ev=(WatchEvent<Path>)event;
          Path filename=ev.context();
          WatchedAsset<?> watchedAsset=watchedAssets.get(new File(pathToWatch.toFile(),filename.toString()));
          if (watchedAsset != null) {
            try {
              watchedAsset.onAssetChanged();
            }
 catch (            IOException e) {
              e.printStackTrace();
            }
          }
        }
      }
      key.reset();
    }
 catch (    InterruptedException e) {
      break;
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  while (isActive.get()) {
    try {
      WatchKey key=watchService.take();
      if (key.isValid()) {
        List<WatchEvent<?>> events=key.pollEvents();
        for (int i=0; i < events.size(); i++) {
          WatchEvent<?> event=events.get(i);
          WatchEvent.Kind<?> kind=event.kind();
          if (kind == StandardWatchEventKinds.OVERFLOW) {
            continue;
          }
          WatchEvent<Path> ev=(WatchEvent<Path>)event;
          Path filename=ev.context();
          WatchedAsset<?> watchedAsset=watchedAssets.get(new File(pathToWatch.toFile(),filename.toString()));
          if (watchedAsset != null) {
            try {
              watchedAsset.onAssetChanged();
            }
 catch (            IOException e) {
              e.printStackTrace();
            }
          }
        }
      }
      key.reset();
    }
 catch (    ClosedWatchServiceException e) {
      break;
    }
catch (    InterruptedException e) {
      break;
    }
  }
}
Program: 86739
Project: 86739
Buggy source:
/** 
 */
public InGameScreen(final SeventhGame app,final ClientGame game){
  this.app=app;
  this.connection=app.getClientConnection();
  this.game=game;
  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(commands);
  this.aiShortcutsMenu=new AIShortcutsMenu(keyMap,aiShortcuts);
  createUI();
  this.controllerInput=new JoystickGameController();
  Controllers.addListener(this.controllerInput);
}

Fixed version (ground truth):
/** 
 */
public InGameScreen(final SeventhGame app,final ClientGame game){
  this.app=app;
  this.connection=app.getClientConnection();
  this.game=game;
  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(commands);
  this.aiShortcutsMenu=new AIShortcutsMenu(keyMap,aiShortcuts);
  createUI();
  this.controllerInput=new JoystickGameController();
}
Program: 86741
Project: 86741
Buggy source:
public void roundEnded(RoundEndedMessage msg){
  this.roundEnded=true;
  applyGameStats(msg.stats);
  scoreboard.setWinner(ClientTeam.fromId(msg.winnerTeamId));
  showScoreBoard(true);
}

Fixed version (ground truth):
public void roundEnded(RoundEndedMessage msg){
  this.roundEnded=true;
  applyGameStats(msg.stats);
  scoreboard.setWinner(ClientTeam.fromId(msg.winnerTeamId));
  showScoreBoard(true);
  executeCallbackScript("String_Node_Str",this);
}
Program: 86742
Project: 86742
Buggy source:
/** 
 * Cleans up resources
 */
public void destroy(){
  this.pools.destroy();
  this.entities.clear();
  this.bombTargets.clear();
  this.vehicles.clear();
  this.gameEffects.destroy();
}

Fixed version (ground truth):
/** 
 * Cleans up resources
 */
public void destroy(){
  this.pools.destroy();
  this.entities.clear();
  this.bombTargets.clear();
  this.vehicles.clear();
  this.gameEffects.destroy();
  this.gameTimers.removeTimers();
}
Program: 86743
Project: 86743
Buggy source:
public void roundStarted(RoundStartedMessage msg){
  gameEffects.clearEffects();
  this.roundEnded=false;
  scoreboard.setGameEnded(false);
  scoreboard.setWinner(null);
  this.hud.getMessageLog().clearLogs();
  showScoreBoard(false);
  applyFullGameState(msg.gameState);
}

Fixed version (ground truth):
public void roundStarted(RoundStartedMessage msg){
  gameEffects.clearEffects();
  this.roundEnded=false;
  scoreboard.setGameEnded(false);
  scoreboard.setWinner(null);
  this.hud.getMessageLog().clearLogs();
  showScoreBoard(false);
  applyFullGameState(msg.gameState);
  executeCallbackScript("String_Node_Str",this);
}
Program: 86744
Project: 86744
Buggy source:
/** 
 * Renders the game world
 * @param canvas
 */
public void render(Canvas canvas,float alpha){
  boolean renderMethod1=false;
  if (renderMethod1) {
    canvas.fboBegin();
{
      gameEffects.preRenderFrameBuffer(canvas,camera,alpha);
      gameEffects.postRenderFrameBuffer(canvas,camera,alpha);
      canvas.setShader(null);
      renderWorld(canvas,camera,alpha);
    }
    canvas.fboEnd();
    canvas.setShader(null);
    gameEffects.renderFrameBuffer(canvas,camera,alpha);
    canvas.setShader(null);
    DebugDraw.enable(false);
    DebugDraw.render(canvas,camera);
    hud.render(canvas,camera,alpha);
  }
 else {
    canvas.fboBegin();
{
      gameEffects.preRenderFrameBuffer(canvas,camera,alpha);
    }
    canvas.fboEnd();
    gameEffects.postRenderFrameBuffer(canvas,camera,alpha);
    renderWorld(canvas,camera,alpha);
    canvas.setShader(null);
    DebugDraw.enable(false);
    DebugDraw.render(canvas,camera);
    hud.render(canvas,camera,alpha);
  }
}

Fixed version (ground truth):
/** 
 * Renders the game world
 * @param canvas
 */
public void render(Canvas canvas,float alpha){
  boolean renderMethod1=false;
  if (renderMethod1) {
    canvas.fboBegin();
{
      gameEffects.preRenderFrameBuffer(canvas,camera,alpha);
      gameEffects.postRenderFrameBuffer(canvas,camera,alpha);
      canvas.setShader(null);
      renderWorld(canvas,camera,alpha);
    }
    canvas.fboEnd();
    canvas.setShader(null);
    gameEffects.renderFrameBuffer(canvas,camera,alpha);
    canvas.setShader(null);
    DebugDraw.enable(false);
    DebugDraw.render(canvas,camera);
    hud.render(canvas,camera,alpha);
  }
 else {
    canvas.fboBegin();
{
      gameEffects.preRenderFrameBuffer(canvas,camera,alpha);
    }
    canvas.fboEnd();
    gameEffects.postRenderFrameBuffer(canvas,camera,alpha);
    renderWorld(canvas,camera,alpha);
    canvas.setShader(null);
    DebugDraw.enable(true);
    DebugDraw.render(canvas,camera);
    hud.render(canvas,camera,alpha);
  }
}
Program: 86745
Project: 86745
Buggy source:
/** 
 * @param app
 * @param players
 * @param map
 * @param session
 * @throws Exception
 */
public ClientGame(SeventhGame app,ClientPlayers players,Map map,LocalSession session) throws Exception {
  this.app=app;
  this.players=players;
  this.map=map;
  this.localSession=session;
  this.scoreboard=new Scoreboard(this);
  this.localPlayer=players.getPlayer(session.getSessionPlayerId());
  this.entities=new ClientEntities(SeventhConstants.MAX_ENTITIES);
  this.renderingOrderEntities=new ClientEntity[SeventhConstants.MAX_ENTITIES];
  this.bombTargets=new ArrayList<ClientBombTarget>();
  this.vehicles=new ArrayList<ClientVehicle>();
  this.camera=newCamera(map.getMapWidth(),map.getMapHeight());
  this.cameraController=new CameraController(this);
  this.gameTimers=new Timers(SeventhConstants.MAX_TIMERS);
  this.hud=new Hud(this);
  this.random=new Random();
  this.gameType=GameType.Type.TDM;
  this.cacheRect=new Rectangle();
  this.gameEffects=new ClientGameEffects();
  this.entityListener=this.gameEffects.getLightSystem().getClientEntityListener();
  this.pools=new Pools(this);
  this.zings=new Zings(this);
}

Fixed version (ground truth):
/** 
 * @param app
 * @param players
 * @param map
 * @param session
 * @throws Exception
 */
public ClientGame(SeventhGame app,ClientPlayers players,Map map,LocalSession session) throws Exception {
  this.app=app;
  this.players=players;
  this.map=map;
  this.localSession=session;
  this.scoreboard=new Scoreboard(this);
  this.localPlayer=players.getPlayer(session.getSessionPlayerId());
  this.entities=new ClientEntities(SeventhConstants.MAX_ENTITIES);
  this.renderingOrderEntities=new ClientEntity[SeventhConstants.MAX_ENTITIES];
  this.bombTargets=new ArrayList<ClientBombTarget>();
  this.vehicles=new ArrayList<ClientVehicle>();
  this.camera=newCamera(map.getMapWidth(),map.getMapHeight());
  this.cameraController=new CameraController(this);
  this.gameTimers=new Timers(SeventhConstants.MAX_TIMERS);
  this.hud=new Hud(this);
  this.random=new Random();
  this.gameType=GameType.Type.TDM;
  this.cacheRect=new Rectangle();
  this.gameEffects=new ClientGameEffects();
  this.entityListener=this.gameEffects.getLightSystem().getClientEntityListener();
  this.pools=new Pools(this);
  this.zings=new Zings(this);
  this.runtime=Scripting.newSandboxedRuntime();
}
Program: 86746
Project: 86746
Buggy source:
/** 
 * Load the client maps properties file
 * @param mapFile
 * @param game
 */
private void loadMapProperties(String mapFile){
  File propertiesFile=new File(mapFile + "String_Node_Str");
  if (propertiesFile.exists()) {
    try {
      Leola runtime=Scripting.newSandboxedRuntime();
      runtime.loadStatics(SeventhScriptingCommonLibrary.class);
      runtime.put("String_Node_Str",this);
      runtime.eval(propertiesFile);
    }
 catch (    Exception e) {
      Cons.println("String_Node_Str" + propertiesFile.getName() + "String_Node_Str"+ e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Load the client maps properties file
 * @param mapFile
 * @param game
 */
private void loadMapProperties(String mapFile){
  File propertiesFile=new File(mapFile + "String_Node_Str");
  if (propertiesFile.exists()) {
    try {
      runtime.loadStatics(SeventhScriptingCommonLibrary.class);
      runtime.put("String_Node_Str",this);
      runtime.eval(propertiesFile);
    }
 catch (    Exception e) {
      Cons.println("String_Node_Str" + propertiesFile.getName() + "String_Node_Str"+ e);
    }
  }
}
Program: 86747
Project: 86747
Buggy source:
/** 
 * @return the local host name
 */
public String getAddress(){
  try {
    return InetAddress.getLocalHost().getHostName();
  }
 catch (  UnknownHostException e) {
    Cons.println("String_Node_Str" + e);
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * @return the local host name
 */
public String getAddress(){
  try {
    return InetAddress.getLocalHost().getHostAddress();
  }
 catch (  UnknownHostException e) {
    Cons.println("String_Node_Str" + e);
    return "String_Node_Str";
  }
}
Program: 86748
Project: 86748
Buggy source:
/** 
 * destroys the game, cleans up resources
 */
public void destroy(){
  for (int i=0; i < this.entities.length; i++) {
    this.entities[i]=null;
    this.deadFrames[i]=0;
  }
  for (int i=0; i < this.playerEntities.length; i++) {
    this.playerEntities[i]=null;
  }
  this.bombTargets.clear();
  this.vehicles.clear();
  this.players.resetStats();
  this.aiSystem.destroy();
  this.dispatcher.removeAllEventListeners();
}

Fixed version (ground truth):
/** 
 * destroys the game, cleans up resources
 */
public void destroy(){
  for (int i=0; i < this.entities.length; i++) {
    this.entities[i]=null;
    this.deadFrames[i]=0;
  }
  for (int i=0; i < this.playerEntities.length; i++) {
    this.playerEntities[i]=null;
  }
  this.bombTargets.clear();
  this.vehicles.clear();
  this.players.resetStats();
  this.aiSystem.destroy();
  this.gameTimers.removeTimers();
  this.dispatcher.removeAllEventListeners();
}
Program: 86749
Project: 86749
Buggy source:
/** 
 * @param serverContext
 * @param gameSessionListener
 * @param mapFile
 */
public LoadingState(ServerContext serverContext,GameSessionListener gameSessionListener,String mapFile){
  this.serverContext=serverContext;
  this.gameSessionListener=gameSessionListener;
  this.mapFile=mapFile;
  this.runtime=serverContext.getRuntime();
  this.gameSession=null;
}

Fixed version (ground truth):
/** 
 * @param serverContext
 * @param gameSessionListener
 * @param mapFile
 */
public LoadingState(ServerContext serverContext,GameSessionListener gameSessionListener,String mapFile){
  this.serverContext=serverContext;
  this.gameSessionListener=gameSessionListener;
  this.mapFile=mapFile;
  this.runtime=serverContext.newRuntime();
  this.gameSession=null;
}
Program: 86750
Project: 86750
Buggy source:
@Override public void update(TimeStep timeStep){
  super.update(timeStep);
  alpha.update(timeStep);
  ease.update(timeStep);
  double dt=timeStep.asFraction();
  int newX=(int)Math.round(pos.x + vel.x * speed * dt);
  int newY=(int)Math.round(pos.y + vel.y * speed * dt);
  speed=getRandom().nextInt(maxSpeed);
  pos.x=newX;
  pos.y=newY;
}

Fixed version (ground truth):
@Override public void update(TimeStep timeStep){
  super.update(timeStep);
  alpha.update(timeStep);
  ease.update(timeStep);
  double dt=timeStep.asFraction();
  int newX=(int)Math.round(pos.x + vel.x * speed * dt);
  int newY=(int)Math.round(pos.y + vel.y * speed * dt);
  speed=getRandom().nextInt(maxSpeed);
  setPos(newX,newY);
}
Program: 86752
Project: 86752
Buggy source:
@Override public void read(IOBuffer buffer){
  super.read(buffer);
  orientation=buffer.getShort();
  state=buffer.get();
  health=buffer.get();
  State aState=State.fromNetValue(state);
  if (aState.isVehicleState()) {
    isOperatingVehicle=true;
    vehicleId=buffer.get();
  }
 else {
    readWeapon(buffer);
  }
}

Fixed version (ground truth):
@Override public void read(IOBuffer buffer){
  super.read(buffer);
  orientation=buffer.getShort();
  state=buffer.get();
  health=buffer.get();
  State aState=State.fromNetValue(state);
  if (aState.isVehicleState()) {
    isOperatingVehicle=true;
    vehicleId=buffer.getUnsignedByte();
  }
 else {
    readWeapon(buffer);
  }
}
Program: 86753
Project: 86753
Buggy source:
@Override public void write(IOBuffer buffer){
  super.write(buffer);
  buffer.putShort(orientation);
  buffer.put(state);
  buffer.put(health);
  State aState=State.fromNetValue(state);
  if (aState.isVehicleState()) {
    buffer.put(vehicleId);
  }
 else {
    writeWeapon(buffer);
  }
}

Fixed version (ground truth):
@Override public void write(IOBuffer buffer){
  super.write(buffer);
  buffer.putShort(orientation);
  buffer.put(state);
  buffer.put(health);
  State aState=State.fromNetValue(state);
  if (aState.isVehicleState()) {
    buffer.putUnsignedByte(vehicleId);
  }
 else {
    writeWeapon(buffer);
  }
}
Program: 86754
Project: 86754
Buggy source:
@Override public void registerListeners(final GameInfo game,EventDispatcher dispatcher){
  dispatcher.addEventListener(PlayerKilledEvent.class,new PlayerKilledListener(){
    @Override @EventMethod public void onPlayerKilled(    PlayerKilledEvent event){
      if (isInProgress()) {
        PlayerInfo killer=game.getPlayerById(Integer.valueOf((int)(event.getKillerId())));
        if (killer != null) {
          Player killed=event.getPlayer();
          if (killed != null) {
            if (killer.getId() == killed.getId()) {
              killed.getTeam().score(-1);
              return;
            }
          }
          killer.getTeam().score(1);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void registerListeners(final GameInfo game,EventDispatcher dispatcher){
  this.dispatcher=dispatcher;
  this.dispatcher.addEventListener(PlayerKilledEvent.class,new PlayerKilledListener(){
    @Override @EventMethod public void onPlayerKilled(    PlayerKilledEvent event){
      if (isInProgress()) {
        PlayerInfo killer=game.getPlayerById(Integer.valueOf((int)(event.getKillerId())));
        if (killer != null) {
          Player killed=event.getPlayer();
          if (killed != null) {
            if (killer.getId() == killed.getId()) {
              killed.getTeam().score(-1);
              return;
            }
          }
          killer.getTeam().score(1);
        }
      }
    }
  }
);
}
Program: 86755
Project: 86755
Buggy source:
@Override public void start(Game game){
}

Fixed version (ground truth):
@Override public void start(Game game){
  this.dispatcher.queueEvent(new RoundStartedEvent(this));
}
Program: 86756
Project: 86756
Buggy source:
@Override protected GameState doUpdate(Game game,TimeStep timeStep){
  if (GameState.IN_PROGRESS == getGameState()) {
    List<Team> leaders=getTeamsWithHighScore();
    boolean isUnlimitedScore=getMaxScore() <= 0;
    if (this.getRemainingTime() <= 0 || (leaders.get(0).getScore() >= getMaxScore() && !isUnlimitedScore)) {
      if (leaders.size() > 1) {
        setGameState(GameState.TIE);
      }
 else {
        setGameState(GameState.WINNER);
      }
    }
  }
  if (GameState.IN_PROGRESS == getGameState()) {
    Player[] players=game.getPlayers().getPlayers();
    for (int i=0; i < players.length; i++) {
      Player player=players[i];
      if (player != null) {
        if (player.isDead() && !player.isSpectating()) {
          player.updateSpawnTime(timeStep);
          if (player.readyToSpawn()) {
            game.spawnPlayerEntity(player.getId());
          }
        }
      }
    }
  }
  return getGameState();
}

Fixed version (ground truth):
@Override protected GameState doUpdate(Game game,TimeStep timeStep){
  if (GameState.IN_PROGRESS == getGameState()) {
    List<Team> leaders=getTeamsWithHighScore();
    boolean isUnlimitedScore=getMaxScore() <= 0;
    if (this.getRemainingTime() <= 0 || (leaders.get(0).getScore() >= getMaxScore() && !isUnlimitedScore)) {
      if (leaders.size() > 1) {
        setGameState(GameState.TIE);
        this.dispatcher.queueEvent(new RoundEndedEvent(this,null,game.getNetGameStats()));
      }
 else {
        setGameState(GameState.WINNER);
        this.dispatcher.queueEvent(new RoundEndedEvent(this,leaders.get(0),game.getNetGameStats()));
      }
    }
  }
  if (GameState.IN_PROGRESS == getGameState()) {
    Player[] players=game.getPlayers().getPlayers();
    for (int i=0; i < players.length; i++) {
      Player player=players[i];
      if (player != null) {
        if (player.isDead() && !player.isSpectating()) {
          player.updateSpawnTime(timeStep);
          if (player.readyToSpawn()) {
            game.spawnPlayerEntity(player.getId());
          }
        }
      }
    }
  }
  return getGameState();
}
Program: 86757
Project: 86757
Buggy source:
/** 
 * Parses the JSON
 * @param entry
 * @return
 */
private String[] parseEntry(LeoObject object){
  String[] result={"String_Node_Str","String_Node_Str"};
  try {
    ServerInfo info=new ServerInfo(object);
    result=new String[]{String.format("String_Node_Str",info.getServerName(),info.getGameType(),info.getAxis().size() + info.getAllies().size(),12),info.getAddress() + "String_Node_Str" + info.getPort()};
  }
 catch (  Exception e) {
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Parses the JSON
 * @param entry
 * @return
 */
private String[] parseEntry(ServerInfo info){
  String[] result={"String_Node_Str","String_Node_Str"};
  try {
    result=new String[]{String.format("String_Node_Str",info.getServerName(),info.getGameType(),info.getAxis().size() + info.getAllies().size(),12),info.getAddress() + "String_Node_Str" + info.getPort()};
  }
 catch (  Exception e) {
  }
  return result;
}
Program: 86758
Project: 86758
Buggy source:
@Override public void run(){
  MasterServerClient api=new MasterServerClient(app.getConfig().getMasterServerConfig());
  try {
    LeoObject result=api.getServerListings(null);
    if (LeoObject.isTrue(result)) {
      showServersLabel.set(false);
      if (result.isArray()) {
        LeoArray array=result.as();
        servers.add(array);
      }
    }
 else {
      showServersLabel.set(true);
    }
    update.set(true);
  }
 catch (  Exception e) {
    Cons.println("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  servers.clear();
  MasterServerClient api=new MasterServerClient(app.getConfig().getMasterServerConfig());
  try {
    String gameType=gameTypeIndex >= 0 && gameTypeIndex < GameType.Type.values().length ? GameType.Type.values()[gameTypeIndex].name() : null;
    LeoObject result=api.getServerListings(gameType);
    if (LeoObject.isTrue(result)) {
      showServersLabel.set(false);
      if (result.isArray()) {
        LeoArray array=result.as();
        for (        LeoObject obj : array) {
          ServerInfo info=new ServerInfo(obj);
          servers.add(info);
        }
      }
    }
 else {
      showServersLabel.set(true);
    }
    update.set(true);
  }
 catch (  Exception e) {
    Cons.println("String_Node_Str" + e);
  }
}
Program: 86759
Project: 86759
Buggy source:
/** 
 */
public ServerListingsScreen(final MenuScreen menuScreen){
  this.menuScreen=menuScreen;
  this.theme=menuScreen.getTheme();
  this.app=menuScreen.getApp();
  this.uiManager=menuScreen.getUiManager();
  this.isServerInternetOptionsDisplayed=true;
  this.gameTypeIndex=GameType.Type.values().length;
  this.showServersLabel=new AtomicBoolean(true);
  this.servers=new ConcurrentLinkedQueue<>();
  this.update=new AtomicBoolean();
  this.queryingLan=new AtomicBoolean();
  createUI();
  queryInternetServers();
}

Fixed version (ground truth):
/** 
 */
public ServerListingsScreen(final MenuScreen menuScreen){
  this.menuScreen=menuScreen;
  this.theme=menuScreen.getTheme();
  this.app=menuScreen.getApp();
  this.uiManager=menuScreen.getUiManager();
  this.isServerInternetOptionsDisplayed=true;
  this.gameTypeIndex=GameType.Type.values().length;
  this.showServersLabel=new AtomicBoolean(true);
  this.servers=new ConcurrentLinkedQueue<>();
  this.update=new AtomicBoolean();
  this.queryingLan=new AtomicBoolean();
  createUI();
  queryMultiplayerServers();
}
Program: 86761
Project: 86761
Buggy source:
private void queryInternetServers(){
  Thread thread=new Thread(new Runnable(){
    @Override public void run(){
      MasterServerClient api=new MasterServerClient(app.getConfig().getMasterServerConfig());
      try {
        LeoObject result=api.getServerListings(null);
        if (LeoObject.isTrue(result)) {
          showServersLabel.set(false);
          if (result.isArray()) {
            LeoArray array=result.as();
            servers.add(array);
          }
        }
 else {
          showServersLabel.set(true);
        }
        update.set(true);
      }
 catch (      Exception e) {
        Cons.println("String_Node_Str" + e);
      }
    }
  }
);
  thread.start();
}

Fixed version (ground truth):
private void queryInternetServers(){
  Thread thread=new Thread(new Runnable(){
    @Override public void run(){
      servers.clear();
      MasterServerClient api=new MasterServerClient(app.getConfig().getMasterServerConfig());
      try {
        String gameType=gameTypeIndex >= 0 && gameTypeIndex < GameType.Type.values().length ? GameType.Type.values()[gameTypeIndex].name() : null;
        LeoObject result=api.getServerListings(gameType);
        if (LeoObject.isTrue(result)) {
          showServersLabel.set(false);
          if (result.isArray()) {
            LeoArray array=result.as();
            for (            LeoObject obj : array) {
              ServerInfo info=new ServerInfo(obj);
              servers.add(info);
            }
          }
        }
 else {
          showServersLabel.set(true);
        }
        update.set(true);
      }
 catch (      Exception e) {
        Cons.println("String_Node_Str" + e);
      }
    }
  }
);
  thread.start();
}
Program: 86763
Project: 86763
Buggy source:
/** 
 * Load the maps properties file
 * @param mapFile
 * @param game
 */
private void loadProperties(GameMap gameMap,Game game){
  File propertiesFile=new File(gameMap.getMapFileName() + "String_Node_Str");
  if (propertiesFile.exists()) {
    try {
      Leola runtime=Scripting.newSandboxedRuntime();
      runtime.loadStatics(SeventhScriptingCommonLibrary.class);
      runtime.put("String_Node_Str",game);
      runtime.eval(propertiesFile);
      Map map=game.getMap();
      Layer[] layers=map.getBackgroundLayers();
      for (int i=0; i < layers.length; i++) {
        Layer layer=layers[i];
        if (layer != null) {
          if (layer.isLightLayer()) {
            for (int y=0; y < map.getTileWorldHeight(); y++) {
              for (int x=0; x < map.getTileWorldWidth(); x++) {
                Tile tile=layer.getRow(y).get(x);
                if (tile != null) {
                  LightBulb light=game.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):
/** 
 * Load the maps properties file
 * @param mapFile
 * @param game
 */
private void loadProperties(GameMap gameMap,Game game){
  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(game);
      runtime.loadLibrary(gLib,"String_Node_Str");
      AILeolaLibrary aiLib=new AILeolaLibrary();
      runtime.loadLibrary(aiLib,"String_Node_Str");
      runtime.put("String_Node_Str",game);
      runtime.eval(propertiesFile);
      Map map=game.getMap();
      Layer[] layers=map.getBackgroundLayers();
      for (int i=0; i < layers.length; i++) {
        Layer layer=layers[i];
        if (layer != null) {
          if (layer.isLightLayer()) {
            for (int y=0; y < map.getTileWorldHeight(); y++) {
              for (int x=0; x < map.getTileWorldWidth(); x++) {
                Tile tile=layer.getRow(y).get(x);
                if (tile != null) {
                  LightBulb light=game.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: 86764
Project: 86764
Buggy source:
/** 
 * Allocates the   {@link Peer} which doesn't actually make the connection
 * @param address
 * @return the Peer
 * @throws IOException
 */
protected Peer allocatePeer(InetSocketAddress address) throws IOException {
  if (this.numberOfConnections >= this.maxConnections) {
    throw new IOException("String_Node_Str");
  }
  Peer peer=isClientAlreadyConnected(address);
  if (peer == null) {
synchronized (this) {
      byte id=findOpenId();
      if (id == INVALID_PEER_ID) {
        throw new IOException("String_Node_Str");
      }
      this.numberOfConnections++;
      peer=new Peer(this,address,id);
      peer.setState(State.CONNECTED);
      peers[id]=peer;
    }
  }
  return peer;
}

Fixed version (ground truth):
/** 
 * Allocates the   {@link Peer} which doesn't actually make the connection
 * @param address
 * @return the Peer
 * @throws IOException
 */
protected Peer allocatePeer(InetSocketAddress address) throws IOException {
synchronized (this) {
    if (this.numberOfConnections >= this.maxConnections) {
      throw new IOException("String_Node_Str");
    }
    Peer peer=isClientAlreadyConnected(address);
    if (peer == null) {
      byte id=findOpenId();
      if (id == INVALID_PEER_ID) {
        throw new IOException("String_Node_Str");
      }
      this.numberOfConnections++;
      peer=new Peer(this,address,id);
      peer.setState(State.CONNECTED);
      peers[id]=peer;
    }
    return peer;
  }
}
Program: 86765
Project: 86765
Buggy source:
@Override public void read(IOBuffer buffer){
  maxTime=buffer.getLong();
  maxScore=buffer.getInt();
  byte len=buffer.get();
  if (len > 0) {
    teams=new NetTeam[len];
    for (byte i=0; i < len; i++) {
      teams[i]=new NetTeam();
      teams[i].read(buffer);
    }
  }
}

Fixed version (ground truth):
@Override public void read(IOBuffer buffer){
  maxTime=buffer.getLong();
  maxScore=buffer.getInt();
  type=buffer.get();
  byte len=buffer.get();
  if (len > 0) {
    teams=new NetTeam[len];
    for (byte i=0; i < len; i++) {
      teams[i]=new NetTeam();
      teams[i].read(buffer);
    }
  }
}
Program: 86766
Project: 86766
Buggy source:
@Override public void write(IOBuffer buffer){
  buffer.putLong(maxTime);
  buffer.putInt(maxScore);
  if (teams != null) {
    byte len=(byte)teams.length;
    buffer.put(len);
    for (byte i=0; i < len; i++) {
      teams[i].write(buffer);
    }
  }
 else {
    buffer.put((byte)0);
  }
}

Fixed version (ground truth):
@Override public void write(IOBuffer buffer){
  buffer.putLong(maxTime);
  buffer.putInt(maxScore);
  buffer.put(type);
  if (teams != null) {
    byte len=(byte)teams.length;
    buffer.put(len);
    for (byte i=0; i < len; i++) {
      teams[i].write(buffer);
    }
  }
 else {
    buffer.put((byte)0);
  }
}
Program: 86767
Project: 86767
Buggy source:
/** 
 * Lets the brain think for a game tick
 * @param timeStep
 */
public void update(TimeStep timeStep){
  if (player.isAlive()) {
    this.memory.update(timeStep);
    this.sensors.update(timeStep);
    this.motion.update(timeStep);
    this.thoughtProcess.think(timeStep,this);
    this.targetingSystem.update(timeStep);
  }
}

Fixed version (ground truth):
/** 
 * Lets the brain think for a game tick
 * @param timeStep
 */
public void update(TimeStep timeStep){
  if (entityOwner != null && entityOwner.isAlive()) {
    this.memory.update(timeStep);
    this.sensors.update(timeStep);
    this.motion.update(timeStep);
    this.thoughtProcess.think(timeStep,this);
    this.targetingSystem.update(timeStep);
  }
}
Program: 86768
Project: 86768
Buggy source:
/** 
 * Moves the cursor based on the delta movement
 * @param dx either 1, -1 or 0
 * @param dy either 1, -1 or 0
 */
public void moveByDelta(float dx,float dy){
  float deltaX=this.mouseSensitivity * (dx * 20);
  float deltaY=this.mouseSensitivity * (dy * 20);
  this.prevX=(int)cursorPos.x;
  this.prevY=(int)cursorPos.y;
  this.cursorPos.x+=deltaX;
  this.cursorPos.y+=deltaY;
}

Fixed version (ground truth):
/** 
 * Moves the cursor based on the delta movement
 * @param dx either 1, -1 or 0
 * @param dy either 1, -1 or 0
 */
public void moveByDelta(float dx,float dy){
  float deltaX=this.mouseSensitivity * (dx * 20);
  float deltaY=this.mouseSensitivity * (dy * 20);
  this.prevX=(int)cursorPos.x;
  this.prevY=(int)cursorPos.y;
  this.cursorPos.x+=deltaX;
  this.cursorPos.y+=deltaY;
  clamp();
}
Program: 86769
Project: 86769
Buggy source:
/** 
 * Moves the cursor to the specified location
 * @param x
 * @param y
 */
public void moveTo(int x,int y){
  if (isVisible()) {
    float deltaX=this.mouseSensitivity * (this.prevX - x);
    float deltaY=this.mouseSensitivity * (this.prevY - y);
    this.cursorPos.x-=deltaX;
    this.cursorPos.y-=deltaY;
    this.prevX=x;
    this.prevY=y;
  }
}

Fixed version (ground truth):
/** 
 * Moves the cursor to the specified location
 * @param x
 * @param y
 */
public void moveTo(int x,int y){
  if (isVisible()) {
    float deltaX=this.mouseSensitivity * (this.prevX - x);
    float deltaY=this.mouseSensitivity * (this.prevY - y);
    this.cursorPos.x-=deltaX;
    this.cursorPos.y-=deltaY;
    this.prevX=x;
    this.prevY=y;
    clamp();
  }
}
Program: 86770
Project: 86770
Buggy source:
public Integer getTileId(int id){
  Tileset bestmatch=null;
  for (  Tileset t : tilesets) {
    if (id >= t.getStartId()) {
      if (bestmatch == null || bestmatch.getStartId() < t.getStartId()) {
        bestmatch=t;
      }
    }
  }
  if (bestmatch != null) {
    return bestmatch.getTileId(id);
  }
  return null;
}

Fixed version (ground truth):
public Integer getTileId(int id){
  Tileset bestmatch=null;
  for (  Tileset t : tilesets) {
    if (id >= t.getStartId()) {
      if (bestmatch == null || bestmatch.getStartId() < t.getStartId()) {
        bestmatch=t;
      }
    }
  }
  if (bestmatch != null) {
    return bestmatch.getTileId(id);
  }
  return -1;
}
Program: 86771
Project: 86771
Buggy source:
@Override public void updateState(NetEntity state,long time){
  super.updateState(state,time);
  if (state instanceof NetPlayer) {
    NetPlayer ps=(NetPlayer)state;
    this.currentState=State.fromNetValue(ps.state);
    int newHealth=ps.health;
    this.damageDelta=newHealth - this.health;
    this.health=ps.health;
    this.stamina=ps.stamina;
    this.numberOfGrenades=ps.grenades;
    if (ps.isOperatingVehicle) {
      if (this.vehicle == null || this.vehicle.getId() != ps.vehicleId) {
        this.vehicle=game.getVehicleById(ps.vehicleId);
      }
    }
 else {
      this.vehicle=null;
      updateWeaponState(ps.weapon,time);
    }
  }
 else {
    NetPlayerPartial ps=(NetPlayerPartial)state;
    this.currentState=State.fromNetValue(ps.state);
    int newHealth=ps.health;
    this.damageDelta=newHealth - this.health;
    this.health=ps.health;
    if (ps.isOperatingVehicle) {
      if (this.vehicle == null || this.vehicle.getId() != ps.vehicleId) {
        this.vehicle=game.getVehicleById(ps.vehicleId);
      }
    }
 else {
      updateWeaponState(ps.weapon,time);
    }
  }
}

Fixed version (ground truth):
@Override public void updateState(NetEntity state,long time){
  super.updateState(state,time);
  if (state instanceof NetPlayer) {
    NetPlayer ps=(NetPlayer)state;
    this.currentState=State.fromNetValue(ps.state);
    int newHealth=ps.health;
    this.damageDelta=newHealth - this.health;
    this.health=ps.health;
    this.stamina=ps.stamina;
    this.numberOfGrenades=ps.grenades;
    if (ps.isOperatingVehicle) {
      if (this.vehicle == null || this.vehicle.getId() != ps.vehicleId) {
        this.vehicle=game.getVehicleById(ps.vehicleId);
      }
    }
 else {
      this.vehicle=null;
      updateWeaponState(ps.weapon,time);
    }
  }
 else {
    NetPlayerPartial ps=(NetPlayerPartial)state;
    this.currentState=State.fromNetValue(ps.state);
    int newHealth=ps.health;
    this.damageDelta=newHealth - this.health;
    this.health=ps.health;
    if (ps.isOperatingVehicle) {
      if (this.vehicle == null || this.vehicle.getId() != ps.vehicleId) {
        this.vehicle=game.getVehicleById(ps.vehicleId);
      }
    }
 else {
      if (this.vehicle != null) {
        this.vehicle.setOperator(null);
      }
      updateWeaponState(ps.weapon,time);
    }
  }
}
Program: 86773
Project: 86773
Buggy source:
public void sprint(){
  if (currentState != State.DEAD && stamina > 0 && !firing && !wasSprinting && recoveryTime <= 0) {
    Weapon weapon=this.inventory.currentItem();
    if (weapon == null || !weapon.getType().equals(Type.ROCKET_LAUNCHER)) {
      if (currentState != State.SPRINTING) {
        game.emitSound(getId(),SoundType.RUFFLE,getCenterPos());
      }
      currentState=State.SPRINTING;
      return;
    }
  }
  wasSprinting=true;
  currentState=State.RUNNING;
}

Fixed version (ground truth):
public void sprint(){
  if (currentState != State.DEAD && stamina > 0 && !firing && !wasSprinting && recoveryTime <= 0) {
    Weapon weapon=this.inventory.currentItem();
    boolean isReady=weapon != null ? weapon.isReady() : true;
    if (weapon == null || !weapon.getType().equals(Type.ROCKET_LAUNCHER) && isReady) {
      if (currentState != State.SPRINTING) {
        game.emitSound(getId(),SoundType.RUFFLE,getCenterPos());
      }
      currentState=State.SPRINTING;
      return;
    }
  }
  wasSprinting=true;
  currentState=State.RUNNING;
}
Program: 86775
Project: 86775
Buggy source:
/** 
 * Handles the vehicle time
 * @param timeStep
 */
protected void updateVehicleTime(TimeStep timeStep){
  if (this.vehicleTime > 0) {
    this.vehicleTime-=timeStep.getDeltaTime();
  }
 else {
    if (currentState == State.ENTERING_VEHICLE) {
      currentState=State.OPERATING_VEHICLE;
    }
    if (currentState == State.EXITING_VEHICLE) {
      Vehicle vehicle=getVehicle();
      Vector2f newPos=game.findFreeRandomSpotNotIn(this,vehicle.getBounds(),vehicle.getOBB());
      if (newPos == null) {
        currentState=State.OPERATING_VEHICLE;
      }
 else {
        this.operating.stopOperating(this);
        this.operating=null;
        setCanTakeDamage(true);
        currentState=State.IDLE;
        moveTo(newPos);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Handles the vehicle time
 * @param timeStep
 */
protected void updateVehicleTime(TimeStep timeStep){
  if (this.vehicleTime > 0) {
    this.vehicleTime-=timeStep.getDeltaTime();
  }
 else {
    if (currentState == State.ENTERING_VEHICLE) {
      currentState=State.OPERATING_VEHICLE;
    }
 else     if (currentState == State.EXITING_VEHICLE) {
      Vehicle vehicle=getVehicle();
      Vector2f newPos=game.findFreeRandomSpotNotIn(this,vehicle.getBounds(),vehicle.getOBB());
      if (newPos == null) {
        currentState=State.OPERATING_VEHICLE;
      }
 else {
        this.operating.stopOperating(this);
        this.operating=null;
        setCanTakeDamage(true);
        currentState=State.IDLE;
        moveTo(newPos);
      }
    }
 else {
      if (isOperatingVehicle()) {
        currentState=State.OPERATING_VEHICLE;
      }
    }
  }
}
Program: 86776
Project: 86776
Buggy source:
@Override public boolean update(TimeStep timeStep){
  updateInvincibleTime(timeStep);
  updateVehicleTime(timeStep);
  boolean blocked=false;
  if (!isOperatingVehicle()) {
    updateVelocity(timeStep);
    blocked=super.update(timeStep);
    updateMovementSounds(timeStep);
    updateStamina(timeStep);
    updateWeapons(timeStep);
    updateBombTargetUse(timeStep);
  }
 else {
    moveTo(this.operating.getCenterPos());
  }
  return blocked;
}

Fixed version (ground truth):
@Override public boolean update(TimeStep timeStep){
  updateInvincibleTime(timeStep);
  updateVehicleTime(timeStep);
  boolean blocked=false;
  if (!isOperatingVehicle()) {
    updateVelocity(timeStep);
    blocked=super.update(timeStep);
    updateMovementSounds(timeStep);
    updateStamina(timeStep);
    updateWeapons(timeStep);
    updateBombTargetUse(timeStep);
  }
 else {
    this.operating.operate(this);
    moveTo(this.operating.getCenterPos());
  }
  return blocked;
}