nus-yam/ex-repair huggingface dataset:
Program: 83609
Project: 83609
Buggy source:
@Override public void onSurfaceChanged(GL10 gl,int width,int height){
  gl.glViewport(0,0,width,height);
  Log.v(Pax.TAG,String.format("String_Node_Str",width,height));
  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();
  mWidth=width;
  mHeight=height;
  float maxDimension=Math.max(width,height);
  mGameWidth=GAME_VIEW_SIZE * width / maxDimension;
  mGameHeight=GAME_VIEW_SIZE * height / maxDimension;
  float halfX=mGameWidth / 2;
  float halfY=mGameHeight / 2;
  GLU.gluOrtho2D(gl,-halfX,halfX,-halfY,halfY);
  gl.glMatrixMode(GL10.GL_MODELVIEW);
  gl.glLoadIdentity();
  mButtonSize=Math.max(mGameWidth,mGameHeight) / 15;
  Resources res=mContext.getResources();
  if (Pax.BACKGROUND_IMAGE) {
  }
  mBuildTargetPainters=new Painter[4];
  mBuildTargetPainters[0]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.fighter_outline),mButtonSize);
  mBuildTargetPainters[1]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.bomber_outline),mButtonSize);
  mBuildTargetPainters[2]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.frigate_outline),mButtonSize);
  mBuildTargetPainters[3]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.upgrade_outline),mButtonSize);
}

Fixed version (ground truth):
@Override public void onSurfaceChanged(GL10 gl,int width,int height){
  gl.glViewport(0,0,width,height);
  Log.v(Pax.TAG,String.format("String_Node_Str",width,height));
  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();
  mWidth=width;
  mHeight=height;
  float maxDimension=Math.max(width,height);
  mGameWidth=GAME_VIEW_SIZE * width / maxDimension;
  mGameHeight=GAME_VIEW_SIZE * height / maxDimension;
  float halfX=mGameWidth / 2;
  float halfY=mGameHeight / 2;
  GLU.gluOrtho2D(gl,-halfX,halfX,-halfY,halfY);
  gl.glMatrixMode(GL10.GL_MODELVIEW);
  gl.glLoadIdentity();
  mButtonSize=Math.max(mGameWidth,mGameHeight) / 15;
  if (Pax.BACKGROUND_IMAGE) {
  }
  mBuildTargetPainters=new Painter[4];
  mBuildTargetPainters[0]=Painter.CreateMinSize(gl,mVBOSupport,loadBitmap(R.drawable.fighter_outline),mButtonSize);
  mBuildTargetPainters[1]=Painter.CreateMinSize(gl,mVBOSupport,loadBitmap(R.drawable.bomber_outline),mButtonSize);
  mBuildTargetPainters[2]=Painter.CreateMinSize(gl,mVBOSupport,loadBitmap(R.drawable.frigate_outline),mButtonSize);
  mBuildTargetPainters[3]=Painter.CreateMinSize(gl,mVBOSupport,loadBitmap(R.drawable.upgrade_outline),mButtonSize);
}
Program: 83612
Project: 83612
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) {
    Log.i("String_Node_Str",String.format("String_Node_Str",event.getPointerCount()));
    if (mGame.getState() == Game.State.IN_PROGRESS) {
      for (int i=0; i < event.getPointerCount(); i++) {
        float x=event.getX(i);
        float y=event.getY(i);
        Log.i("String_Node_Str",String.format("String_Node_Str",x,y));
        int numBuildTargets=Player.BuildTarget.values().length - 1;
        int selection;
        int player=-1;
        if (mRotation % 2 == 0) {
          if (y >= getHeight() * 0.67) {
            player=0;
          }
 else           if (y < getHeight() * 0.33) {
            player=1;
          }
          selection=(int)(x * numBuildTargets / getWidth());
        }
 else {
          if (x >= getWidth() * 0.67) {
            player=0;
          }
 else           if (x < getWidth() * 0.33) {
            player=1;
          }
          selection=(numBuildTargets - 1) - (int)(y * numBuildTargets / getHeight());
        }
        Log.i("String_Node_Str",String.format("String_Node_Str",selection));
        if (player == 1) {
          selection=(numBuildTargets - 1) - selection;
        }
        if (player != -1) {
          mGame.setBuildTarget(player,Player.BuildTarget.values()[selection]);
        }
      }
    }
 else {
      mGame.restart();
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) {
    Log.i("String_Node_Str",String.format("String_Node_Str",event.getPointerCount()));
    if (mGame.getState() == Game.State.IN_PROGRESS) {
      for (int i=0; i < event.getPointerCount(); i++) {
        float x=event.getX(i);
        float y=event.getY(i);
        Log.i("String_Node_Str",String.format("String_Node_Str",x,y));
        int numBuildTargets=Player.BuildTarget.values().length - 1;
        int selection;
        int player=-1;
        int xGridPos=(int)(x * 4 / getWidth());
        int yGridPos=(int)(y * 4 / getHeight());
        if (mRotation % 2 == 0) {
          player=((mRotation == 0) ^ (yGridPos < 2)) ? 0 : 1;
          selection=(int)(x * numBuildTargets / getWidth());
        }
 else {
          player=((mRotation == 1) ^ (xGridPos < 2)) ? 0 : 1;
          selection=(numBuildTargets - 1) - (int)(y * numBuildTargets / getHeight());
        }
        Log.i("String_Node_Str",String.format("String_Node_Str",selection));
        if ((player == 1) ^ (mRotation >= 2)) {
          selection=(numBuildTargets - 1) - selection;
        }
        if (player != -1) {
          mGame.setBuildTarget(player,Player.BuildTarget.values()[selection]);
        }
      }
    }
 else {
      mGame.restart();
    }
  }
  return true;
}
Program: 83616
Project: 83616
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) {
    Log.i("String_Node_Str",String.format("String_Node_Str",event.getPointerCount()));
    if (mGame.getState() == Game.State.IN_PROGRESS) {
      for (int i=0; i < event.getPointerCount(); i++) {
        float x=event.getX(i);
        float y=event.getY(i);
        Log.i("String_Node_Str",String.format("String_Node_Str",x,y));
        int numBuildTargets=Player.BuildTarget.values().length - 1;
        int selection;
        if (mRotation % 2 == 0) {
          selection=(int)(x * numBuildTargets / getWidth());
        }
 else {
          selection=(numBuildTargets - 1) - (int)(y * numBuildTargets / getHeight());
        }
        Log.i("String_Node_Str",String.format("String_Node_Str",selection));
        Player.BuildTarget buildTarget=Player.BuildTarget.NONE;
        if (selection < numBuildTargets) {
          buildTarget=Player.BuildTarget.values()[selection];
        }
        mGame.setBuildTarget(0,buildTarget);
      }
    }
 else {
      mGame.restart();
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) {
    Log.i("String_Node_Str",String.format("String_Node_Str",event.getPointerCount()));
    if (mGame.getState() == Game.State.IN_PROGRESS) {
      for (int i=0; i < event.getPointerCount(); i++) {
        float x=event.getX(i);
        float y=event.getY(i);
        Log.i("String_Node_Str",String.format("String_Node_Str",x,y));
        int numBuildTargets=Player.BuildTarget.values().length - 1;
        int selection=numBuildTargets;
        if (mRotation % 2 == 0) {
          if (y >= getHeight() * 0.67) {
            selection=(int)(x * numBuildTargets / getWidth());
          }
        }
 else {
          if (x >= getWidth() * 0.67) {
            selection=(numBuildTargets - 1) - (int)(y * numBuildTargets / getHeight());
          }
        }
        Log.i("String_Node_Str",String.format("String_Node_Str",selection));
        if (selection < numBuildTargets) {
          mGame.setBuildTarget(0,Player.BuildTarget.values()[selection]);
        }
      }
    }
 else {
      mGame.restart();
    }
  }
  return true;
}
Program: 83617
Project: 83617
Buggy source:
@Override public void onDrawFrame(GL10 gl){
  mGame.update();
  if (mBackgroundPainter != null) {
    mBackgroundPainter.draw(gl,0,0,0f);
  }
 else {
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    gl.glClearColor(BG_RGB[0],BG_RGB[1],BG_RGB[2],1.0f);
  }
  for (  int entityType : ENTITY_LAYERS) {
    for (int i=0; i < Game.NUM_PLAYERS; i++) {
      Player player=mGame.mPlayers[i];
      Painter[] painters=mPlayerEntityPainters.get(player);
      for (      Entity entity : player.mEntities[entityType]) {
        painters[entityType].draw(gl,entity);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onDrawFrame(GL10 gl){
  mGame.update();
  if (mBackgroundPainter != null) {
    mBackgroundPainter.draw(gl,0,0,0f);
  }
 else {
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    gl.glClearColor(BG_RGB[0],BG_RGB[1],BG_RGB[2],1.0f);
  }
  for (  int entityType : ENTITY_LAYERS) {
    for (int i=0; i < Game.NUM_PLAYERS; i++) {
      Player player=mGame.mPlayers[i];
      Painter[] painters=mPlayerEntityPainters.get(player);
      for (      Entity entity : player.mEntities[entityType]) {
        painters[entityType].setCameraRotationDegrees(90 * mRotation);
        painters[entityType].draw(gl,entity);
      }
    }
  }
  float dx=mGameWidth / 4;
  float dy=mGameHeight / 4;
  float x=(dx - mGameWidth) / 2;
  float y=(dy - mGameHeight) / 2;
  if (mRotation % 2 == 0) {
    dy=0;
    y=(mButtonSize - mGameHeight) / 2;
  }
 else {
    dx=0;
    x=(mGameWidth - mButtonSize) / 2;
  }
  for (int i=0; i < 4; i++) {
    if (i == mGame.mPlayers[0].mBuildTarget.ordinal()) {
      mHighlight.draw(gl,x,y,90 * mRotation);
    }
    mBuildTargetPainters[i].draw(gl,x,y,90 * mRotation);
    x+=dx;
    y+=dy;
  }
}
Program: 83618
Project: 83618
Buggy source:
@Override public void onSurfaceChanged(GL10 gl,int width,int height){
  gl.glViewport(0,0,width,height);
  Log.v(Pax.TAG,String.format("String_Node_Str",width,height));
  if (Pax.BACKGROUND_IMAGE) {
    mBackgroundPainter=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(mContext.getResources(),R.drawable.background),Math.max(width,height));
  }
  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();
  mWidth=width;
  mHeight=height;
  float halfScale=Math.max(width,height) / (GAME_VIEW_SIZE * 2);
  float halfX=width * halfScale;
  float halfY=height * halfScale;
  GLU.gluOrtho2D(gl,-halfX,halfX,-halfY,halfY);
  gl.glMatrixMode(GL10.GL_MODELVIEW);
  gl.glLoadIdentity();
}

Fixed version (ground truth):
@Override public void onSurfaceChanged(GL10 gl,int width,int height){
  gl.glViewport(0,0,width,height);
  Log.v(Pax.TAG,String.format("String_Node_Str",width,height));
  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();
  mWidth=width;
  mHeight=height;
  float maxDimension=Math.max(width,height);
  mGameWidth=GAME_VIEW_SIZE * width / maxDimension;
  mGameHeight=GAME_VIEW_SIZE * height / maxDimension;
  float halfX=mGameWidth / 2;
  float halfY=mGameHeight / 2;
  GLU.gluOrtho2D(gl,-halfX,halfX,-halfY,halfY);
  gl.glMatrixMode(GL10.GL_MODELVIEW);
  gl.glLoadIdentity();
  float highlightWidth=Math.min(mGameWidth,mGameHeight) / 4;
  mButtonSize=Math.max(mGameWidth,mGameHeight) / 15;
  Resources res=mContext.getResources();
  if (Pax.BACKGROUND_IMAGE) {
    mBackgroundPainter=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.background),Math.max(mGameWidth,mGameHeight));
  }
  mHighlight=Painter.CreateSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.white20),highlightWidth,mButtonSize);
  mBuildTargetPainters=new Painter[4];
  mBuildTargetPainters[0]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.fighter_outline),mButtonSize);
  mBuildTargetPainters[1]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.bomber_outline),mButtonSize);
  mBuildTargetPainters[2]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.frigate_outline),mButtonSize);
  mBuildTargetPainters[3]=Painter.CreateMinSize(gl,mVBOSupport,BitmapFactory.decodeResource(res,R.drawable.upgrade_outline),mButtonSize);
}
Program: 83619
Project: 83619
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) {
    Log.i("String_Node_Str",String.format("String_Node_Str",event.getPointerCount()));
    if (mGame.getState() == Game.State.IN_PROGRESS) {
      for (int i=0; i < event.getPointerCount(); i++) {
        float x=event.getX(i);
        float y=event.getY(i);
        Log.i("String_Node_Str",String.format("String_Node_Str",x,y));
        int numBuildTargets=Player.BuildTarget.values().length - 1;
        int selection=(int)(x * numBuildTargets / getWidth());
        Log.i("String_Node_Str",String.format("String_Node_Str",selection));
        Player.BuildTarget buildTarget=Player.BuildTarget.NONE;
        if (selection < numBuildTargets) {
          buildTarget=Player.BuildTarget.values()[selection];
        }
        mGame.setBuildTarget(0,buildTarget);
      }
    }
 else {
      mGame.restart();
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) {
    Log.i("String_Node_Str",String.format("String_Node_Str",event.getPointerCount()));
    if (mGame.getState() == Game.State.IN_PROGRESS) {
      for (int i=0; i < event.getPointerCount(); i++) {
        float x=event.getX(i);
        float y=event.getY(i);
        Log.i("String_Node_Str",String.format("String_Node_Str",x,y));
        int numBuildTargets=Player.BuildTarget.values().length - 1;
        int selection;
        if (mRotation % 2 == 0) {
          selection=(int)(x * numBuildTargets / getWidth());
        }
 else {
          selection=(numBuildTargets - 1) - (int)(y * numBuildTargets / getHeight());
        }
        Log.i("String_Node_Str",String.format("String_Node_Str",selection));
        Player.BuildTarget buildTarget=Player.BuildTarget.NONE;
        if (selection < numBuildTargets) {
          buildTarget=Player.BuildTarget.values()[selection];
        }
        mGame.setBuildTarget(0,buildTarget);
      }
    }
 else {
      mGame.restart();
    }
  }
  return true;
}
Program: 83620
Project: 83620
Buggy source:
public GameView(Activity activity,Game game){
  super(activity);
  mGame=game;
  mContext=activity;
  mRenderer=new GameRenderer(activity,mGame);
  setEGLConfigChooser(false);
  setRenderer(mRenderer);
}

Fixed version (ground truth):
public GameView(Activity activity,Game game){
  super(activity);
  mGame=game;
  mContext=activity;
  mRenderer=new GameRenderer(activity,mGame);
  setEGLConfigChooser(false);
  setRenderer(mRenderer);
  updateRotation();
}
Program: 83621
Project: 83621
Buggy source:
public void draw(GL10 gl,float moveX,float moveY,float rotateDegrees){
  gl.glLoadIdentity();
  gl.glFrontFace(GL10.GL_CW);
  gl.glBindTexture(GL10.GL_TEXTURE_2D,mTextureID);
  if (mVBOSupport) {
    gl.glEnableClientState(GL10.GL_TEXTURE_2D);
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
    GL11 gl11=(GL11)gl;
    gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER,mVertexBufferObjectID);
    gl11.glVertexPointer(2,GL10.GL_FLOAT,0,0);
    gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER,mTextureBufferObjectID);
    gl11.glTexCoordPointer(2,GL10.GL_FLOAT,0,0);
    gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER,mElementBufferObjectID);
  }
 else {
    gl.glVertexPointer(2,GL10.GL_FLOAT,0,vertexBuffer);
    gl.glTexCoordPointer(2,GL10.GL_FLOAT,0,textureBuffer);
  }
  gl.glTranslatef(moveX,moveY,0f);
  gl.glRotatef(rotateDegrees,0f,0f,1f);
  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP,0,vertices.length / 2);
}

Fixed version (ground truth):
public void draw(GL10 gl,float moveX,float moveY,float rotateDegrees){
  gl.glLoadIdentity();
  gl.glRotatef(mCameraRotationDegrees,0f,0f,1f);
  gl.glFrontFace(GL10.GL_CW);
  gl.glBindTexture(GL10.GL_TEXTURE_2D,mTextureID);
  if (mVBOSupport) {
    gl.glEnableClientState(GL10.GL_TEXTURE_2D);
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
    GL11 gl11=(GL11)gl;
    gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER,mVertexBufferObjectID);
    gl11.glVertexPointer(2,GL10.GL_FLOAT,0,0);
    gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER,mTextureBufferObjectID);
    gl11.glTexCoordPointer(2,GL10.GL_FLOAT,0,0);
    gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER,mElementBufferObjectID);
  }
 else {
    gl.glVertexPointer(2,GL10.GL_FLOAT,0,vertexBuffer);
    gl.glTexCoordPointer(2,GL10.GL_FLOAT,0,textureBuffer);
  }
  gl.glTranslatef(moveX,moveY,0f);
  gl.glRotatef(rotateDegrees,0f,0f,1f);
  gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP,0,vertices.length / 2);
}
Program: 83622
Project: 83622
Buggy source:
private int addShip(int type){
  int id=Entity.NO_ENTITY;
  Ship ship=null;
switch (type) {
case Entity.FIGHTER:
    ship=new Fighter();
  break;
case Entity.BOMBER:
ship=new Bomber();
break;
case Entity.FRIGATE:
ship=new Frigate();
break;
case Entity.FACTORY:
ship=new Factory();
break;
}
if (ship != null) {
id=mEntities[type].add(ship);
if (type != Entity.FACTORY) {
Ship factory=(Ship)mEntities[Entity.FACTORY].get(0);
float spawnX, spawnY;
spawnX=factory.body.center.x + (float)(55 * Math.cos(factory.heading));
spawnY=factory.body.center.y + (float)(55 * Math.sin(factory.heading));
ship.body.center.set(spawnX,spawnY);
ship.heading=factory.heading;
}
 else {
float offset=(float)Math.PI / 40;
float orbitRadius=320 / 3;
float spacing=(float)(2 * Math.PI / totalPlayers);
float theta=spacing * (float)(playerNo);
float factoryX=(float)(orbitRadius * Math.cos(theta));
float factoryY=(float)(orbitRadius * Math.sin(theta));
ship.body.center.set(factoryX,factoryY);
ship.heading=theta - (float)Math.PI / 2 - offset;
}
}
return id;
}

Fixed version (ground truth):
private int addShip(int type){
  int id=Entity.NO_ENTITY;
  Ship ship=null;
switch (type) {
case Entity.FIGHTER:
    ship=new Fighter();
  break;
case Entity.BOMBER:
ship=new Bomber();
break;
case Entity.FRIGATE:
ship=new Frigate();
break;
case Entity.FACTORY:
ship=new Factory();
break;
}
if (ship != null) {
id=mEntities[type].add(ship);
if (type != Entity.FACTORY) {
Ship factory=(Ship)mEntities[Entity.FACTORY].get(0);
float spawnX, spawnY;
spawnX=factory.body.center.x + (float)(55 * Math.cos(factory.heading));
spawnY=factory.body.center.y + (float)(55 * Math.sin(factory.heading));
ship.body.center.set(spawnX,spawnY);
ship.heading=factory.heading;
}
 else {
float offset=(float)Math.PI / 40;
float orbitRadius=GameRenderer.GAME_VIEW_SIZE / 4;
float spacing=(float)(2 * Math.PI / totalPlayers);
float theta=spacing * (float)(playerNo) - (float)(Math.PI / 2);
float factoryX=(float)(orbitRadius * Math.cos(theta));
float factoryY=(float)(orbitRadius * Math.sin(theta));
ship.body.center.set(factoryX,factoryY);
ship.heading=theta - (float)Math.PI / 2 - offset;
}
}
return id;
}
Program: 83623
Project: 83623
Buggy source:
public void updateOrientation(int orientation){
  if (orientation != mOrientation) {
    mOrientation=orientation;
    mAngleFudge=(mOrientation == Configuration.ORIENTATION_LANDSCAPE) ? (float)(-Math.PI / 2) : 0.0f;
    int temp=mWidth;
    mWidth=mHeight;
    mHeight=temp;
  }
}

Fixed version (ground truth):
public void updateOrientation(){
  Display display=((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
  mRotation=display.getRotation();
switch (mRotation) {
case Surface.ROTATION_0:
    mAngleFudge=0;
  break;
case Surface.ROTATION_90:
mAngleFudge=(float)-Math.PI * 0.5f;
break;
case Surface.ROTATION_180:
mAngleFudge=(float)-Math.PI;
break;
case Surface.ROTATION_270:
mAngleFudge=(float)-Math.PI * 1.5f;
break;
}
mWidth=display.getWidth();
mHeight=display.getHeight();
}
Program: 83626
Project: 83626
Buggy source:
@Override public void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  mView.updateOrientation(newConfig.orientation);
}

Fixed version (ground truth):
@Override public void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  mView.updateOrientation();
}
Program: 83627
Project: 83627
Buggy source:
private int addShip(int type){
  int id=Entity.NO_ENTITY;
  Ship ship=null;
switch (type) {
case Entity.FIGHTER:
    ship=new Fighter();
  break;
case Entity.BOMBER:
ship=new Bomber();
break;
case Entity.FRIGATE:
ship=new Frigate();
break;
case Entity.FACTORY:
ship=new Factory();
break;
}
if (ship != null) {
id=mEntities[type].add(ship);
if (type != Entity.FACTORY) {
Ship factory=(Ship)mEntities[Entity.FACTORY].get(0);
float spawnX, spawnY;
spawnX=factory.body.center.x + (float)(55 * Math.cos(factory.heading));
spawnY=factory.body.center.y + (float)(55 * Math.sin(factory.heading));
ship.body.center.set(spawnX,spawnY);
ship.heading=factory.heading;
}
 else {
float factoryX=0, factoryY=0;
float offset=(float)Math.PI / 40;
Display display=((WindowManager)Pax.thisContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
PointF screenSize=new PointF(display.getWidth(),display.getHeight());
float orbitRadius=screenSize.x * 1 / 3;
float spacing=(float)(2 * Math.PI / totalPlayers);
float theta=spacing * (float)(-.5 + playerNo);
factoryX=screenSize.x / 2 + (float)(orbitRadius * Math.cos(theta));
factoryY=screenSize.y / 2 + (float)(orbitRadius * Math.sin(theta));
ship.body.center.set(factoryX,factoryY);
ship.heading=theta - (float)Math.PI / 2 - offset;
}
}
return id;
}

Fixed version (ground truth):
private int addShip(int type){
  int id=Entity.NO_ENTITY;
  Ship ship=null;
switch (type) {
case Entity.FIGHTER:
    ship=new Fighter();
  break;
case Entity.BOMBER:
ship=new Bomber();
break;
case Entity.FRIGATE:
ship=new Frigate();
break;
case Entity.FACTORY:
ship=new Factory();
break;
}
if (ship != null) {
id=mEntities[type].add(ship);
if (type != Entity.FACTORY) {
Ship factory=(Ship)mEntities[Entity.FACTORY].get(0);
float spawnX, spawnY;
spawnX=factory.body.center.x + (float)(55 * Math.cos(factory.heading));
spawnY=factory.body.center.y + (float)(55 * Math.sin(factory.heading));
ship.body.center.set(spawnX,spawnY);
ship.heading=factory.heading;
}
 else {
float factoryX=0, factoryY=0;
float offset=(float)Math.PI / 40;
Display display=((WindowManager)Pax.thisContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
float screenX=Math.min(display.getWidth(),display.getHeight());
float screenY=Math.max(display.getWidth(),display.getHeight());
float orbitRadius=screenX / 3;
float spacing=(float)(2 * Math.PI / totalPlayers);
float theta=spacing * (float)(-.5 + playerNo);
factoryX=screenX / 2 + (float)(orbitRadius * Math.cos(theta));
factoryY=screenY / 2 + (float)(orbitRadius * Math.sin(theta));
ship.body.center.set(factoryX,factoryY);
ship.heading=theta - (float)Math.PI / 2 - offset;
}
}
return id;
}
Program: 83628
Project: 83628
Buggy source:
public void attack(Player victim){
  for (  Entity.Type victimShipType : Ship.TYPES) {
    Point2 p=victim.mBodies.get(victimShipType).collide(body.center,body.radius);
    if (p != null) {
      assert(p.id != Entity.NO_ENTITY);
      Ship victimShip=(Ship)victim.mEntities.get(victimShipType).get(id);
      int damage=health;
      damage*=100;
      health-=damage;
      victimShip.health-=damage;
      if (victimShip.health <= 0) {
        victim.mBodies.get(victimShipType).remove(victimShip.body.center);
      }
      break;
    }
  }
}

Fixed version (ground truth):
public void attack(Player victim){
  for (  Entity.Type victimShipType : Ship.TYPES) {
    Point2 p=victim.mBodies.get(victimShipType).collide(body.center,body.radius);
    if (p != null) {
      assert(p.id != Entity.NO_ENTITY);
      Ship victimShip=(Ship)victim.mEntities.get(victimShipType).get(p.id);
      int damage=health;
      damage*=100;
      health-=damage;
      victimShip.health-=damage;
      if (victimShip.health <= 0) {
        victim.mBodies.get(victimShipType).remove(victimShip.body.center);
      }
      break;
    }
  }
}
Program: 83629
Project: 83629
Buggy source:
private static int partition(boolean dimension,Point2[] points,int minIndex,int maxIndex,float pivotValue){
  int hole=minIndex;
  for (int i=minIndex; i < maxIndex; i++) {
    float q=(dimension == X) ? points[i].x : points[i].y;
    if (q < pivotValue) {
      Point2 temp=points[hole];
      points[hole]=points[i];
      points[i]=temp;
      hole++;
    }
  }
  return hole;
}

Fixed version (ground truth):
private static int partition(boolean dimension,Point2[] points,int minIndex,int maxIndex){
  float min=0;
  float max=0;
  boolean first=true;
  for (int i=minIndex; i < maxIndex; i++) {
    float q=(dimension == X) ? points[i].x : points[i].y;
    if (first) {
      min=q;
      max=q;
      first=false;
    }
 else     if (q < min) {
      min=q;
    }
 else     if (q > max) {
      max=q;
    }
  }
  float pivotValue=(min + max) / 2;
  int hole=minIndex;
  for (int i=minIndex; i < maxIndex; i++) {
    float q=(dimension == X) ? points[i].x : points[i].y;
    if (q < pivotValue) {
      Point2 temp=points[hole];
      points[hole]=points[i];
      points[i]=temp;
      hole++;
    }
  }
  return hole;
}
Program: 83630
Project: 83630
Buggy source:
public void reset(int minIndex,int maxIndex){
  mMinIndex=minIndex;
  mMaxIndex=maxIndex;
  isLeaf=(mMaxIndex - mMinIndex) <= MAX_SIZE;
  boolean first=true;
  for (int i=mMinIndex; i < mMaxIndex; i++) {
    float q=(mDimension == X) ? mPoints[i].x : mPoints[i].y;
    if (first) {
      mMinVal=q;
      mMaxVal=q;
      first=false;
    }
 else     if (q < mMinVal) {
      mMinVal=q;
    }
 else     if (q > mMaxVal) {
      mMaxVal=q;
    }
  }
  if (!isLeaf) {
    float pivotValue=(mMinVal + mMaxVal) / 2;
    int pivotIndex=partition(mDimension,mPoints,mMinIndex,mMaxIndex,pivotValue);
    if (low == null) {
      low=new Quadtree(!mDimension,mEntrySize,mPoints);
    }
    if (high == null) {
      high=new Quadtree(!mDimension,mEntrySize,mPoints);
    }
    low.reset(mMinIndex,pivotIndex);
    high.reset(pivotIndex,mMaxIndex);
  }
 else {
    low=null;
    high=null;
  }
}

Fixed version (ground truth):
public void reset(int minIndex,int maxIndex){
  mMinIndex=minIndex;
  mMaxIndex=maxIndex;
  isLeaf=(mMaxIndex - mMinIndex) <= MAX_SIZE;
  boolean first=true;
  for (int i=mMinIndex; i < mMaxIndex; i++) {
    float q=(mDimension == X) ? mPoints[i].x : mPoints[i].y;
    if (first) {
      mMinVal=q;
      mMaxVal=q;
      first=false;
    }
 else     if (q < mMinVal) {
      mMinVal=q;
    }
 else     if (q > mMaxVal) {
      mMaxVal=q;
    }
  }
  if (!isLeaf) {
    int pivotIndex=partition(!mDimension,mPoints,mMinIndex,mMaxIndex);
    if (low == null) {
      low=new Quadtree(!mDimension,mEntrySize,mPoints);
    }
    if (high == null) {
      high=new Quadtree(!mDimension,mEntrySize,mPoints);
    }
    low.reset(mMinIndex,pivotIndex);
    high.reset(pivotIndex,mMaxIndex);
  }
 else {
    low=null;
    high=null;
  }
  mIsValid=true;
}
Program: 83631
Project: 83631
Buggy source:
public boolean remove(Point2 point){
  boolean removed=false;
  if (isLeaf) {
    for (int i=mMinIndex; i < mMaxIndex && !removed; i++) {
      if (mPoints[i].equals(point)) {
        mMaxIndex--;
        mPoints[i]=mPoints[mMaxIndex];
        mPoints[mMaxIndex]=null;
        removed=true;
      }
    }
  }
 else {
    float q=(low.mDimension == X) ? point.x : point.y;
    if (q >= low.mMinVal && q <= low.mMaxVal) {
      removed=low.remove(point);
    }
 else     if (q >= high.mMinVal && q <= high.mMaxVal) {
      removed=high.remove(point);
    }
  }
  return removed;
}

Fixed version (ground truth):
public boolean remove(Point2 point){
  assert(mIsValid);
  boolean removed=false;
  Log.v("String_Node_Str",String.format("String_Node_Str",point.x,point.y,point.id));
  if (isLeaf) {
    Log.v("String_Node_Str",String.format("String_Node_Str",mDimension ? 0 : 1,mMinVal,mMaxVal,mMaxIndex - mMinIndex));
    for (int i=mMinIndex; i < mMaxIndex && !removed; i++) {
      if (mPoints[i].equals(point)) {
        mMaxIndex--;
        mPoints[i]=mPoints[mMaxIndex];
        mPoints[mMaxIndex]=null;
        removed=true;
      }
 else       if (mPoints[i].x == point.x && mPoints[i].y == point.y) {
        Log.i("String_Node_Str",String.format("String_Node_Str",point.x,point.y,point.id,mPoints[i].id));
      }
 else       if (mPoints[i].id == point.id) {
        Log.i("String_Node_Str",String.format("String_Node_Str",point.x,point.y,mPoints[i].x,mPoints[i].y,point.id));
      }
    }
  }
 else {
    Log.v("String_Node_Str",String.format("String_Node_Str",mMaxIndex - mMinIndex));
    float q=(low.mDimension == X) ? point.x : point.y;
    if (q >= low.mMinVal && q <= low.mMaxVal) {
      removed=low.remove(point);
    }
 else     if (q >= high.mMinVal && q <= high.mMaxVal) {
      removed=high.remove(point);
    }
  }
  return removed;
}
Program: 83633
Project: 83633
Buggy source:
private void sarsa(int reward,Weights weights,double Qsa,int[][] internal_board,Rules gameRules,int player_id){
  double eta=0.9;
  double gamma=0.9;
  FeatureExplorer f=new FeatureExplorer();
  double[] features=new double[FeatureExplorer.getNumFeatures()];
  double[] w=weights.getWeights();
  double wx=0;
  double sig=0;
  double xx=0;
  double Qsa_new=0;
  f.initialize(internal_board,gameRules.numRows,gameRules.numCols,-1,player_id);
  features=f.getFeatures();
  for (int x=0; x < f.getNumFeatures(); x++) {
    wx+=w[x] * features[x];
  }
  sig=sigmoid(wx);
  Qsa_new=Qsa + eta * ((reward + gamma * sig) - Qsa);
  for (int x=0; x < features.length; x++) {
    xx+=features[x] * features[x];
  }
  for (int x=0; x < features.length; x++) {
    w[x]=w[x] - eta * (Qsa - gamma * Qsa_new) * ((Qsa * (1 - Qsa) * features[x]));
  }
  weights.setWeights(w);
}

Fixed version (ground truth):
private void sarsa(int reward,Weights weights,double Qsa,int[][] internal_board,Rules gameRules,int player_id){
  double eta=0.9;
  double gamma=0.9;
  FeatureExplorer f=new FeatureExplorer();
  double[] features=new double[FeatureExplorer.getNumFeatures()];
  double[] w=weights.getWeights();
  double wx=0;
  double sig=0;
  double xx=0;
  double Qsa_new=0;
  f.initialize(internal_board,gameRules.numRows,gameRules.numCols,-1,player_id);
  features=f.getFeatures();
  for (int x=0; x < f.getNumFeatures(); x++) {
    wx+=w[x] * features[x];
  }
  sig=sigmoid(wx);
  Qsa_new=Qsa + eta * ((reward + gamma * sig) - Qsa);
  for (int x=0; x < features.length; x++) {
    xx+=features[x] * features[x];
  }
  for (int x=0; x < features.length; x++) {
    w[x]=w[x] + eta * ((Qsa_new - Qsa) * Qsa * (1 - Qsa)* features[x]);
  }
  weights.setWeights(w);
}
Program: 83634
Project: 83634
Buggy source:
/** 
 * Read Location and owner information from the given ConfigurationSection. Does basic validation on the World named in the section. Uses the static keys defined in this class for information retrieval from the section. On completion, this Warp will be populated with the information retrieved from the section, if that information is valid.
 * @param section The ConfigurationSection from which to read information.
 */
private void parseConfiguration(ConfigurationSection section){
  String worldName=section.getString(WORLD_KEY);
  if (worldName == null) {
    OpenWarp.LOG.severe(OpenWarp.LOG_PREFIX + "String_Node_Str" + this.name);
  }
  double x=section.getDouble(X_KEY,0.0);
  double y=section.getDouble(Y_KEY,0.0);
  double z=section.getDouble(Z_KEY,0.0);
  float pitch=(float)section.getDouble(PITCH_KEY,0.0);
  float yaw=(float)section.getDouble(YAW_KEY,0.0);
  World world=null;
  if (worldName != null) {
    world=this.plugin.getServer().getWorld(worldName);
    if (world == null) {
      OpenWarp.LOG.severe(OpenWarp.LOG_PREFIX + "String_Node_Str" + worldName+ "String_Node_Str");
    }
  }
  this.location=new Location(world,x,y,z,yaw,pitch);
  this.owner=section.getString(OWNER_KEY,"String_Node_Str");
  this.invitees=section.getStringList(INVITEES_KEY);
}

Fixed version (ground truth):
/** 
 * Read Location and owner information from the given value Map. Does basic validation on the World named in the map. Uses the static keys defined in this class for information retrieval from the map. On completion, this Warp will be populated with the information retrieved from the map, if that information is valid.
 * @param values The Map of values from which to read information.
 */
private void parseConfiguration(Map<String,Object> values){
  String worldName=(String)values.get(WORLD_KEY);
  if (worldName == null) {
    OpenWarp.LOG.severe(OpenWarp.LOG_PREFIX + "String_Node_Str" + this.name);
  }
  double x=values.containsKey(X_KEY) ? (Double)values.get(X_KEY) : 0.0;
  double y=values.containsKey(Y_KEY) ? (Double)values.get(Y_KEY) : 0.0;
  double z=values.containsKey(Z_KEY) ? (Double)values.get(Z_KEY) : 0.0;
  float pitch=values.containsKey(PITCH_KEY) ? (float)((double)(Double)values.get(PITCH_KEY)) : 0.0f;
  float yaw=values.containsKey(YAW_KEY) ? (float)((double)(Double)values.get(YAW_KEY)) : 0.0f;
  World world=null;
  if (worldName != null) {
    world=this.plugin.getServer().getWorld(worldName);
    if (world == null) {
      OpenWarp.LOG.severe(OpenWarp.LOG_PREFIX + "String_Node_Str" + worldName+ "String_Node_Str");
    }
  }
  this.location=new Location(world,x,y,z,yaw,pitch);
  this.owner=values.containsKey(OWNER_KEY) ? (String)values.get(OWNER_KEY) : "String_Node_Str";
  this.invitees=values.containsKey(INVITEES_KEY) ? (List<String>)values.get(INVITEES_KEY) : new ArrayList<String>();
}
Program: 83635
Project: 83635
Buggy source:
/** 
 * Load warp information from the given Configuration into the given Map. Mutates the `target` argument.
 * @param config The Configuration from which to read warps
 * @param target The Map into which to place Warp instances
 */
public void loadWarps(Configuration config,Map<String,Warp> target){
  ConfigurationSection warpSection=config.getConfigurationSection(WARPS_LIST_KEY);
  Set<String> keys=warpSection.getKeys(false);
  if (keys != null) {
    for (    String key : keys) {
      ConfigurationSection section=config.getConfigurationSection(WARPS_LIST_KEY + "String_Node_Str" + key);
      Warp warp=new Warp(this.plugin,key,section);
      target.put(warp.getName(),warp);
    }
  }
}

Fixed version (ground truth):
/** 
 * Load warp information from the given Configuration into the given Map. Mutates the `target` argument.
 * @param config The Configuration from which to read warps
 * @param target The Map into which to place Warp instances
 */
public void loadWarps(Configuration config,Map<String,Warp> target){
  ConfigurationSection warpSection=config.getConfigurationSection(WARPS_LIST_KEY);
  if (warpSection != null) {
    Set<String> keys=warpSection.getKeys(false);
    if (keys != null) {
      for (      String key : keys) {
        ConfigurationSection section=config.getConfigurationSection(WARPS_LIST_KEY + "String_Node_Str" + key);
        Warp warp=new Warp(this.plugin,key,section);
        target.put(warp.getName(),warp);
      }
    }
  }
}
Program: 83639
Project: 83639
Buggy source:
@Override public void runCommand(CommandSender sender,List<String> args){
  if (!this.checkPlayerSender(sender))   return;
  Player player=(Player)sender;
  String warpName=args.get(0);
  Warp target=this.getPlugin().getWarp(sender,warpName);
  if (target == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
    return;
  }
  if (target.getOwner().equalsIgnoreCase(player.getName())) {
    String permString="String_Node_Str";
    if (target.isPublic()) {
      permString="String_Node_Str" + warpName;
    }
 else {
      permString="String_Node_Str" + target.getOwner() + "String_Node_Str"+ warpName;
    }
    if (!this.getPlugin().getPermissionsHandler().hasPermission(sender,permString,!target.isPublic())) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      return;
    }
  }
 else {
    if (!target.isInvited(player)) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      OpenWarp.DEBUG_LOG.warning("String_Node_Str");
      OpenWarp.DEBUG_LOG.warning("String_Node_Str" + player.getName() + "String_Node_Str"+ target.getName()+ "String_Node_Str"+ target.getOwner());
      return;
    }
  }
  if (target.getLocation().getWorld() == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str");
  }
  if (!player.teleport(target.getLocation())) {
    player.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
  }
}

Fixed version (ground truth):
@Override public void runCommand(CommandSender sender,List<String> args){
  if (!this.checkPlayerSender(sender))   return;
  Player player=(Player)sender;
  String warpName=args.get(0);
  Warp target=this.getPlugin().getWarp(sender,warpName);
  if (target == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
    return;
  }
  if (target.getOwner().equalsIgnoreCase(player.getName()) || target.isPublic()) {
    String permString="String_Node_Str";
    if (target.isPublic()) {
      permString="String_Node_Str" + warpName;
    }
 else {
      permString="String_Node_Str" + target.getOwner() + "String_Node_Str"+ warpName;
    }
    if (!this.getPlugin().getPermissionsHandler().hasPermission(sender,permString,!target.isPublic())) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      return;
    }
  }
 else {
    if (!target.isInvited(player)) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      OpenWarp.DEBUG_LOG.warning("String_Node_Str");
      OpenWarp.DEBUG_LOG.warning("String_Node_Str" + player.getName() + "String_Node_Str"+ target.getName()+ "String_Node_Str"+ target.getOwner());
      return;
    }
  }
  if (target.getLocation().getWorld() == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str");
  }
  if (!player.teleport(target.getLocation())) {
    player.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
  }
}
Program: 83640
Project: 83640
Buggy source:
@Override public void onEnable(){
  this.getDataFolder().mkdirs();
  this.getServer().getPluginManager().addPermission(new Permission("String_Node_Str",PermissionDefault.OP));
  Permission wildcardPerm=this.getServer().getPluginManager().getPermission("String_Node_Str");
  if (wildcardPerm != null) {
    wildcardPerm.getChildren().put("String_Node_Str",true);
    wildcardPerm.recalculatePermissibles();
  }
  this.locationTracker=new OWLocationTracker(this);
  this.configuration=new Configuration(new File(this.getDataFolder(),MASTER_CONFIG_FILENAME));
  this.configuration.load();
  this.publicWarpsConfig=new Configuration(new File(this.getDataFolder(),PUBLIC_WARP_CONFIG_FILENAME));
  this.publicWarpsConfig.load();
  this.loadWarps(this.publicWarpsConfig,this.publicWarps);
  this.quotaManager=new OWQuotaManager(this);
  this.permissionsHandler=new OWPermissionsHandler(this);
  List<String> playerNames=this.configuration.getStringList(PLAYER_NAMES_LIST_KEY,new ArrayList<String>());
  for (  String playerName : playerNames) {
    this.registerPlayerName(playerName);
  }
  this.quotaManager.loadGlobalQuotas(this.configuration);
  this.loadCommands();
  this.loadWarpPermissions();
  this.loadHomePermissions();
  this.loadListeners();
  LOG.info(LOG_PREFIX + "String_Node_Str" + this.getDescription().getVersion());
}

Fixed version (ground truth):
@Override public void onEnable(){
  this.getDataFolder().mkdirs();
  this.getServer().getPluginManager().addPermission(new Permission("String_Node_Str",PermissionDefault.OP));
  Permission wildcardPerm=this.getServer().getPluginManager().getPermission("String_Node_Str");
  if (wildcardPerm != null) {
    wildcardPerm.getChildren().put("String_Node_Str",true);
    wildcardPerm.recalculatePermissibles();
  }
  this.locationTracker=new OWLocationTracker(this);
  this.configuration=new Configuration(new File(this.getDataFolder(),MASTER_CONFIG_FILENAME));
  this.configuration.load();
  this.publicWarpsConfig=new Configuration(new File(this.getDataFolder(),PUBLIC_WARP_CONFIG_FILENAME));
  this.publicWarpsConfig.load();
  this.loadWarps(this.publicWarpsConfig,this.publicWarps);
  this.quotaManager=new OWQuotaManager(this);
  this.permissionsHandler=new OWPermissionsHandler(this);
  this.quotaManager.loadGlobalQuotas(this.configuration);
  List<String> playerNames=this.configuration.getStringList(PLAYER_NAMES_LIST_KEY,new ArrayList<String>());
  for (  String playerName : playerNames) {
    this.registerPlayerName(playerName);
  }
  this.loadCommands();
  this.loadWarpPermissions();
  this.loadHomePermissions();
  this.loadListeners();
  LOG.info(LOG_PREFIX + "String_Node_Str" + this.getDescription().getVersion());
}
Program: 83641
Project: 83641
Buggy source:
public void setPreviousLocation(Player player,Location location){
  System.out.println("String_Node_Str" + location);
  this.previousLocations.put(player,location);
}

Fixed version (ground truth):
public void setPreviousLocation(Player player,Location location){
  this.previousLocations.put(player,location);
}
Program: 83642
Project: 83642
Buggy source:
private void loadListeners(){
  OWPlayerListener playerListener=new OWPlayerListener(this);
  this.getServer().getPluginManager().registerEvent(Event.Type.PLAYER_JOIN,playerListener,Priority.Low,this);
  OWEntityListener entityListener=new OWEntityListener(this);
  this.getServer().getPluginManager().registerEvent(Event.Type.ENTITY_DEATH,entityListener,Priority.Normal,this);
}

Fixed version (ground truth):
private void loadListeners(){
  OWPlayerListener playerListener=new OWPlayerListener(this);
  this.getServer().getPluginManager().registerEvent(Event.Type.PLAYER_JOIN,playerListener,Priority.Low,this);
  this.getServer().getPluginManager().registerEvent(Event.Type.PLAYER_TELEPORT,playerListener,Priority.Normal,this);
  OWEntityListener entityListener=new OWEntityListener(this);
  this.getServer().getPluginManager().registerEvent(Event.Type.ENTITY_DEATH,entityListener,Priority.Normal,this);
}
Program: 83643
Project: 83643
Buggy source:
@Override public void runCommand(CommandSender sender,List<String> args){
  if (!this.checkPlayerSender(sender))   return;
  Player player=(Player)sender;
  Location loc=this.getPlugin().getLocationTracker().getPreviousLocation(player);
  if (loc == null) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    return;
  }
  if (!player.teleport(loc)) {
    System.out.println("String_Node_Str" + loc);
    player.sendMessage(ChatColor.RED + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void runCommand(CommandSender sender,List<String> args){
  if (!this.checkPlayerSender(sender))   return;
  Player player=(Player)sender;
  Location loc=this.getPlugin().getLocationTracker().getPreviousLocation(player);
  if (loc == null) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
    return;
  }
  if (!player.teleport(loc)) {
    player.sendMessage(ChatColor.RED + "String_Node_Str");
  }
}
Program: 83644
Project: 83644
Buggy source:
@Override public void runCommand(CommandSender sender,List<String> args){
  if (!this.checkPlayerSender(sender))   return;
  Player player=(Player)sender;
  if (args.size() == 0) {
    this.getPlugin().getLocationTracker().getLocationStack(player).push(player.getLocation());
  }
 else {
    String warpName=args.get(0);
    Warp target=this.getPlugin().getWarp(player,warpName);
    if (target == null) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      return;
    }
    String permString="String_Node_Str";
    if (target.isPublic()) {
      permString="String_Node_Str" + warpName;
    }
 else {
      permString="String_Node_Str" + target.getOwner() + "String_Node_Str"+ warpName;
    }
    System.out.println("String_Node_Str" + permString);
    if (!this.getPlugin().getPermissionsHandler().hasPermission(sender,permString,!target.isPublic())) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      return;
    }
    this.getPlugin().getLocationTracker().getLocationStack(player).push(target.getLocation());
    if (!player.teleport(target.getLocation())) {
      player.sendMessage(ChatColor.RED + "String_Node_Str" + warpName+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void runCommand(CommandSender sender,List<String> args){
  if (!this.checkPlayerSender(sender))   return;
  Player player=(Player)sender;
  if (args.size() == 0) {
    this.getPlugin().getLocationTracker().getLocationStack(player).push(player.getLocation());
  }
 else {
    String warpName=args.get(0);
    Warp target=this.getPlugin().getWarp(player,warpName);
    if (target == null) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      return;
    }
    String permString="String_Node_Str";
    if (target.isPublic()) {
      permString="String_Node_Str" + warpName;
    }
 else {
      permString="String_Node_Str" + target.getOwner() + "String_Node_Str"+ warpName;
    }
    if (!this.getPlugin().getPermissionsHandler().hasPermission(sender,permString,!target.isPublic())) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpName);
      return;
    }
    this.getPlugin().getLocationTracker().getLocationStack(player).push(target.getLocation());
    if (!player.teleport(target.getLocation())) {
      player.sendMessage(ChatColor.RED + "String_Node_Str" + warpName+ "String_Node_Str");
    }
  }
}
Program: 83645
Project: 83645
Buggy source:
@Override public void onEntityDeath(EntityDeathEvent event){
  if (event.getEntity() instanceof Player) {
    Player player=(Player)(event.getEntity());
    System.out.println("String_Node_Str" + player.getLocation());
    this.plugin.getLocationTracker().setPreviousLocation(player,player.getLocation());
  }
}

Fixed version (ground truth):
@Override public void onEntityDeath(EntityDeathEvent event){
  if (event.getEntity() instanceof Player) {
    Player player=(Player)(event.getEntity());
    this.plugin.getLocationTracker().setPreviousLocation(player,player.getLocation());
  }
}
Program: 83646
Project: 83646
Buggy source:
@Override public void onPlayerTeleport(PlayerTeleportEvent event){
  System.out.println("String_Node_Str" + event.getFrom());
  this.plugin.getLocationTracker().setPreviousLocation(event.getPlayer(),event.getFrom());
}

Fixed version (ground truth):
@Override public void onPlayerTeleport(PlayerTeleportEvent event){
  this.plugin.getLocationTracker().setPreviousLocation(event.getPlayer(),event.getFrom());
}