nus-yam/ex-repair huggingface dataset:
Program: 91110
Project: 91110
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mHighScoreTextView=(TextView)findViewById(R.id.mainHighScore);
  mNewGameButton=(Button)findViewById(R.id.newGameButton);
  mResetScoreButton=(Button)findViewById(R.id.resetScoreButton);
  mLevelSpinner=(Spinner)findViewById(R.id.levelSpinner);
  mSharedPrefs=PreferenceManager.getDefaultSharedPreferences(getBaseContext());
  ArrayAdapter<CharSequence> adapter=ArrayAdapter.createFromResource(this,R.array.levels,android.R.layout.simple_spinner_item);
  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  mLevelSpinner.setAdapter(adapter);
  mLevelSpinner.setOnItemSelectedListener(this);
  mLevelSpinner.setSelection(2);
  mNewGameButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(getBaseContext(),UI.class);
      startActivity(intent);
    }
  }
);
  mResetScoreButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      SharedPreferences.Editor editor=mSharedPrefs.edit();
      editor.clear();
      editor.commit();
      updateScoreTextView();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mHighScoreTextView=(TextView)findViewById(R.id.mainHighScore);
  mNewGameButton=(Button)findViewById(R.id.newGameButton);
  mResetScoreButton=(Button)findViewById(R.id.resetScoreButton);
  mLevelSpinner=(Spinner)findViewById(R.id.levelSpinner);
  mSharedPrefs=PreferenceManager.getDefaultSharedPreferences(getBaseContext());
  ArrayAdapter<CharSequence> adapter=ArrayAdapter.createFromResource(this,R.array.levels,android.R.layout.simple_spinner_item);
  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  mLevelSpinner.setAdapter(adapter);
  mLevelSpinner.setOnItemSelectedListener(this);
  mLevelSpinner.setSelection(2);
  mNewGameButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(getBaseContext(),UI.class);
      startActivity(intent);
    }
  }
);
  mResetScoreButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      SharedPreferences.Editor editor=mSharedPrefs.edit();
      editor.remove("String_Node_Str");
      editor.commit();
      updateScoreTextView();
    }
  }
);
}
Program: 91111
Project: 91111
Buggy source:
@Override public void onClick(View v){
  SharedPreferences.Editor editor=mSharedPrefs.edit();
  editor.clear();
  editor.commit();
  updateScoreTextView();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  SharedPreferences.Editor editor=mSharedPrefs.edit();
  editor.remove("String_Node_Str");
  editor.commit();
  updateScoreTextView();
}
Program: 91112
Project: 91112
Buggy source:
private void updateUI(){
  mHandler.post(new Runnable(){
    @Override public void run(){
      if (!State.getGameOver()) {
        mScoreTextView.setText(getString(R.string.score) + String.format("String_Node_Str",State.getScore()));
        mScoreMultiplierTextView.setText(getString(R.string.multiplier) + State.getScoreMultiplier() + "String_Node_Str");
        if (State.getScore() > mHighScore) {
          mHighScore=State.getScore();
          mNewHighScore=true;
          mHighScoreTextView.setTextColor(Color.GREEN);
        }
        mHighScoreTextView.setText(getString(R.string.high_score) + String.format("String_Node_Str",mHighScore));
        mLivesTextView.setText(getString(R.string.lives) + State.getLifes());
      }
 else {
        if (mNewHighScore) {
          mSharedPrefsEditor.putLong("String_Node_Str",mHighScore);
          mSharedPrefsEditor.commit();
          mSoundPool.play(mSoundIds.get("String_Node_Str"),100,100,1,0,1.0f);
        }
        showGameOverDialog(State.getScore(),mNewHighScore);
        mFinish=true;
      }
    }
  }
);
}

Fixed version (ground truth):
private void updateUI(){
  mHandler.post(new Runnable(){
    @Override public void run(){
      if (!State.getGameOver()) {
        mScoreTextView.setText(getString(R.string.score) + String.format("String_Node_Str",State.getScore()));
        mScoreMultiplierTextView.setText(getString(R.string.multiplier) + State.getScoreMultiplier() + "String_Node_Str");
        if (State.getScore() > mHighScore) {
          mHighScore=State.getScore();
          mNewHighScore=true;
          mHighScoreTextView.setTextColor(Color.GREEN);
        }
        mHighScoreTextView.setText(getString(R.string.high_score) + String.format("String_Node_Str",mHighScore));
        mLivesTextView.setText(getString(R.string.lives) + State.getLifes());
      }
 else {
        if (mNewHighScore) {
          mSharedPrefsEditor.putLong("String_Node_Str",mHighScore);
          mSharedPrefsEditor.commit();
          mSoundPool.play(mSoundIds.get("String_Node_Str"),100,100,0,0,1.0f);
        }
        showGameOverDialog(State.getScore(),mNewHighScore);
        mFinish=true;
      }
    }
  }
);
}
Program: 91113
Project: 91113
Buggy source:
@Override public void run(){
  if (!State.getGameOver()) {
    mScoreTextView.setText(getString(R.string.score) + String.format("String_Node_Str",State.getScore()));
    mScoreMultiplierTextView.setText(getString(R.string.multiplier) + State.getScoreMultiplier() + "String_Node_Str");
    if (State.getScore() > mHighScore) {
      mHighScore=State.getScore();
      mNewHighScore=true;
      mHighScoreTextView.setTextColor(Color.GREEN);
    }
    mHighScoreTextView.setText(getString(R.string.high_score) + String.format("String_Node_Str",mHighScore));
    mLivesTextView.setText(getString(R.string.lives) + State.getLifes());
  }
 else {
    if (mNewHighScore) {
      mSharedPrefsEditor.putLong("String_Node_Str",mHighScore);
      mSharedPrefsEditor.commit();
      mSoundPool.play(mSoundIds.get("String_Node_Str"),100,100,1,0,1.0f);
    }
    showGameOverDialog(State.getScore(),mNewHighScore);
    mFinish=true;
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!State.getGameOver()) {
    mScoreTextView.setText(getString(R.string.score) + String.format("String_Node_Str",State.getScore()));
    mScoreMultiplierTextView.setText(getString(R.string.multiplier) + State.getScoreMultiplier() + "String_Node_Str");
    if (State.getScore() > mHighScore) {
      mHighScore=State.getScore();
      mNewHighScore=true;
      mHighScoreTextView.setTextColor(Color.GREEN);
    }
    mHighScoreTextView.setText(getString(R.string.high_score) + String.format("String_Node_Str",mHighScore));
    mLivesTextView.setText(getString(R.string.lives) + State.getLifes());
  }
 else {
    if (mNewHighScore) {
      mSharedPrefsEditor.putLong("String_Node_Str",mHighScore);
      mSharedPrefsEditor.commit();
      mSoundPool.play(mSoundIds.get("String_Node_Str"),100,100,0,0,1.0f);
    }
    showGameOverDialog(State.getScore(),mNewHighScore);
    mFinish=true;
  }
}
Program: 91114
Project: 91114
Buggy source:
private void createLevel(int blocksX,int blocksY,float initialX,float initialY,float spaceX,float spaceY){
  mBricks=new Brick[blocksX][blocksY];
  float newPosX=initialX;
  float newPosY=initialY;
  for (int i=0; i < mBricks.length; i++) {
    float sign=-1;
    for (int j=0; j < mBricks[i].length; j++) {
      sign*=-1;
      double prob=Math.random();
      if (prob <= (Brick.MOBILE_BRICK_PROBABILITY + Brick.EXPLOSIVE_BRICK_PROBABILITY + Brick.GRAY_BRICK_PROBABILITY)) {
        if (prob <= Brick.MOBILE_BRICK_PROBABILITY) {
          MobileBrick mBrick=new MobileBrick(Colors.GREEN_GRADIENT,newPosX,newPosY,0.1f,Type.MOBILE,3);
          mBrick.setXVelocity(sign * mBrick.getWidth() / 30);
          mBrick.setGlobalBrickMatrixIndex(i,j);
          mBricks[i][j]=mBrick;
          mMobileBricks.add(mBrick);
        }
 else         if ((prob - Brick.MOBILE_BRICK_PROBABILITY) <= Brick.EXPLOSIVE_BRICK_PROBABILITY) {
          mBricks[i][j]=new Brick(Colors.RED_GRADIENT,newPosX,newPosY,0.1f,Type.EXPLOSIVE);
        }
 else {
          mBricks[i][j]=new Brick(Colors.GRAY_GRADIENT,newPosX,newPosY,0.1f,Type.HARD);
        }
      }
 else {
        mBricks[i][j]=new Brick(Colors.RAINBOW,newPosX,newPosY,0.1f,Type.NORMAL);
      }
      newPosX+=spaceX;
    }
    newPosX=initialX;
    newPosY-=spaceY;
  }
}

Fixed version (ground truth):
private void createLevel(int blocksX,int blocksY,float initialX,float initialY,float spaceX,float spaceY){
  mBricks=new Brick[blocksX][blocksY];
  float newPosX=initialX;
  float newPosY=initialY;
  float width=(Brick.VERTICES[4] - Brick.VERTICES[0]) * Brick.scale;
  for (int i=0; i < mBricks.length; i++) {
    float sign=1;
    for (int j=0; j < mBricks[i].length; j++) {
      sign*=-1;
      double prob=Math.random();
      if (prob <= (Brick.MOBILE_BRICK_PROBABILITY + Brick.EXPLOSIVE_BRICK_PROBABILITY + Brick.GRAY_BRICK_PROBABILITY)) {
        if (prob <= Brick.MOBILE_BRICK_PROBABILITY) {
          MobileBrick mBrick=new MobileBrick(Colors.GREEN_GRADIENT,newPosX,newPosY,Brick.scale,Type.MOBILE,3);
          mBrick.setXVelocity(sign * mBrick.getWidth() / 30);
          mBrick.setGlobalBrickMatrixIndex(i,j);
          mBricks[i][j]=mBrick;
          mMobileBricks.add(mBrick);
        }
 else         if ((prob - Brick.MOBILE_BRICK_PROBABILITY) <= Brick.EXPLOSIVE_BRICK_PROBABILITY) {
          mBricks[i][j]=new Brick(Colors.RED_GRADIENT,newPosX,newPosY,Brick.scale,Type.EXPLOSIVE);
        }
 else {
          mBricks[i][j]=new Brick(Colors.GRAY_GRADIENT,newPosX,newPosY,Brick.scale,Type.HARD);
        }
      }
 else {
        mBricks[i][j]=new Brick(Colors.RAINBOW,newPosX,newPosY,Brick.scale,Type.NORMAL);
      }
      newPosX+=spaceX;
    }
    newPosX=initialX;
    newPosY-=spaceY;
  }
}
Program: 91115
Project: 91115
Buggy source:
public boolean detectCollisionWithBrick(Brick other){
  if (this.getTopY() >= other.getBottomY() && this.getBottomY() <= other.getTopY() && this.getRightX() >= other.getLeftX() && this.getLeftX() <= other.getRightX()) {
    if (this.getLeftX() < other.getLeftX())     Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
 else     Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
    collided=true;
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean detectCollisionWithBrick(Brick other){
  if (mToWait > 0)   return false;
  if (this.getTopY() >= other.getBottomY() && this.getBottomY() <= other.getTopY() && this.getRightX() >= other.getLeftX() && this.getLeftX() <= other.getRightX()) {
    if (this.getLeftX() < other.getLeftX()) {
      if (mXVelocity < 0)       mXVelocity*=-1;
      Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
    }
 else {
      if (mXVelocity > 0)       mXVelocity*=-1;
      Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
    }
    collided=true;
    return true;
  }
 else   return false;
}
Program: 91116
Project: 91116
Buggy source:
public boolean detectCollisionWithWall(){
  if ((this.getRightX() >= Game.sScreenHigherX) || (this.getLeftX() <= Game.sScreenLowerX)) {
    if (this.getRightX() >= Game.sScreenHigherX)     Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
 else     Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
    collided=true;
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean detectCollisionWithWall(){
  if (mToWait > 0)   return false;
  if ((this.getRightX() >= Game.sScreenHigherX) || (this.getLeftX() <= Game.sScreenLowerX)) {
    if (this.getRightX() >= Game.sScreenHigherX) {
      if (mXVelocity < 0)       mXVelocity*=-1;
      Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
    }
 else {
      if (mXVelocity > 0)       mXVelocity*=-1;
      Log.d(TAG,"String_Node_Str" + mIndexI + "String_Node_Str"+ mIndexJ+ "String_Node_Str");
    }
    collided=true;
    return true;
  }
 else   return false;
}
Program: 91117
Project: 91117
Buggy source:
private Collision detectColision(){
  if ((mBall.getRightX() >= mScreenHigherX) || (mBall.getLeftX() <= mScreenLowerX)) {
    return Collision.WALL_RIGHT_LEFT_SIDE;
  }
 else   if ((mBall.getTopY() >= mScreenHigherY) || (mBall.getBottomY() <= mScreenLowerY) && Config.INVICIBILITY) {
    return Collision.WALL_TOP_BOTTOM_SIDE;
  }
 else   if (mBall.getBottomY() <= mScreenLowerY && !Config.INVICIBILITY) {
    return Collision.LIFE_LOST;
  }
  Log.v(TAG,mBall.toString());
  if (mBall.getTopY() >= mPaddle.getBottomY() && mBall.getBottomY() <= mPaddle.getTopY() && mBall.getRightX() >= mPaddle.getLeftX() && mBall.getLeftX() <= mPaddle.getRightX()) {
    updateScoreMultiplier(ScoreMultiplier.PADDLE_HIT);
    return Collision.PADDLE_BALL;
  }
  for (int i=0; i < mBricks.length; i++) {
    for (int j=0; j < mBricks[i].length; j++) {
      Brick brick=mBricks[i][j];
      if (brick != null) {
        if (mBall.getTopY() >= brick.getBottomY() && mBall.getBottomY() <= brick.getTopY() && mBall.getRightX() >= brick.getLeftX() && mBall.getLeftX() <= brick.getRightX()) {
          Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ j+ "String_Node_Str");
          mBricks[i][j]=null;
          sScore+=100 * sScoreMultiplier;
          Log.i(TAG,"String_Node_Str" + sScoreMultiplier + "String_Node_Str"+ sScore);
          updateScoreMultiplier(ScoreMultiplier.BRICK_HIT);
          return Collision.PADDLE_BRICK;
        }
      }
    }
  }
  return Collision.NOT_AVAILABLE;
}

Fixed version (ground truth):
private Collision detectColision(){
  if ((mBall.getRightX() >= sScreenHigherX) || (mBall.getLeftX() <= sScreenLowerX)) {
    return Collision.WALL_RIGHT_LEFT_SIDE;
  }
 else   if ((mBall.getTopY() >= sScreenHigherY) || (mBall.getBottomY() <= sScreenLowerY) && Config.INVICIBILITY) {
    return Collision.WALL_TOP_BOTTOM_SIDE;
  }
 else   if (mBall.getBottomY() <= sScreenLowerY && !Config.INVICIBILITY) {
    return Collision.LIFE_LOST;
  }
  Log.v(TAG,mBall.toString());
  if (mBall.getTopY() >= mPaddle.getBottomY() && mBall.getBottomY() <= mPaddle.getTopY() && mBall.getRightX() >= mPaddle.getLeftX() && mBall.getLeftX() <= mPaddle.getRightX()) {
    updateScoreMultiplier(ScoreMultiplier.PADDLE_HIT);
    return Collision.PADDLE_BALL;
  }
  for (int i=0; i < mBricks.length; i++) {
    for (int j=0; j < mBricks[i].length; j++) {
      Brick brick=mBricks[i][j];
      if (brick != null) {
        if (mBall.getTopY() >= brick.getBottomY() && mBall.getBottomY() <= brick.getTopY() && mBall.getRightX() >= brick.getLeftX() && mBall.getLeftX() <= brick.getRightX()) {
          Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ j+ "String_Node_Str");
          mBricks[i][j]=null;
          sScore+=100 * sScoreMultiplier;
          Log.i(TAG,"String_Node_Str" + sScoreMultiplier + "String_Node_Str"+ sScore);
          updateScoreMultiplier(ScoreMultiplier.BRICK_HIT);
          return Collision.PADDLE_BRICK;
        }
      }
    }
  }
  return Collision.NOT_AVAILABLE;
}
Program: 91118
Project: 91118
Buggy source:
public void resetElements(){
  sScore=0;
  sLifes=Config.LIFE_COUNT;
  updateScoreMultiplier(ScoreMultiplier.RESTART_LEVEL);
  mPaddle=new Paddle(Colors.RAINBOW,0.0f,-0.7f,0.1f);
  Log.d(TAG,"String_Node_Str" + "String_Node_Str" + mPaddle.getBottomY() + "String_Node_Str"+ mPaddle.getTopY()+ "String_Node_Str"+ mPaddle.getLeftX()+ "String_Node_Str"+ mPaddle.getRightX());
  mBall=new Ball(Colors.RAINBOW,0.0f,0.0f,-0.02f,-0.05f,0.1f,0.01f);
  Log.d(TAG,"String_Node_Str" + "String_Node_Str" + mBall.getBottomY() + "String_Node_Str"+ mBall.getTopY()+ "String_Node_Str"+ mBall.getLeftX()+ "String_Node_Str"+ mBall.getRightX());
  createLevel(Colors.RAINBOW,8,12,-0.55f,0.7f,0.1f,0.04f);
}

Fixed version (ground truth):
public void resetElements(){
  sScreenHigherX=1.0f;
  sScreenLowerX=-1.0f;
  sScreenHigherY=1.0f;
  sScreenLowerY=-1.0f;
  sScore=0;
  sLifes=Config.LIFE_COUNT;
  updateScoreMultiplier(ScoreMultiplier.RESTART_LEVEL);
  mPaddle=new Paddle(Colors.RAINBOW,0.0f,-0.7f,0.1f);
  Log.d(TAG,"String_Node_Str" + "String_Node_Str" + mPaddle.getBottomY() + "String_Node_Str"+ mPaddle.getTopY()+ "String_Node_Str"+ mPaddle.getLeftX()+ "String_Node_Str"+ mPaddle.getRightX());
  mBall=new Ball(Colors.RAINBOW,0.0f,0.0f,-0.02f,-0.05f,0.1f,0.01f);
  Log.d(TAG,"String_Node_Str" + "String_Node_Str" + mBall.getBottomY() + "String_Node_Str"+ mBall.getTopY()+ "String_Node_Str"+ mBall.getLeftX()+ "String_Node_Str"+ mBall.getRightX());
  createLevel(Colors.RAINBOW,8,12,-0.55f,0.7f,0.1f,0.04f);
}
Program: 91119
Project: 91119
Buggy source:
public void updateScreenMeasures(float screenWidth,float screenHeight){
  Log.i(TAG,"String_Node_Str" + screenWidth + "String_Node_Str"+ screenHeight);
  mScreenLowerX=SCREEN_INITIAL_X - screenWidth / 2;
  mScreenHigherX=SCREEN_INITIAL_X + screenWidth / 2;
  mScreenLowerY=SCREEN_INITIAL_Y - screenHeight / 2;
  mScreenHigherY=SCREEN_INITIAL_Y + screenHeight / 2;
  Log.i(TAG,"String_Node_Str" + "String_Node_Str" + mScreenLowerX + "String_Node_Str"+ mScreenHigherX+ "String_Node_Str"+ mScreenLowerY+ "String_Node_Str"+ mScreenHigherY);
}

Fixed version (ground truth):
public void updateScreenMeasures(float screenWidth,float screenHeight){
  Log.i(TAG,"String_Node_Str" + screenWidth + "String_Node_Str"+ screenHeight);
  sScreenLowerX=SCREEN_INITIAL_X - screenWidth / 2;
  sScreenHigherX=SCREEN_INITIAL_X + screenWidth / 2;
  sScreenLowerY=SCREEN_INITIAL_Y - screenHeight / 2;
  sScreenHigherY=SCREEN_INITIAL_Y + screenHeight / 2;
  Log.i(TAG,"String_Node_Str" + "String_Node_Str" + sScreenLowerX + "String_Node_Str"+ sScreenHigherX+ "String_Node_Str"+ sScreenLowerY+ "String_Node_Str"+ sScreenHigherY);
}
Program: 91120
Project: 91120
Buggy source:
public void setPosX(float x){
  mPosX=x;
}

Fixed version (ground truth):
public void setPosX(float x){
  if (x >= Game.sScreenLowerX && x <= Game.sScreenHigherX) {
    mPosX=x;
  }
 else   if (x < Game.sScreenLowerX) {
    mPosX=Game.sScreenLowerX;
  }
 else   if (x > Game.sScreenHigherX) {
    mPosX=Game.sScreenHigherX;
  }
}
Program: 91121
Project: 91121
Buggy source:
public void setPosY(float y){
  mPosY=y;
}

Fixed version (ground truth):
public void setPosY(float y){
  if (y >= Game.sScreenLowerY && y <= Game.sScreenHigherY) {
    mPosY=y;
  }
 else   if (y < Game.sScreenLowerY) {
    mPosY=Game.sScreenLowerY;
  }
 else   if (y > Game.sScreenHigherY) {
    mPosY=Game.sScreenHigherY;
  }
}
Program: 91122
Project: 91122
Buggy source:
private Collision detectColision(){
  float paddleLeftX=mPaddle.getLeftX();
  float paddleRightX=mPaddle.getRightX();
  float paddleTopY=mPaddle.getTopY();
  if ((mBall.getRightX() >= SCREEN_HIGHER_X) || (mBall.getLeftX() <= SCREEN_LOWER_X)) {
    return Collision.WALL_RIGHT_LEFT_SIDE;
  }
 else   if ((mBall.getTopY() >= SCREEN_HIGHER_Y) || (mBall.getBottomY() <= SCREEN_LOWER_Y)) {
    return Collision.WALL_TOP_BOTTOM_SIDE;
  }
  Log.v(TAG,mBall.toString());
  if ((mBall.getBottomY() <= paddleTopY) && (((mBall.getLeftX() < paddleLeftX) && (mBall.getRightX() >= paddleLeftX)) || ((mBall.getLeftX() <= paddleLeftX) && (mBall.getRightX() < paddleRightX)) || ((mBall.getLeftX() >= paddleLeftX) && (mBall.getRightX() <= paddleRightX)))) {
    if (mBall.getDirection() == BallDirection.RIGHT_DOWNWARD) {
      return Collision.PADDLE_BALL_FROM_LEFT;
    }
 else     if (mBall.getDirection() == BallDirection.LEFT_DOWNWARD) {
      return Collision.PADDLE_BALL_FROM_RIGHT;
    }
  }
  for (  Brick bricks[] : mBricks) {
    for (    Brick brick : bricks) {
    }
  }
  return Collision.NOT_AVAILABLE;
}

Fixed version (ground truth):
private Collision detectColision(){
  float paddleLeftX=mPaddle.getLeftX();
  float paddleRightX=mPaddle.getRightX();
  float paddleTopY=mPaddle.getTopY();
  if ((mBall.getRightX() >= SCREEN_HIGHER_X) || (mBall.getLeftX() <= SCREEN_LOWER_X)) {
    return Collision.WALL_RIGHT_LEFT_SIDE;
  }
 else   if ((mBall.getTopY() >= SCREEN_HIGHER_Y) || (mBall.getBottomY() <= SCREEN_LOWER_Y)) {
    return Collision.WALL_TOP_BOTTOM_SIDE;
  }
  Log.v(TAG,mBall.toString());
  if ((mBall.getBottomY() <= paddleTopY) && (((mBall.getLeftX() < paddleLeftX) && (mBall.getRightX() >= paddleLeftX)) || ((mBall.getLeftX() <= paddleLeftX) && (mBall.getRightX() > paddleRightX)) || ((mBall.getLeftX() >= paddleLeftX) && (mBall.getRightX() <= paddleRightX)))) {
    if (mBall.getDirection() == BallDirection.RIGHT_DOWNWARD) {
      return Collision.PADDLE_BALL_FROM_LEFT;
    }
 else     if (mBall.getDirection() == BallDirection.LEFT_DOWNWARD) {
      return Collision.PADDLE_BALL_FROM_RIGHT;
    }
  }
  for (  Brick bricks[] : mBricks) {
    for (    Brick brick : bricks) {
    }
  }
  return Collision.NOT_AVAILABLE;
}
Program: 91123
Project: 91123
Buggy source:
public void updateState(float deltaTime){
  mBall.setBallSpeed(deltaTime);
  Collision collisionType=detectColision();
switch (collisionType) {
case WALL_RIGHT_LEFT_SIDE:
    Log.d(TAG,"String_Node_Str");
  mBall.turnToPerpendicularDirection(true);
break;
case WALL_TOP_BOTTOM_SIDE:
Log.d(TAG,"String_Node_Str");
mBall.turnToPerpendicularDirection(false);
break;
default :
break;
}
mBall.move();
}

Fixed version (ground truth):
public void updateState(){
  Collision collisionType=detectColision();
switch (collisionType) {
case WALL_RIGHT_LEFT_SIDE:
    Log.d(TAG,"String_Node_Str");
  mBall.turnToPerpendicularDirection(true);
break;
case WALL_TOP_BOTTOM_SIDE:
Log.d(TAG,"String_Node_Str");
mBall.turnToPerpendicularDirection(false);
break;
default :
break;
}
mBall.move();
}
Program: 91124
Project: 91124
Buggy source:
public void drawElements(GL10 gl){
  mPaddle.draw(gl);
  mBall.draw(gl);
  for (int i=0; i < mBlocks.length; i++) {
    for (int j=0; j < mBlocks[i].length; j++) {
      mBlocks[i][j].draw(gl);
    }
  }
}

Fixed version (ground truth):
public void drawElements(GL10 gl,float deltaTime){
  mPaddle.draw(gl);
  mBall.draw(gl);
  for (int i=0; i < mBlocks.length; i++) {
    for (int j=0; j < mBlocks[i].length; j++) {
      mBlocks[i][j].draw(gl);
    }
  }
  mBall.setBallSpeed(deltaTime);
}
Program: 91125
Project: 91125
Buggy source:
@Override public void onDrawFrame(GL10 gl){
  long currentTime=System.nanoTime();
  long deltaTime=(currentTime - mPrevFrameTime) / Constants.NANOS_PER_SECONDS;
  mPrevFrameTime=currentTime;
  Log.v(TAG,"String_Node_Str" + Constants.MS_PER_SECONDS / deltaTime);
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  mGame.updateState(deltaTime < Constants.MS_PER_FRAME ? deltaTime : Constants.MS_PER_FRAME);
  mGame.drawElements(gl);
}

Fixed version (ground truth):
@Override public void onDrawFrame(GL10 gl){
  long currentTime=System.nanoTime();
  long deltaTime=(currentTime - mPrevFrameTime) / Constants.NANOS_PER_SECONDS;
  mPrevFrameTime=currentTime;
  Log.v(TAG,"String_Node_Str" + Constants.MS_PER_SECONDS / deltaTime);
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  mGame.updateState();
  mGame.drawElements(gl,deltaTime < Constants.MS_PER_FRAME ? deltaTime : Constants.MS_PER_FRAME);
}
Program: 91126
Project: 91126
Buggy source:
@Override public void onSurfaceChanged(GL10 gl,int width,int height){
  gl.glViewport(0,0,width,height);
  mScreenWidth=width;
  mScreenHeight=height;
  float ratio=(float)width / height;
  mGame.updateScreenMeasures(2 * (ratio - WALL),2.0f - WALL);
  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrthof(-ratio,ratio,-1.0f,1.0f,-1.0f,1.0f);
  Matrix.orthoM(mUnprojectProjMatrix,0,-ratio,ratio,-1.0f,1.0f,-1.0f,1.0f);
  Matrix.setIdentityM(mUnprojectViewMatrix,0);
}

Fixed version (ground truth):
@Override public void onSurfaceChanged(GL10 gl,int width,int height){
  gl.glViewport(0,0,width,height);
  mScreenWidth=width;
  mScreenHeight=height;
  float ratio=(float)width / height;
  mGame.updateScreenMeasures((2.0f * ratio) - WALL,2.0f - WALL);
  gl.glMatrixMode(GL10.GL_PROJECTION);
  gl.glLoadIdentity();
  gl.glOrthof(-ratio,ratio,-1.0f,1.0f,-1.0f,1.0f);
  Matrix.orthoM(mUnprojectProjMatrix,0,-ratio,ratio,-1.0f,1.0f,-1.0f,1.0f);
  Matrix.setIdentityM(mUnprojectViewMatrix,0);
}
Program: 91127
Project: 91127
Buggy source:
private void syncGUIElements(){
  intervalPercent=(int)(((float)tile.intervalReset / (float)((tile.interval + 1) * 20)) * 200);
  progressBar=(int)((float)intervalPercent * 0.7F);
  if (progressBar <= 7) {
    progressVertical=progressBar;
    progressHorizontal=0;
  }
 else {
    progressVertical=7;
    progressHorizontal=progressBar - 6;
  }
  if (intervalPercent >= 100 && intervalPercent <= 200) {
    burstOffset=(int)(((float)tile.intervalReset / (float)((tile.interval + 1) * 20)) * 20) - 11;
  }
 else {
    burstOffset=0;
  }
  guiParticle=(int)((float)(intervalPercent - 100));
  if (tile.interval <= 1) {
    guiParticle=guiParticle + 3;
  }
  fuelLoadVertical=0;
  fuelLoadhorizontal=0;
}

Fixed version (ground truth):
private void syncGUIElements(){
  intervalPercent=(int)(((float)tile.intervalReset / (float)((tile.interval + 1) * 20)) * 200);
  if (intervalPercent <= 100) {
    progressBar=(int)((float)intervalPercent * 0.7F);
    if (progressBar <= 7) {
      progressVertical=progressBar;
      progressHorizontal=0;
    }
 else {
      progressVertical=7;
      progressHorizontal=progressBar - 6;
    }
  }
 else {
    progressVertical=7;
    progressHorizontal=64;
  }
  if (intervalPercent >= 100 && intervalPercent <= 200) {
    burstOffset=(int)(((float)tile.intervalReset / (float)((tile.interval + 1) * 20)) * 20) - 11;
  }
 else {
    burstOffset=0;
  }
  if (intervalPercent <= 113) {
    guiParticle=(int)((float)(intervalPercent - 100));
  }
 else {
    guiParticle=13;
  }
  System.out.println("String_Node_Str" + guiParticle);
  if (tile.interval <= 1) {
    guiParticle=guiParticle + 3;
  }
  fuelLoadVertical=0;
  fuelLoadhorizontal=0;
}
Program: 91131
Project: 91131
Buggy source:
protected void addNewGeneration(GenerationType generation,Long activityId,Long entityId,Connection connection) throws IngestException, SQLException {
  TupleData tuple=new TupleData();
  tuple.addAttribute("String_Node_Str",activityId,TableAttributeData.DataType.LONG);
  tuple.addAttribute("String_Node_Str",entityId,TableAttributeData.DataType.LONG);
  tuple.addAttribute("String_Node_Str",generation.getLocation(),TableAttributeData.DataType.STRING);
  tuple.addAttribute("String_Node_Str",KomaduUtils.getTimestamp(generation.getTimestamp()),TableAttributeData.DataType.TIMESTAMP);
  Long generationId=insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
  if (generation.getAttributes() != null) {
    addAttributes("String_Node_Str","String_Node_Str",generationId,generation.getAttributes().getAttributeArray(),connection);
  }
}

Fixed version (ground truth):
protected void addNewGeneration(GenerationType generation,Long activityId,Long entityId,Connection connection) throws IngestException, SQLException {
  TupleData tuple=new TupleData();
  tuple.addAttribute("String_Node_Str",activityId,TableAttributeData.DataType.LONG);
  tuple.addAttribute("String_Node_Str",entityId,TableAttributeData.DataType.LONG);
  if (generation.isSetLocation())   tuple.addAttribute("String_Node_Str",generation.getLocation(),TableAttributeData.DataType.STRING);
  if (generation.isSetTimestamp())   tuple.addAttribute("String_Node_Str",KomaduUtils.getTimestamp(generation.getTimestamp()),TableAttributeData.DataType.TIMESTAMP);
  Long generationId=insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
  if (generation.getAttributes() != null) {
    addAttributes("String_Node_Str","String_Node_Str",generationId,generation.getAttributes().getAttributeArray(),connection);
  }
}
Program: 91135
Project: 91135
Buggy source:
protected IngestionResult addNewBlockEntity(EntityType entityInfo,Connection connection) throws IngestException, SQLException {
  BlockType block=entityInfo.getBlock();
  IngestionResult ingestionResult=null;
  if (KomaduUtils.manageDBLock(DBLockConstants.LOCK_ACQUIRE,block.getBlockURI(),connection)) {
    Long baseEntityId=addNewBaseEntity(EntityTypeEnum.BLOCK,entityInfo.getAttributes(),entityInfo.getRole(),entityInfo.getLocation(),connection);
    TupleData tuple=new TupleData();
    tuple.addAttribute("String_Node_Str",baseEntityId,TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",block.getBlockURI(),TableAttributeData.DataType.STRING);
    String content=block.getBlockContent();
    String md5=KomaduUtils.calculateMD5(content);
    if (md5 != null)     tuple.addAttribute("String_Node_Str",md5,TableAttributeData.DataType.STRING);
    tuple.addAttribute("String_Node_Str",content.length(),TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",content,TableAttributeData.DataType.STRING);
    Long blockId=insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
    ingestionResult=new IngestionResult(block.getBlockURI(),blockId);
    KomaduUtils.manageDBLock(DBLockConstants.LOCK_RELEASE,block.getBlockURI(),connection);
  }
  return ingestionResult;
}

Fixed version (ground truth):
protected IngestionResult addNewBlockEntity(EntityType entityInfo,Connection connection) throws IngestException, SQLException {
  BlockType block=entityInfo.getBlock();
  IngestionResult ingestionResult=null;
  if (KomaduUtils.manageDBLock(DBLockConstants.LOCK_ACQUIRE,block.getBlockURI(),connection)) {
    Long baseEntityId=addNewBaseEntity(EntityTypeEnum.BLOCK,entityInfo.getAttributes(),entityInfo.getRole(),entityInfo.getLocation(),connection);
    TupleData tuple=new TupleData();
    tuple.addAttribute("String_Node_Str",baseEntityId,TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",block.getBlockURI(),TableAttributeData.DataType.STRING);
    String content=block.getBlockContent();
    String md5=KomaduUtils.calculateMD5(content);
    if (md5 != null)     tuple.addAttribute("String_Node_Str",md5,TableAttributeData.DataType.STRING);
    tuple.addAttribute("String_Node_Str",content.length(),TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",content,TableAttributeData.DataType.STRING);
    insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
    ingestionResult=new IngestionResult(block.getBlockURI(),baseEntityId);
    KomaduUtils.manageDBLock(DBLockConstants.LOCK_RELEASE,block.getBlockURI(),connection);
  }
  return ingestionResult;
}
Program: 91136
Project: 91136
Buggy source:
protected IngestionResult addNewGenericEntity(EntityType entityInfo,Connection connection) throws IngestException, SQLException {
  GenericEntityType genericEntity=entityInfo.getGenericEntity();
  IngestionResult ingestionResult=null;
  if (KomaduUtils.manageDBLock(DBLockConstants.LOCK_ACQUIRE,genericEntity.getEntityURI(),connection)) {
    Long baseEntityId=addNewBaseEntity(EntityTypeEnum.GENERIC,entityInfo.getAttributes(),entityInfo.getRole(),entityInfo.getLocation(),connection);
    TupleData tuple=new TupleData();
    tuple.addAttribute("String_Node_Str",baseEntityId,TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",genericEntity.getEntityURI(),TableAttributeData.DataType.STRING);
    Long genericId=insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
    ingestionResult=new IngestionResult(genericEntity.getEntityURI(),genericId);
    KomaduUtils.manageDBLock(DBLockConstants.LOCK_RELEASE,genericEntity.getEntityURI(),connection);
  }
  return ingestionResult;
}

Fixed version (ground truth):
protected IngestionResult addNewGenericEntity(EntityType entityInfo,Connection connection) throws IngestException, SQLException {
  GenericEntityType genericEntity=entityInfo.getGenericEntity();
  IngestionResult ingestionResult=null;
  if (KomaduUtils.manageDBLock(DBLockConstants.LOCK_ACQUIRE,genericEntity.getEntityURI(),connection)) {
    Long baseEntityId=addNewBaseEntity(EntityTypeEnum.GENERIC,entityInfo.getAttributes(),entityInfo.getRole(),entityInfo.getLocation(),connection);
    TupleData tuple=new TupleData();
    tuple.addAttribute("String_Node_Str",baseEntityId,TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",genericEntity.getEntityURI(),TableAttributeData.DataType.STRING);
    insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
    ingestionResult=new IngestionResult(genericEntity.getEntityURI(),baseEntityId);
    KomaduUtils.manageDBLock(DBLockConstants.LOCK_RELEASE,genericEntity.getEntityURI(),connection);
  }
  return ingestionResult;
}
Program: 91139
Project: 91139
Buggy source:
/** 
 * @param msgconf
 */
public Query(MessageConfig msgconf){
  try {
    this.msgconf=msgconf;
    this.sender=new Sender(msgconf,MessagingOperationTypes.SEND_QUERY_REQUEST);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @param msgconf
 */
public Query(MessageConfig msgconf,String msgconfPath){
  try {
    this.msgconf=msgconf;
    this.sender=new Sender(msgconf,MessagingOperationTypes.SEND_QUERY_REQUEST);
    String schemaPath=PropertyReader.getInstance(msgconfPath).getProperty("String_Node_Str");
    this.schemaFile=new File(schemaPath);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 91140
Project: 91140
Buggy source:
/** 
 * Send Query to Komadu Server through Message Bus.
 * @param QueryFile
 * @throws IOException
 */
public String sendQueryRequest(File QueryFile) throws IOException {
  try {
    XmlObject query=XmlObject.Factory.parse(QueryFile);
    if (!query.validate()) {
      throw new XmlException("String_Node_Str");
    }
 else {
      String ResponseRoutingKey=UUID.randomUUID().toString();
      try {
        new MessagingQueue().new QueueBind(this.msgconf,this.msgconf.getQueryResponseExchangeName(),this.msgconf.getQueryResponseQueueName(),ResponseRoutingKey);
        this.sender.sendMessage(ResponseRoutingKey + "String_Node_Str" + query.xmlText(new XmlOptions().setSavePrettyPrint()));
        return ResponseRoutingKey;
      }
 catch (      ShutdownSignalException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  XmlException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Send Query to Komadu Server through Message Bus.
 * @param QueryFile
 * @throws IOException
 */
public String sendQueryRequest(File QueryFile) throws IOException {
  try {
    XmlObject query=XmlObject.Factory.parse(QueryFile);
    if (!Validation.validate(query,schemaFile)) {
      throw new XmlException("String_Node_Str");
    }
 else {
      String ResponseRoutingKey=UUID.randomUUID().toString();
      try {
        new MessagingQueue().new QueueBind(this.msgconf,this.msgconf.getQueryResponseExchangeName(),this.msgconf.getQueryResponseQueueName(),ResponseRoutingKey);
        this.sender.sendMessage(ResponseRoutingKey + "String_Node_Str" + query.xmlText(new XmlOptions().setSavePrettyPrint()));
        return ResponseRoutingKey;
      }
 catch (      ShutdownSignalException e) {
        e.printStackTrace();
      }
catch (      IOException e) {
        e.printStackTrace();
      }
catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  XmlException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 91141
Project: 91141
Buggy source:
public static void main(String[] args){
  if (args.length != 2) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    return;
  }
  String MessageConfigPath=args[0];
  String pathToQueryFile=args[1];
  long startTime=System.currentTimeMillis();
  MessageConfig msgconf=new MessageConfig(MessageConfigPath);
  Query query=new Query(msgconf);
  String queryResult=query.query(new File(pathToQueryFile));
  query.closeConnection();
  System.out.println("String_Node_Str" + queryResult);
  long endTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (endTime - startTime));
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length != 2) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    return;
  }
  String MessageConfigPath=args[0];
  String pathToQueryFile=args[1];
  long startTime=System.currentTimeMillis();
  MessageConfig msgconf=new MessageConfig(MessageConfigPath);
  Query query=new Query(msgconf,MessageConfigPath);
  String queryResult=query.query(new File(pathToQueryFile));
  query.closeConnection();
  System.out.println("String_Node_Str" + queryResult);
  long endTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (endTime - startTime));
}
Program: 91142
Project: 91142
Buggy source:
public static void main(String[] args){
  if (args.length != 2) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    return;
  }
  String MessageConfigPath=args[0];
  String pathToQueryFile=args[1];
  int iternation=Integer.parseInt(args[2]);
  long startTime=System.currentTimeMillis();
  MessageConfig msgconf=new MessageConfig(MessageConfigPath);
  Query query=new Query(msgconf);
  for (int i=0; i < iternation; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ query.query(new File(pathToQueryFile)));
  }
  query.closeConnection();
  long endTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (endTime - startTime));
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length != 2) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    return;
  }
  String MessageConfigPath=args[0];
  String pathToQueryFile=args[1];
  int iternation=Integer.parseInt(args[2]);
  long startTime=System.currentTimeMillis();
  MessageConfig msgconf=new MessageConfig(MessageConfigPath);
  Query query=new Query(msgconf,MessageConfigPath);
  for (int i=0; i < iternation; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ query.query(new File(pathToQueryFile)));
  }
  query.closeConnection();
  long endTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (endTime - startTime));
}
Program: 91143
Project: 91143
Buggy source:
private static EntityType createCollectionEntity(String collectionURI,int runId) throws Exception {
  EntityType entity=EntityType.Factory.newInstance();
  CollectionType collection=CollectionType.Factory.newInstance();
  collection.setCollectionURI(collectionURI);
  String collFile1URI="String_Node_Str" + runId;
  EntityType collEntity1=createFileEntity(collFile1URI);
  MembersType members=MembersType.Factory.newInstance();
  EntityType[] memberArray=new EntityType[]{collEntity1};
  members.setMemberArray(memberArray);
  collection.setMembers(members);
  entity.setCollection(collection);
  return entity;
}

Fixed version (ground truth):
private static EntityType createCollectionEntity(String collectionURI,int runId) throws Exception {
  EntityType entity=EntityType.Factory.newInstance();
  CollectionType collection=CollectionType.Factory.newInstance();
  collection.setCollectionURI(collectionURI);
  String collFile1URI="String_Node_Str" + runId;
  EntityType collEntity1=createFileEntity(collFile1URI);
  MembersType members=MembersType.Factory.newInstance();
  EntityType[] memberArray=new EntityType[]{collEntity1};
  members.setMemberArray(memberArray);
  collection.setMembers(members);
  entity.setCollection(collection);
  AttributesType attributes=AttributesType.Factory.newInstance();
  AttributeType[] attributesArr=new AttributeType[1];
  AttributeType att1=createAttribute("String_Node_Str","String_Node_Str");
  attributesArr[0]=att1;
  attributes.setAttributeArray(attributesArr);
  entity.setAttributes(attributes);
  return entity;
}
Program: 91144
Project: 91144
Buggy source:
protected IngestionResult addNewCollection(EntityType entityInfo,Connection connection) throws IngestException, SQLException {
  CollectionType collection=entityInfo.getCollection();
  IngestionResult ingestionResult=null;
  if (KomaduUtils.manageDBLock(DBLockConstants.LOCK_ACQUIRE,collection.getCollectionURI(),connection)) {
    Long baseEntityId=addNewBaseEntity(EntityTypeEnum.COLLECTION,entityInfo.getAttributes(),entityInfo.getRole(),entityInfo.getLocation(),connection);
    TupleData tuple=new TupleData();
    tuple.addAttribute("String_Node_Str",baseEntityId,TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",collection.getCollectionURI(),TableAttributeData.DataType.STRING);
    Long collectionId=insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
    KomaduUtils.manageDBLock(DBLockConstants.LOCK_RELEASE,collection.getCollectionURI(),connection);
    MembersType members=collection.getMembers();
    for (    EntityType member : members.getMemberArray()) {
      IngestionResult memberResult=addNewEntity(member,connection);
      addNewMembership(collectionId,memberResult.getDbId(),connection);
    }
    ingestionResult=new IngestionResult(collection.getCollectionURI(),collectionId);
  }
  return ingestionResult;
}

Fixed version (ground truth):
protected IngestionResult addNewCollection(EntityType entityInfo,Connection connection) throws IngestException, SQLException {
  CollectionType collection=entityInfo.getCollection();
  IngestionResult ingestionResult=null;
  if (KomaduUtils.manageDBLock(DBLockConstants.LOCK_ACQUIRE,collection.getCollectionURI(),connection)) {
    Long baseEntityId=addNewBaseEntity(EntityTypeEnum.COLLECTION,entityInfo.getAttributes(),entityInfo.getRole(),entityInfo.getLocation(),connection);
    TupleData tuple=new TupleData();
    tuple.addAttribute("String_Node_Str",baseEntityId,TableAttributeData.DataType.LONG);
    tuple.addAttribute("String_Node_Str",collection.getCollectionURI(),TableAttributeData.DataType.STRING);
    insertTuple("String_Node_Str",tuple,"String_Node_Str",connection);
    KomaduUtils.manageDBLock(DBLockConstants.LOCK_RELEASE,collection.getCollectionURI(),connection);
    MembersType members=collection.getMembers();
    for (    EntityType member : members.getMemberArray()) {
      IngestionResult memberResult=addNewEntity(member,connection);
      addNewMembership(baseEntityId,memberResult.getDbId(),connection);
    }
    ingestionResult=new IngestionResult(collection.getCollectionURI(),baseEntityId);
  }
  return ingestionResult;
}
Program: 91145
Project: 91145
Buggy source:
private static Function<LinkedTrackPoint,LinkedTrackPoint> changeTime(final long startTime,final double multiplier){
  return new Function<LinkedTrackPoint,LinkedTrackPoint>(){
    @Override public LinkedTrackPoint apply(    LinkedTrackPoint in){
      long newTime=(long)(startTime + (in.getTime().longValue() - startTime) * multiplier);
      return DefaultLinkedWayPoint.of(new DefaultWayPoint(in.getLatitude(),in.getLongitude(),in.getElevation(),Long.valueOf(newTime)),in.getLink());
    }
  }
;
}

Fixed version (ground truth):
private static Function<LinkedTrackPoint,LinkedTrackPoint> changeTime(final long startTime,final double multiplier){
  return new Function<LinkedTrackPoint,LinkedTrackPoint>(){
    @Override public LinkedTrackPoint apply(    LinkedTrackPoint in){
      long newTime=(long)(startTime + (in.getTime().longValue() - startTime) * multiplier);
      return DefaultLinkedWayPoint.of(new DefaultWayPoint(in.getLatitude(),in.getLongitude(),in.getElevation(),Long.valueOf(newTime)),in.getLink(),in.getOverallDistance(),in.getOverallDuration());
    }
  }
;
}
Program: 91146
Project: 91146
Buggy source:
@Override public LinkedTrackPoint apply(LinkedTrackPoint in){
  long newTime=(long)(startTime + (in.getTime().longValue() - startTime) * multiplier);
  return DefaultLinkedWayPoint.of(new DefaultWayPoint(in.getLatitude(),in.getLongitude(),in.getElevation(),Long.valueOf(newTime)),in.getLink());
}

Fixed version (ground truth):
@Override public LinkedTrackPoint apply(LinkedTrackPoint in){
  long newTime=(long)(startTime + (in.getTime().longValue() - startTime) * multiplier);
  return DefaultLinkedWayPoint.of(new DefaultWayPoint(in.getLatitude(),in.getLongitude(),in.getElevation(),Long.valueOf(newTime)),in.getLink(),in.getOverallDistance(),in.getOverallDuration());
}
Program: 91147
Project: 91147
Buggy source:
private String buildUrl(Operation operation,String from,List<String> args){
  String url=operation.getUrl();
  int i=0;
  for (  Field field : operation.getFields()) {
    String value;
    if (field.getField().equalsIgnoreCase("String_Node_Str")) {
      value=from;
      url=url.replace("String_Node_Str" + field.getField(),from);
    }
 else {
      value=args.get(i);
      i++;
    }
    try {
      url=url.replace("String_Node_Str" + field.getField(),URLEncoder.encode(value,"String_Node_Str"));
    }
 catch (    UnsupportedEncodingException e) {
      logger.error("String_Node_Str",value,e);
    }
  }
  return url;
}

Fixed version (ground truth):
private String buildUrl(Operation operation,String from,List<String> args){
  String url=operation.getUrl();
  int i=0;
  for (  Field field : operation.getFields()) {
    String value;
    if (field.getField().equalsIgnoreCase("String_Node_Str")) {
      value=from;
      try {
        url=url.replace("String_Node_Str" + field.getField(),URLEncoder.encode(from,"String_Node_Str"));
      }
 catch (      UnsupportedEncodingException e) {
        logger.error("String_Node_Str",value,e);
      }
    }
 else {
      value=args.get(i);
      i++;
    }
    try {
      url=url.replace("String_Node_Str" + field.getField(),URLEncoder.encode(value,"String_Node_Str"));
    }
 catch (    UnsupportedEncodingException e) {
      logger.error("String_Node_Str",value,e);
    }
  }
  return url;
}
Program: 91148
Project: 91148
Buggy source:
@Override public void process(MucHolder chatroom,MessageWrapper message){
  String[] args=getParsedCommand().getArgs();
  String baseurl="String_Node_Str";
  if (args != null && args.length > 0) {
    String callee=args[0];
    String response=String.format("String_Node_Str",callee,baseurl,callee);
  }
 else {
    String response=String.format("String_Node_Str");
  }
  chatroom.sendMessage(response);
}

Fixed version (ground truth):
@Override public void process(MucHolder chatroom,MessageWrapper message){
  String[] args=getParsedCommand().getArgs();
  String baseurl="String_Node_Str";
  if (args != null && args.length > 0) {
    String callee=args[0];
    String response=String.format("String_Node_Str",callee,baseurl,callee);
    chatroom.sendMessage(response);
  }
 else {
    String response=String.format("String_Node_Str");
    chatroom.sendMessage(response);
  }
}
Program: 91149
Project: 91149
Buggy source:
protected String pickAttack(int argsLength){
  final int validArg=argsLength % getAttacks().size();
  final String[] attacks=getAttacks().get(validArg);
  return attacks[randomizer.nextInt(attacks.length)];
}

Fixed version (ground truth):
protected String pickAttack(int argsLength){
  final String[] attacks;
  if (argsLength >= getAttacks().size()) {
    attacks=getAttacks().get(getAttacks().size() - 1);
  }
 else {
    attacks=getAttacks().get(argsLength);
  }
  return attacks[randomizer.nextInt(attacks.length)];
}
Program: 91150
Project: 91150
Buggy source:
@Override public void actionPerformed(ActionEvent arg0){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      MainRecorder.file=file.getText();
      System.out.println(MainRecorder.file);
      if (MainRecorder.file != null) {
        UI.gui.setState(Frame.ICONIFIED);
        MainRecorder.record();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent arg0){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      String fileStr=file.getText();
      fileStr=fileStr.replace("String_Node_Str","String_Node_Str");
      System.out.println(MainRecorder.file);
      if (MainRecorder.file != null) {
        UI.gui.setState(Frame.ICONIFIED);
        MainRecorder.record();
      }
    }
  }
);
}
Program: 91151
Project: 91151
Buggy source:
public void run(){
  MainRecorder.file=file.getText();
  System.out.println(MainRecorder.file);
  if (MainRecorder.file != null) {
    UI.gui.setState(Frame.ICONIFIED);
    MainRecorder.record();
  }
}

Fixed version (ground truth):
public void run(){
  String fileStr=file.getText();
  fileStr=fileStr.replace("String_Node_Str","String_Node_Str");
  System.out.println(MainRecorder.file);
  if (MainRecorder.file != null) {
    UI.gui.setState(Frame.ICONIFIED);
    MainRecorder.record();
  }
}