nus-yam/ex-repair huggingface dataset:
Program: 41859
Project: 41859
Buggy source:
public void setObservers(List<String> observers){
  observers_.clear();
  for (  String observer : observers) {
    observers_.put(observer,new PlayerInfo(observer,"String_Node_Str"));
  }
}

Fixed version (ground truth):
public void setObservers(List<String> observers){
  observers_.clear();
  for (  String pid : observers) {
    observers_.put(pid,new PlayerInfo(pid,"String_Node_Str"));
  }
}
Program: 41860
Project: 41860
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  View view=inflater.inflate(R.layout.activity_chat,container,false);
  buttonSend=(Button)view.findViewById(R.id.buttonSend);
  listView=(ListView)view.findViewById(R.id.listView);
  listView.setEmptyView(view.findViewById(R.id.emptyView));
  inputLayout=view.findViewById(R.id.input_layout);
  chatArrayAdapter=new ChatArrayAdapter(getActivity(),R.layout.activity_chat_singlemessage);
  listView.setAdapter(chatArrayAdapter);
  chatText=(EditText)view.findViewById(R.id.chatText);
  chatText.setOnKeyListener(new View.OnKeyListener(){
    public boolean onKey(    View v,    int keyCode,    KeyEvent event){
      if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
        return sendChatMessage();
      }
      return false;
    }
  }
);
  buttonSend.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View arg0){
      sendChatMessage();
    }
  }
);
  listView.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
  listView.setAdapter(chatArrayAdapter);
  chatArrayAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      listView.setSelection(chatArrayAdapter.getCount() - 1);
    }
  }
);
  syncWithNewMessages();
  chatArrayAdapter.add(new ChatMessage(true,"String_Node_Str"));
  chatArrayAdapter.add(new ChatMessage(true,"String_Node_Str"));
  inputLayout.setVisibility(View.VISIBLE);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  View view=inflater.inflate(R.layout.activity_chat,container,false);
  buttonSend=(Button)view.findViewById(R.id.buttonSend);
  listView=(ListView)view.findViewById(R.id.listView);
  listView.setEmptyView(view.findViewById(R.id.emptyView));
  inputLayout=view.findViewById(R.id.input_layout);
  chatArrayAdapter=new ChatArrayAdapter(getActivity(),R.layout.activity_chat_singlemessage);
  listView.setAdapter(chatArrayAdapter);
  chatText=(EditText)view.findViewById(R.id.chatText);
  chatText.setOnKeyListener(new View.OnKeyListener(){
    public boolean onKey(    View v,    int keyCode,    KeyEvent event){
      if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
        return sendChatMessage();
      }
      return false;
    }
  }
);
  buttonSend.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View arg0){
      sendChatMessage();
    }
  }
);
  listView.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
  listView.setAdapter(chatArrayAdapter);
  chatArrayAdapter.registerDataSetObserver(new DataSetObserver(){
    @Override public void onChanged(){
      super.onChanged();
      listView.setSelection(chatArrayAdapter.getCount() - 1);
    }
  }
);
  syncWithNewMessages();
  inputLayout.setVisibility(View.VISIBLE);
  return view;
}
Program: 41861
Project: 41861
Buggy source:
@Override public Fragment getItem(int position){
switch (position) {
case 0:
    return new PlaceholderFragment();
case 1:
{
    ChatFragment newFragment=new ChatFragment();
    chatFragment_=new WeakReference<ChatFragment>(newFragment);
    return newFragment;
  }
default :
return new PlayersFragment();
}
}

Fixed version (ground truth):
@Override public Fragment getItem(int position){
switch (position) {
case 0:
    return new PlaceholderFragment();
case 1:
  return new ChatFragment();
default :
return new PlayersFragment();
}
}
Program: 41862
Project: 41862
Buggy source:
/** 
 * Make the current table an EMPTY one.
 */
public void clearTable(){
  Log.d(TAG,"String_Node_Str");
  if (getSupportActionBar() != null) {
    getSupportActionBar().setDisplayOptions(0,ActionBar.DISPLAY_SHOW_TITLE);
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
  invalidateOptionsMenu();
  boardView_.resetBoard();
  ChatFragment chatFragment=pagerAdapter_.getChatFragment();
  if (chatFragment != null) {
    chatFragment.clearAll();
  }
  adjustScreenOnFlagBasedOnGameStatus();
}

Fixed version (ground truth):
/** 
 * Make the current table an EMPTY one.
 */
public void clearTable(){
  Log.d(TAG,"String_Node_Str");
  if (getSupportActionBar() != null) {
    getSupportActionBar().setDisplayOptions(0,ActionBar.DISPLAY_SHOW_TITLE);
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
  invalidateOptionsMenu();
  boardView_.resetBoard();
  ChatFragment chatFragment=myChatFragment_.get();
  if (chatFragment != null) {
    chatFragment.clearAll();
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
  adjustScreenOnFlagBasedOnGameStatus();
}
Program: 41863
Project: 41863
Buggy source:
private void adjustBoardParameters(int finalWidth,final int finalHeight){
  int configuration=getContext().getResources().getConfiguration().orientation;
  Log.i(TAG,"String_Node_Str" + finalWidth + "String_Node_Str"+ finalHeight+ "String_Node_Str"+ Utils.orientationToString(configuration));
  if (configuration == Configuration.ORIENTATION_LANDSCAPE) {
    final int EXTRA_MARGIN=20;
    finalWidth=(int)((finalHeight / 9.0) * 8) - EXTRA_MARGIN;
    Log.i(TAG,"String_Node_Str" + finalWidth);
    getLayoutParams().width=finalWidth;
    requestLayout();
  }
  final int boardWidth=Math.min(finalWidth,finalHeight);
  cellSize_=(boardWidth - 2 * offset_) / 9;
  pieceSize_=(int)(cellSize_ * 0.8f);
  if ((pieceSize_ % 2) == 1) {
    --pieceSize_;
  }
  startP_=offset_ + cellSize_ / 2;
  Log.d(TAG,"String_Node_Str" + cellSize_ + "String_Node_Str"+ pieceSize_+ "String_Node_Str"+ startP_);
}

Fixed version (ground truth):
private void adjustBoardParameters(int finalWidth,final int finalHeight){
  int configuration=getContext().getResources().getConfiguration().orientation;
  Log.i(TAG,"String_Node_Str" + finalWidth + "String_Node_Str"+ finalHeight+ "String_Node_Str"+ Utils.orientationToString(configuration));
  if (configuration == Configuration.ORIENTATION_LANDSCAPE) {
    final int EXTRA_MARGIN=20;
    finalWidth=(int)((finalHeight / 9.0) * 8) - EXTRA_MARGIN;
    Log.i(TAG,"String_Node_Str" + finalWidth);
    getLayoutParams().width=finalWidth;
    requestLayout();
  }
 else   if (finalWidth > finalHeight) {
    final int cellSizeByHeight=(finalHeight - 2 * offset_) / 10;
    finalWidth=(cellSizeByHeight * 9) + 2 * offset_;
    Log.i(TAG,"String_Node_Str" + finalWidth);
    getLayoutParams().width=finalWidth;
    requestLayout();
  }
  final int boardWidth=Math.min(finalWidth,finalHeight);
  cellSize_=(boardWidth - 2 * offset_) / 9;
  pieceSize_=(int)(cellSize_ * 0.8f);
  if ((pieceSize_ % 2) == 1) {
    --pieceSize_;
  }
  startP_=offset_ + cellSize_ / 2;
  Log.d(TAG,"String_Node_Str" + cellSize_ + "String_Node_Str"+ pieceSize_+ "String_Node_Str"+ startP_);
}
Program: 41864
Project: 41864
Buggy source:
public void updateBoardWithNewTableInfo(TableInfo tableInfo){
  Log.d(TAG,"String_Node_Str");
  setAndShowTitle(tableInfo.tableId);
  if (getSupportActionBar() != null) {
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
  invalidateOptionsMenu();
  boardView_.resetBoard();
}

Fixed version (ground truth):
public void updateBoardWithNewTableInfo(TableInfo tableInfo){
  Log.d(TAG,"String_Node_Str");
  setAndShowTitle(tableInfo.tableId);
  invalidateOptionsMenu();
  boardView_.resetBoard();
}
Program: 41865
Project: 41865
Buggy source:
private void setAndShowTitle(String title){
  if (getSupportActionBar() != null) {
    getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE,ActionBar.DISPLAY_SHOW_TITLE);
    getSupportActionBar().setTitle(getString(R.string.title_table,title));
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void setAndShowTitle(String title){
  if (getSupportActionBar() != null) {
    getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE,ActionBar.DISPLAY_SHOW_TITLE);
    getSupportActionBar().setTitle(getString(R.string.title_table,title));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}
Program: 41866
Project: 41866
Buggy source:
private void handleNetworkEvent_LIST(String content){
  Log.d(TAG,"String_Node_Str");
  MainActivity mainActivity=mainActivity_.get();
  if (mainActivity != null) {
    mainActivity.startActvityToListTables(content);
  }
}

Fixed version (ground truth):
private void handleNetworkEvent_LIST(String content){
  Log.d(TAG,"String_Node_Str");
  MainActivity mainActivity=mainActivity_.get();
  if (mainActivity != null) {
    mainActivity.startActivityToListTables(content);
  }
}
Program: 41867
Project: 41867
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  View rootView=inflater.inflate(R.layout.fragment_main,container,false);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  return inflater.inflate(R.layout.fragment_main,container,false);
}
Program: 41868
Project: 41868
Buggy source:
public void resetBoard(){
  Log.d(TAG,"String_Node_Str");
  referee_.resetGame();
  Piece piece;
  for (int i=0; i < 16; i++) {
    piece=redPieces_[i];
    piece.setCapture(false);
    piece.setPosition(piece.getInitialPosition());
    piece=blackPieces_[i];
    piece.setCapture(false);
    piece.setPosition(piece.getInitialPosition());
  }
  selectedPiece_=null;
  selectedPosition_=null;
  recentPiece_=null;
  gameStatus_=Referee.hoxGAME_STATUS_READY;
  historyMoves_.clear();
  historyIndex_=HISTORY_INDEX_END;
  captureStack_.clear();
  this.invalidate();
}

Fixed version (ground truth):
public void resetBoard(){
  Log.d(TAG,"String_Node_Str");
  if (animator_ != null && animator_.isRunning()) {
    Log.i(TAG,"String_Node_Str");
    animator_.end();
  }
  referee_.resetGame();
  Piece piece;
  for (int i=0; i < 16; i++) {
    piece=redPieces_[i];
    piece.setCapture(false);
    piece.setPosition(piece.getInitialPosition());
    piece=blackPieces_[i];
    piece.setCapture(false);
    piece.setPosition(piece.getInitialPosition());
  }
  selectedPiece_=null;
  selectedPosition_=null;
  recentPiece_=null;
  gameStatus_=Referee.hoxGAME_STATUS_READY;
  historyMoves_.clear();
  historyIndex_=HISTORY_INDEX_END;
  captureStack_.clear();
  this.invalidate();
}
Program: 41869
Project: 41869
Buggy source:
public void restoreMove(Position fromPos,Position toPos,boolean isLastMove){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos+ "String_Node_Str"+ isLastMove);
  Piece capture=tryCapturePieceAtPostion(toPos);
  addMoveToHistory(fromPos,toPos,capture);
  Piece fromPiece=getPieceAtViewPosition(fromPos);
  if (fromPiece == null) {
    Log.e(TAG,"String_Node_Str" + fromPos);
    return;
  }
  fromPiece.setPosition(toPos);
  recentPiece_=fromPiece;
  if (isLastMove) {
    gameStatus_=referee_.getGameStatus();
  }
  if (capture != null) {
    captureStack_.add(capture);
  }
}

Fixed version (ground truth):
public void restoreMove(Position fromPos,Position toPos,boolean isLastMove){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos+ "String_Node_Str"+ isLastMove);
  Piece capture=tryCapturePieceAtPosition(toPos);
  addMoveToHistory(fromPos,toPos,capture);
  Piece fromPiece=getPieceAtViewPosition(fromPos);
  if (fromPiece == null) {
    Log.e(TAG,"String_Node_Str" + fromPos);
    return;
  }
  fromPiece.setPosition(toPos);
  recentPiece_=fromPiece;
  if (isLastMove) {
    gameStatus_=referee_.getGameStatus();
  }
  if (capture != null) {
    captureStack_.add(capture);
  }
}
Program: 41871
Project: 41871
Buggy source:
private void drawPiece(Canvas canvas,Piece piece,PieceDrawMode drawMode){
  if (piece.isAnimated()) {
    final PointF point=piece.getPointF();
    drawPieceAtPoint(canvas,piece,point);
    return;
  }
  final int imageRadius=pieceSize_ / 2;
  Bitmap bitmap=piece.getBitmap();
  Position viewPos=getViewPosition(piece.getPosition());
  final float left=offset_ - imageRadius + viewPos.column * cellSize_;
  final float top=offset_ - imageRadius + viewPos.row * cellSize_;
  if (drawMode == PieceDrawMode.PIECE_DRAW_MODE_SELECTED) {
    Log.d(TAG,"String_Node_Str");
    canvas.drawRect(left - 3,top - 3,left + pieceSize_ + 3,top + pieceSize_ + 3,selectPaint_);
  }
 else   if (drawMode == PieceDrawMode.PIECE_DRAW_MODE_RECENT) {
    Log.d(TAG,"String_Node_Str");
    canvas.drawCircle(left + imageRadius,top + imageRadius,imageRadius + 6,recentPaint_);
  }
  canvas.drawBitmap(bitmap,null,new RectF(left,top,left + pieceSize_,top + pieceSize_),null);
}

Fixed version (ground truth):
private void drawPiece(Canvas canvas,Piece piece,PieceDrawMode drawMode){
  if (piece.isAnimated()) {
    final PointF point=piece.getPointF();
    drawPieceAtPoint(canvas,piece,point);
    return;
  }
  final int imageRadius=pieceSize_ / 2;
  Bitmap bitmap=piece.getBitmap();
  Position viewPos=getViewPosition(piece.getPosition());
  final float left=offset_ - imageRadius + viewPos.column * cellSize_;
  final float top=offset_ - imageRadius + viewPos.row * cellSize_;
  if (drawMode == PieceDrawMode.PIECE_DRAW_MODE_SELECTED) {
    Log.d(TAG,"String_Node_Str");
    canvas.drawRect(left - 3,top - 3,left + pieceSize_ + 3,top + pieceSize_ + 3,selectPaint_);
  }
 else   if (drawMode == PieceDrawMode.PIECE_DRAW_MODE_RECENT) {
    Log.v(TAG,"String_Node_Str");
    canvas.drawCircle(left + imageRadius,top + imageRadius,imageRadius + 6,recentPaint_);
  }
  canvas.drawBitmap(bitmap,null,new RectF(left,top,left + pieceSize_,top + pieceSize_),null);
}
Program: 41872
Project: 41872
Buggy source:
public void makeMove(final Position fromPos,final Position toPos,boolean animated){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos);
  final int status=referee_.validateMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
  Log.d(TAG,"String_Node_Str" + status);
  if (status == Referee.hoxGAME_STATUS_UNKNOWN) {
    Log.e(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos+ "String_Node_Str");
    return;
  }
  if (isBoardInReviewMode()) {
    addMoveToHistory(fromPos,toPos,null);
    return;
  }
  final Piece fromPiece=getPieceAtViewPosition(fromPos);
  Assert.assertNotNull("String_Node_Str" + fromPos,fromPiece);
  final Piece capture=tryCapturePieceAtPostion(toPos);
  if (animated) {
    Animator.AnimatorListener listener=new AnimatorListenerAdapter(){
      public void onAnimationEnd(      Animator animation){
        fromPiece.setPosition(toPos);
        fromPiece.setIsAnimated(false);
        recentPiece_=fromPiece;
        addMoveToHistory(fromPos,toPos,capture);
        didMoveOccur(fromPos,toPos,capture,status);
        BoardView.this.invalidate();
      }
    }
;
    movePieceToPositionWithAnimation(fromPiece,fromPos,toPos,listener);
  }
 else {
    fromPiece.setPosition(toPos);
    recentPiece_=fromPiece;
    addMoveToHistory(fromPos,toPos,capture);
    didMoveOccur(fromPos,toPos,capture,status);
  }
}

Fixed version (ground truth):
public void makeMove(final Position fromPos,final Position toPos,boolean animated){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos);
  final int status=referee_.validateMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
  Log.d(TAG,"String_Node_Str" + status);
  if (status == Referee.hoxGAME_STATUS_UNKNOWN) {
    Log.e(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos+ "String_Node_Str");
    return;
  }
  if (isBoardInReviewMode()) {
    addMoveToHistory(fromPos,toPos,null);
    return;
  }
  final Piece fromPiece=getPieceAtViewPosition(fromPos);
  Assert.assertNotNull("String_Node_Str" + fromPos,fromPiece);
  final Piece capture=tryCapturePieceAtPosition(toPos);
  if (animated) {
    Animator.AnimatorListener listener=new AnimatorListenerAdapter(){
      public void onAnimationEnd(      Animator animation){
        fromPiece.setPosition(toPos);
        fromPiece.setIsAnimated(false);
        recentPiece_=fromPiece;
        addMoveToHistory(fromPos,toPos,capture);
        didMoveOccur(fromPos,toPos,capture,status);
        BoardView.this.invalidate();
      }
    }
;
    movePieceToPositionWithAnimation(fromPiece,fromPos,toPos,listener);
  }
 else {
    fromPiece.setPosition(toPos);
    recentPiece_=fromPiece;
    addMoveToHistory(fromPos,toPos,capture);
    didMoveOccur(fromPos,toPos,capture,status);
  }
}
Program: 41873
Project: 41873
Buggy source:
public void run(){
  final String aiMove=aiEngine_.generateMove();
  Log.d(TAG,"String_Node_Str" + aiMove + "String_Node_Str");
  messageHandler_.sendMessage(messageHandler_.obtainMessage(MSG_AI_MOVE_READY,aiMove));
}

Fixed version (ground truth):
public void run(){
  aiRequest_=null;
  final String aiMove=aiEngine.generateMove();
  Log.d(TAG,"String_Node_Str" + aiMove + "String_Node_Str");
  sendMessage(obtainMessage(MSG_AI_MOVE_READY,aiMove));
}
Program: 41874
Project: 41874
Buggy source:
public void handleRequestToResetTable(){
  Log.i(TAG,"String_Node_Str");
  TableType tableType=playerTracker_.getTableType();
  if (tableType == TableType.TABLE_TYPE_LOCAL) {
    playerTracker_.syncUI();
    myColor_=ColorEnum.COLOR_RED;
    aiEngine_.initGame();
    timeTracker_.stop();
    timeTracker_.reset();
    MainActivity mainActivity=mainActivity_.get();
    if (mainActivity != null) {
      mainActivity.openNewPracticeTable();
    }
  }
 else   if (tableType == TableType.TABLE_TYPE_NETWORK) {
    if (!myTable_.isValid()) {
      Log.w(TAG,"String_Node_Str");
      return;
    }
    networkPlayer_.sendRequest_RESET(myTable_.tableId);
  }
}

Fixed version (ground truth):
public void handleRequestToResetTable(){
  Log.i(TAG,"String_Node_Str");
  TableType tableType=playerTracker_.getTableType();
  if (tableType == TableType.TABLE_TYPE_LOCAL) {
    messageHandler_.cancelAnyAIRequest();
    playerTracker_.syncUI();
    myColor_=ColorEnum.COLOR_RED;
    aiEngine_.initGame();
    timeTracker_.stop();
    timeTracker_.reset();
    MainActivity mainActivity=mainActivity_.get();
    if (mainActivity != null) {
      mainActivity.openNewPracticeTable();
    }
  }
 else   if (tableType == TableType.TABLE_TYPE_NETWORK) {
    if (!myTable_.isValid()) {
      Log.w(TAG,"String_Node_Str");
      return;
    }
    networkPlayer_.sendRequest_RESET(myTable_.tableId);
  }
}
Program: 41875
Project: 41875
Buggy source:
@SuppressLint("String_Node_Str") public void handleLocalMove(Position fromPos,Position toPos){
  Log.i(TAG,"String_Node_Str" + referee_.getMoveCount());
  timeTracker_.nextColor();
  if (referee_.getMoveCount() == 2) {
    timeTracker_.start();
    MainActivity mainActivity=mainActivity_.get();
    if (mainActivity != null) {
      mainActivity.onGameStatusChanged();
    }
  }
  if (referee_.getMoveCount() > 1) {
    playerTracker_.syncUI();
  }
  if (!myTable_.isValid()) {
    aiEngine_.onHumanMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
    if (!referee_.isGameInProgress()) {
      Log.i(TAG,"String_Node_Str");
      onGameEnded();
      return;
    }
    Log.d(TAG,"String_Node_Str");
    messageHandler_.postDelayed(new Runnable(){
      public void run(){
        final String aiMove=aiEngine_.generateMove();
        Log.d(TAG,"String_Node_Str" + aiMove + "String_Node_Str");
        messageHandler_.sendMessage(messageHandler_.obtainMessage(MSG_AI_MOVE_READY,aiMove));
      }
    }
,2000);
  }
 else {
    final String move=String.format("String_Node_Str",fromPos.column,fromPos.row,toPos.column,toPos.row);
    Log.i(TAG,"String_Node_Str" + move + "String_Node_Str");
    networkPlayer_.sendRequest_MOVE(myTable_.tableId,move);
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") public void handleLocalMove(Position fromPos,Position toPos){
  Log.i(TAG,"String_Node_Str" + referee_.getMoveCount());
  timeTracker_.nextColor();
  if (referee_.getMoveCount() == 2) {
    timeTracker_.start();
    MainActivity mainActivity=mainActivity_.get();
    if (mainActivity != null) {
      mainActivity.onGameStatusChanged();
    }
  }
  if (referee_.getMoveCount() > 1) {
    playerTracker_.syncUI();
  }
  if (!myTable_.isValid()) {
    aiEngine_.onHumanMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
    if (!referee_.isGameInProgress()) {
      Log.i(TAG,"String_Node_Str");
      onGameEnded();
      return;
    }
    final long delayMillis=2000;
    Log.d(TAG,"String_Node_Str" + delayMillis);
    messageHandler_.postAIRequest(aiEngine_,delayMillis);
  }
 else {
    final String move=String.format("String_Node_Str",fromPos.column,fromPos.row,toPos.column,toPos.row);
    Log.i(TAG,"String_Node_Str" + move + "String_Node_Str");
    networkPlayer_.sendRequest_MOVE(myTable_.tableId,move);
  }
}
Program: 41876
Project: 41876
Buggy source:
public void onReverseView(View view){
  boardView_.reverseView();
}

Fixed version (ground truth):
public void onReverseView(View view){
  reverseView();
}
Program: 41877
Project: 41877
Buggy source:
private void onLocalMoveMade(Position fromPos,Position toPos,Piece capture,int gameStatus){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos);
  addMoveToHistory(fromPos,toPos,capture);
  didMoveOccur(fromPos,toPos,capture,gameStatus);
  if (!isGameInProgress()) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  HoxApp.getApp().handleLocalMove(fromPos,toPos);
  if (tableType_ == TableType.TABLE_TYPE_LOCAL) {
    aiEngine_.onHumanMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
    Log.d(TAG,"String_Node_Str");
    new Thread(new Runnable(){
      public void run(){
        String aiMove=aiEngine_.generateMove();
        Log.d(TAG,"String_Node_Str" + aiMove + "String_Node_Str");
        messageHandler_.sendMessage(messageHandler_.obtainMessage(MSG_AI_MOVE_READY,aiMove));
      }
    }
).start();
  }
 else   if (tableType_ == TableType.TABLE_TYPE_NETWORK) {
    Log.d(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void onLocalMoveMade(Position fromPos,Position toPos,Piece capture,int gameStatus){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos);
  addMoveToHistory(fromPos,toPos,capture);
  didMoveOccur(fromPos,toPos,capture,gameStatus);
  HoxApp.getApp().handleLocalMove(fromPos,toPos);
  if (tableType_ == TableType.TABLE_TYPE_LOCAL) {
    aiEngine_.onHumanMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
    if (!isGameInProgress()) {
      Log.w(TAG,"String_Node_Str");
      return;
    }
    Log.d(TAG,"String_Node_Str");
    new Thread(new Runnable(){
      public void run(){
        String aiMove=aiEngine_.generateMove();
        Log.d(TAG,"String_Node_Str" + aiMove + "String_Node_Str");
        messageHandler_.sendMessage(messageHandler_.obtainMessage(MSG_AI_MOVE_READY,aiMove));
      }
    }
).start();
  }
 else   if (tableType_ == TableType.TABLE_TYPE_NETWORK) {
    Log.d(TAG,"String_Node_Str");
  }
}
Program: 41878
Project: 41878
Buggy source:
public void onAIMoveMade(Position fromPos,Position toPos){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos);
  final int status=nativeValidateMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
  Log.d(TAG,"String_Node_Str" + status);
  if (status == hoxGAME_STATUS_UNKNOWN) {
    Log.e(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos+ "String_Node_Str");
    return;
  }
  if (isBoardInReviewMode()) {
    addMoveToHistory(fromPos,toPos,null);
    return;
  }
  Piece capture=tryCapturePieceAtPostion(toPos);
  addMoveToHistory(fromPos,toPos,capture);
  Piece fromPiece=getPieceAtViewPosition(fromPos);
  if (fromPiece == null) {
    Log.e(TAG,"String_Node_Str" + fromPos);
    return;
  }
  fromPiece.setPosition(toPos);
  recentPiece_=fromPiece;
  HoxApp.getApp().handleAIMove(fromPos,toPos);
  didMoveOccur(fromPos,toPos,capture,status);
}

Fixed version (ground truth):
private void onAIMoveMade(Position fromPos,Position toPos){
  Log.d(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos);
  final int status=nativeValidateMove(fromPos.row,fromPos.column,toPos.row,toPos.column);
  Log.d(TAG,"String_Node_Str" + status);
  if (status == hoxGAME_STATUS_UNKNOWN) {
    Log.e(TAG,"String_Node_Str" + fromPos + "String_Node_Str"+ toPos+ "String_Node_Str");
    return;
  }
  if (isBoardInReviewMode()) {
    addMoveToHistory(fromPos,toPos,null);
    return;
  }
  Piece capture=tryCapturePieceAtPostion(toPos);
  addMoveToHistory(fromPos,toPos,capture);
  Piece fromPiece=getPieceAtViewPosition(fromPos);
  if (fromPiece == null) {
    Log.e(TAG,"String_Node_Str" + fromPos);
    return;
  }
  fromPiece.setPosition(toPos);
  recentPiece_=fromPiece;
  didMoveOccur(fromPos,toPos,capture,status);
  if (tableType_ == TableType.TABLE_TYPE_LOCAL) {
    HoxApp.getApp().handleAIMove(fromPos,toPos);
  }
}
Program: 41879
Project: 41879
Buggy source:
public void handleAIMove(Position fromPos,Position toPos){
  Log.i(TAG,"String_Node_Str");
  if (myTable_.isValid()) {
    Log.i(TAG,"String_Node_Str");
    return;
  }
  timeTracker_.nextColor();
}

Fixed version (ground truth):
public void handleAIMove(Position fromPos,Position toPos){
  Log.i(TAG,"String_Node_Str" + moveCount_);
  ++moveCount_;
  timeTracker_.nextColor();
  if (moveCount_ == 2) {
    timeTracker_.start();
  }
}
Program: 41880
Project: 41880
Buggy source:
private void handleNetworkEvent_I_TABLE(String content){
  Log.d(TAG,"String_Node_Str");
  MainActivity mainActivity=mainActivity_.get();
  if (mainActivity == null) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  isGameOver_=false;
  myTable_=new TableInfo(content);
  if (pid_.equals(myTable_.blackId)) {
    myColor_=ColorEnum.COLOR_BLACK;
  }
 else   if (pid_.equals(myTable_.redId)) {
    myColor_=ColorEnum.COLOR_RED;
  }
 else {
    myColor_=ColorEnum.COLOR_NONE;
  }
  Log.i(TAG,"String_Node_Str" + myTable_.tableId + "String_Node_Str"+ myColor_);
  timeTracker_.stop();
  timeTracker_.setInitialTime(new TimeInfo(myTable_.itimes));
  timeTracker_.setBlackTime(new TimeInfo(myTable_.blackTimes));
  timeTracker_.setRedTime(new TimeInfo(myTable_.redTimes));
  timeTracker_.syncUI();
  mainActivity.updateBoardWithNewTableInfo(myTable_);
}

Fixed version (ground truth):
private void handleNetworkEvent_I_TABLE(String content){
  Log.d(TAG,"String_Node_Str");
  MainActivity mainActivity=mainActivity_.get();
  if (mainActivity == null) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  isGameOver_=false;
  myTable_=new TableInfo(content);
  if (pid_.equals(myTable_.blackId)) {
    myColor_=ColorEnum.COLOR_BLACK;
  }
 else   if (pid_.equals(myTable_.redId)) {
    myColor_=ColorEnum.COLOR_RED;
  }
 else {
    myColor_=ColorEnum.COLOR_NONE;
  }
  Log.i(TAG,"String_Node_Str" + myTable_.tableId + "String_Node_Str"+ myColor_);
  timeTracker_.stop();
  timeTracker_.setInitialColor(ColorEnum.COLOR_RED);
  timeTracker_.setInitialTime(new TimeInfo(myTable_.itimes));
  timeTracker_.setBlackTime(new TimeInfo(myTable_.blackTimes));
  timeTracker_.setRedTime(new TimeInfo(myTable_.redTimes));
  timeTracker_.syncUI();
  mainActivity.updateBoardWithNewTableInfo(myTable_);
}
Program: 41881
Project: 41881
Buggy source:
@SuppressLint("String_Node_Str") public void handleLocalMove(Position fromPos,Position toPos){
  Log.i(TAG,"String_Node_Str");
  if (myTable_.isValid()) {
    final String move=String.format("String_Node_Str",fromPos.column,fromPos.row,toPos.column,toPos.row);
    Log.i(TAG,"String_Node_Str" + move + "String_Node_Str");
    networkPlayer_.sendRequest_MOVE(myTable_.tableId,move);
  }
  timeTracker_.nextColor();
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") public void handleLocalMove(Position fromPos,Position toPos){
  Log.i(TAG,"String_Node_Str" + moveCount_);
  ++moveCount_;
  timeTracker_.nextColor();
  if (moveCount_ == 2) {
    timeTracker_.start();
  }
  if (myTable_.isValid()) {
    final String move=String.format("String_Node_Str",fromPos.column,fromPos.row,toPos.column,toPos.row);
    Log.i(TAG,"String_Node_Str" + move + "String_Node_Str");
    networkPlayer_.sendRequest_MOVE(myTable_.tableId,move);
  }
}
Program: 41882
Project: 41882
Buggy source:
private void reverseView(){
  isBlackOnTop_=!isBlackOnTop_;
  boardView_.reverseView();
  CharSequence savedText=topPlayerLabel_.getText();
  topPlayerLabel_.setText(bottomPlayerLabel_.getText());
  bottomPlayerLabel_.setText(savedText);
  savedText=topPlayerButton_.getText();
  topPlayerButton_.setText(bottomPlayerButton_.getText());
  bottomPlayerButton_.setText(savedText);
}

Fixed version (ground truth):
private void reverseView(){
  isBlackOnTop_=!isBlackOnTop_;
  boardView_.reverseView();
  CharSequence savedText=topPlayerLabel_.getText();
  topPlayerLabel_.setText(bottomPlayerLabel_.getText());
  bottomPlayerLabel_.setText(savedText);
  savedText=topPlayerButton_.getText();
  topPlayerButton_.setText(bottomPlayerButton_.getText());
  bottomPlayerButton_.setText(savedText);
  HoxApp.getApp().getTimeTracker().reverseView();
}
Program: 41884
Project: 41884
Buggy source:
public void resetBoardWithNewMoves(String[] moves){
  Log.d(TAG,"String_Node_Str");
  for (  String move : moves) {
    Log.d(TAG,"String_Node_Str" + move + "String_Node_Str");
    int row1=move.charAt(1) - '0';
    int col1=move.charAt(0) - '0';
    int row2=move.charAt(3) - '0';
    int col2=move.charAt(2) - '0';
    Log.i(TAG,"String_Node_Str" + row1 + "String_Node_Str"+ col1+ "String_Node_Str"+ row2+ "String_Node_Str"+ col2+ "String_Node_Str");
    boardView_.onAIMoveMade(new Position(row1,col1),new Position(row2,col2));
  }
  boardView_.invalidate();
  final ColorEnum nextColor=boardView_.getNextColor();
  TableTimeTracker timeTracker=HoxApp.getApp().getTimeTracker();
  timeTracker.setInitialColor(nextColor);
  timeTracker.start();
}

Fixed version (ground truth):
public void resetBoardWithNewMoves(String[] moves){
  Log.d(TAG,"String_Node_Str");
  for (  String move : moves) {
    Log.d(TAG,"String_Node_Str" + move + "String_Node_Str");
    int row1=move.charAt(1) - '0';
    int col1=move.charAt(0) - '0';
    int row2=move.charAt(3) - '0';
    int col2=move.charAt(2) - '0';
    Log.i(TAG,"String_Node_Str" + row1 + "String_Node_Str"+ col1+ "String_Node_Str"+ row2+ "String_Node_Str"+ col2+ "String_Node_Str");
    boardView_.onNetworkMoveMade(new Position(row1,col1),new Position(row2,col2));
  }
  boardView_.invalidate();
  final ColorEnum nextColor=boardView_.getNextColor();
  TableTimeTracker timeTracker=HoxApp.getApp().getTimeTracker();
  timeTracker.setInitialColor(nextColor);
  timeTracker.start();
}
Program: 41885
Project: 41885
Buggy source:
public void updateBoardWithNewMove(String move){
  Log.d(TAG,"String_Node_Str" + move + "String_Node_Str");
  int row1=move.charAt(1) - '0';
  int col1=move.charAt(0) - '0';
  int row2=move.charAt(3) - '0';
  int col2=move.charAt(2) - '0';
  Log.i(TAG,"String_Node_Str" + row1 + "String_Node_Str"+ col1+ "String_Node_Str"+ row2+ "String_Node_Str"+ col2+ "String_Node_Str");
  boardView_.onAIMoveMade(new Position(row1,col1),new Position(row2,col2));
  boardView_.invalidate();
}

Fixed version (ground truth):
public void updateBoardWithNewMove(String move){
  Log.d(TAG,"String_Node_Str" + move + "String_Node_Str");
  int row1=move.charAt(1) - '0';
  int col1=move.charAt(0) - '0';
  int row2=move.charAt(3) - '0';
  int col2=move.charAt(2) - '0';
  Log.i(TAG,"String_Node_Str" + row1 + "String_Node_Str"+ col1+ "String_Node_Str"+ row2+ "String_Node_Str"+ col2+ "String_Node_Str");
  boardView_.onNetworkMoveMade(new Position(row1,col1),new Position(row2,col2));
  boardView_.invalidate();
}
Program: 41886
Project: 41886
Buggy source:
public void start(){
  if (!isRunning) {
    isRunning=true;
  }
}

Fixed version (ground truth):
public void start(){
  if (!isRunning) {
    Log.i(TAG,"String_Node_Str");
    isRunning=true;
  }
}
Program: 41887
Project: 41887
Buggy source:
private String formatTime(int timeInSeconds){
  final int minutes=timeInSeconds / 60;
  final int seconds=timeInSeconds % 60;
  return String.format("String_Node_Str",minutes,seconds);
}

Fixed version (ground truth):
private static String formatTime(int timeInSeconds){
  final int minutes=timeInSeconds / 60;
  final int seconds=timeInSeconds % 60;
  return String.format("String_Node_Str",minutes,seconds);
}
Program: 41888
Project: 41888
Buggy source:
public void reset(){
  blackTime_.initWith(initialTime_);
  redTime_.initWith(initialTime_);
  syncUI();
}

Fixed version (ground truth):
public void reset(){
  nextColor_=ColorEnum.COLOR_RED;
  blackTime_.initWith(initialTime_);
  redTime_.initWith(initialTime_);
  syncUI();
}
Program: 41889
Project: 41889
Buggy source:
/** 
 * Registers the partition resolver associated with the database link
 * @throws DocumentClientException 
 */
@Deprecated public void registerPartitionResolver(String databaseLink,PartitionResolver partitionResolver) throws DocumentClientException {
  if (StringUtils.isEmpty(databaseLink)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (partitionResolver == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.partitionResolvers.put(Utils.trimBeginingAndEndingSlashes(databaseLink),partitionResolver);
}

Fixed version (ground truth):
/** 
 * Registers the partition resolver associated with the database link.
 * @param databaseLink the database link
 * @param partitionResolver the partition resolver
 * @throws DocumentClientException the DocumentClientException
 */
@Deprecated public void registerPartitionResolver(String databaseLink,PartitionResolver partitionResolver) throws DocumentClientException {
  if (StringUtils.isEmpty(databaseLink)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (partitionResolver == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.partitionResolvers.put(Utils.trimBeginingAndEndingSlashes(databaseLink),partitionResolver);
}
Program: 41890
Project: 41890
Buggy source:
/** 
 * Gets the partition resolver associated with the database link on the client
 */
@Deprecated protected PartitionResolver getPartitionResolver(String databaseLink){
  if (StringUtils.isEmpty(databaseLink)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return this.partitionResolvers.get(Utils.trimBeginingAndEndingSlashes(databaseLink));
}

Fixed version (ground truth):
/** 
 * Gets the partition resolver associated with the database link on the client.
 * @param databaseLink the database link
 * @return the partition resolver
 */
@Deprecated protected PartitionResolver getPartitionResolver(String databaseLink){
  if (StringUtils.isEmpty(databaseLink)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return this.partitionResolvers.get(Utils.trimBeginingAndEndingSlashes(databaseLink));
}
Program: 41891
Project: 41891
Buggy source:
/** 
 * Gets the default service endpoint as passed in by the  user during construction.
 */
public URI getServiceEndpoint(){
  return this.serviceEndpoint;
}

Fixed version (ground truth):
/** 
 * Gets the default service endpoint as passed in by the user during construction.
 * @return the default service endpoint
 */
public URI getServiceEndpoint(){
  return this.serviceEndpoint;
}
Program: 41892
Project: 41892
Buggy source:
/** 
 * Gets the current read endpoint chosen based on availability and preference.
 */
public URI getReadEndpoint(){
  return this.globalEndpointManager.getReadEndpoint();
}

Fixed version (ground truth):
/** 
 * Gets the current read endpoint chosen based on availability and preference.
 * @return the current read endpoint
 */
public URI getReadEndpoint(){
  return this.globalEndpointManager.getReadEndpoint();
}
Program: 41893
Project: 41893
Buggy source:
/** 
 * Gets the current write endpoint chosen based on availability and preference.
 */
public URI getWriteEndpoint(){
  return this.globalEndpointManager.getWriteEndpoint();
}

Fixed version (ground truth):
/** 
 * Gets the current write endpoint chosen based on availability and preference.
 * @return the  current write endpoint
 */
public URI getWriteEndpoint(){
  return this.globalEndpointManager.getWriteEndpoint();
}
Program: 41894
Project: 41894
Buggy source:
/** 
 * Creates a new instance of the DocumentClientException class.
 * @param statusCode the http status code of the response.
 * @param errorResource the error resource object.
 * @param responseHeaders the response headers.
 */
public DocumentClientException(String resourceAddress,int statusCode,Error errorResource,Map<String,String> responseHeaders){
  super(errorResource.getMessage());
  this.resourceAddress=resourceAddress;
  this.statusCode=statusCode;
  this.error=errorResource;
  this.responseHeaders=responseHeaders;
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the DocumentClientException class.
 * @param resourceAddress the resource address
 * @param statusCode the http status code of the response
 * @param errorResource the error resource object
 * @param responseHeaders the response headers
 */
public DocumentClientException(String resourceAddress,int statusCode,Error errorResource,Map<String,String> responseHeaders){
  super(errorResource.getMessage());
  this.resourceAddress=resourceAddress;
  this.statusCode=statusCode;
  this.error=errorResource;
  this.responseHeaders=responseHeaders;
}
Program: 41895
Project: 41895
Buggy source:
/** 
 * Constructor.
 * @param jsonObject the json object that represents the index.
 */
protected Index(JSONObject jsonObject,IndexKind indexKind){
  super(jsonObject);
  this.setKind(indexKind);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the Index class.
 * @param jsonObject the json object that represents the index.
 * @param indexKind the index kind {@link IndexKind}
 */
protected Index(JSONObject jsonObject,IndexKind indexKind){
  super(jsonObject);
  this.setKind(indexKind);
}
Program: 41897
Project: 41897
Buggy source:
/** 
 * Initialize the common fields to both QueryIterable constructors
 */
private void initialize(DocumentClient client,ReadType readType,Class<T> classT){
  this.client=client;
  this.readType=readType;
  this.classT=classT;
}

Fixed version (ground truth):
/** 
 * Initialize the common fields to both QueryIterable constructors.
 * @param client the document client
 * @param readType the read type
 * @param classT the class type
 */
private void initialize(DocumentClient client,ReadType readType,Class<T> classT){
  this.client=client;
  this.readType=readType;
  this.classT=classT;
}
Program: 41898
Project: 41898
Buggy source:
/** 
 * Gets the value of the parameter. 
 * @param c the class of the parameter value.
 * @return the value of the parameter.
 */
public <T extends Object>Object getValue(Class<T> c){
  return super.getObject("String_Node_Str",c);
}

Fixed version (ground truth):
/** 
 * Gets the value of the parameter.
 * @param c the class of the parameter value.
 * @param < T > the parameter type
 * @return the value of the parameter.
 */
public <T extends Object>Object getValue(Class<T> c){
  return super.getObject("String_Node_Str",c);
}
Program: 41899
Project: 41899
Buggy source:
/** 
 * Constructor. Create a new instance of the Undefined object.
 */
private Undefined(){
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the Undefined class.
 */
private Undefined(){
}
Program: 41900
Project: 41900
Buggy source:
/** 
 * Returns the singleton value of Undfined.
 */
public static Undefined Value(){
  return value;
}

Fixed version (ground truth):
/** 
 * @return the singleton value of Undfined.
 */
public static Undefined Value(){
  return value;
}
Program: 41901
Project: 41901
Buggy source:
/** 
 * Returns the string representation of Undfined.
 */
public String toString(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * @return the string representation of Undfined.
 */
public String toString(){
  return "String_Node_Str";
}
Program: 41903
Project: 41903
Buggy source:
/** 
 * Sets the connection mode used in the client. Currently only Gateway in supported.
 * @param connectionMode the connection mode.
 */
public void setConnectionMode(ConnectionMode connectionMode){
  this.connectionMode=connectionMode;
}

Fixed version (ground truth):
/** 
 * Sets the connection mode used in the client. Currently only Gateway is supported.
 * @param connectionMode the connection mode.
 */
public void setConnectionMode(ConnectionMode connectionMode){
  this.connectionMode=connectionMode;
}
Program: 41904
Project: 41904
Buggy source:
/** 
 * Gets the connection mode used in the client. Currently only Gateway in supported.
 * @return the connection mode.
 */
public ConnectionMode getConnectionMode(){
  return this.connectionMode;
}

Fixed version (ground truth):
/** 
 * Gets the connection mode used in the client. Currently only Gateway is supported.
 * @return the connection mode.
 */
public ConnectionMode getConnectionMode(){
  return this.connectionMode;
}
Program: 41905
Project: 41905
Buggy source:
private void initialize(URI serviceEndpoint,ConnectionPolicy connectionPolicy,ConsistencyLevel desiredConsistencyLevel){
  this.serviceEndpoint=serviceEndpoint;
  if (connectionPolicy != null) {
    this.connectionPolicy=connectionPolicy;
  }
 else {
    this.connectionPolicy=new ConnectionPolicy();
  }
  this.retryPolicy=RetryPolicy.getDefault();
  this.sessionContainer=new SessionContainer(this.serviceEndpoint.getHost());
  this.desiredConsistencyLevel=desiredConsistencyLevel;
  UserAgentContainer userAgentContainer=new UserAgentContainer();
  String userAgentSuffix=connectionPolicy.getUserAgentSuffix();
  if (userAgentSuffix != null && userAgentSuffix.length() > 0) {
    userAgentContainer.setSuffix(userAgentSuffix);
  }
  this.gatewayProxy=new GatewayProxy(this.serviceEndpoint,this.connectionPolicy,desiredConsistencyLevel,this.queryCompatibilityMode,this.masterKey,this.resourceTokens,userAgentContainer);
}

Fixed version (ground truth):
private void initialize(URI serviceEndpoint,ConnectionPolicy connectionPolicy,ConsistencyLevel desiredConsistencyLevel){
  this.serviceEndpoint=serviceEndpoint;
  if (connectionPolicy != null) {
    this.connectionPolicy=connectionPolicy;
  }
 else {
    this.connectionPolicy=new ConnectionPolicy();
  }
  this.retryPolicy=RetryPolicy.getDefault();
  this.sessionContainer=new SessionContainer(this.serviceEndpoint.getHost());
  this.desiredConsistencyLevel=desiredConsistencyLevel;
  UserAgentContainer userAgentContainer=new UserAgentContainer();
  String userAgentSuffix=this.connectionPolicy.getUserAgentSuffix();
  if (userAgentSuffix != null && userAgentSuffix.length() > 0) {
    userAgentContainer.setSuffix(userAgentSuffix);
  }
  this.gatewayProxy=new GatewayProxy(this.serviceEndpoint,this.connectionPolicy,desiredConsistencyLevel,this.queryCompatibilityMode,this.masterKey,this.resourceTokens,userAgentContainer);
}
Program: 41906
Project: 41906
Buggy source:
/** 
 * Max Quota.
 * @return the document size quota.
 */
public long getCollectionSizeQuota(){
  return this.getMaxQuotaHeader(Constants.Quota.COLLECTION_SIZE);
}

Fixed version (ground truth):
/** 
 * Max Quota.
 * @return the collection size quota.
 */
public long getCollectionSizeQuota(){
  return this.getMaxQuotaHeader(Constants.Quota.COLLECTION_SIZE);
}
Program: 41907
Project: 41907
Buggy source:
/** 
 * Current Usage.
 * @return the current document size usage.
 */
public long getCollectionSizeUsage(){
  return this.getCurrentQuotaHeader(Constants.Quota.COLLECTION_SIZE);
}

Fixed version (ground truth):
/** 
 * Current Usage.
 * @return the current collection size usage.
 */
public long getCollectionSizeUsage(){
  return this.getCurrentQuotaHeader(Constants.Quota.COLLECTION_SIZE);
}
Program: 41909
Project: 41909
Buggy source:
private void putMoreContentIntoDocumentServiceRequest(DocumentServiceRequest request,String httpMethod){
  if (this.masterKey != null) {
    final Date currentTime=new Date();
    final SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str");
    sdf.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
    String xDate=sdf.format(currentTime);
    request.getHeaders().put(HttpConstants.HttpHeaders.X_DATE,xDate);
  }
  if (this.masterKey != null || this.resourceTokens != null) {
    String authorization=this.getAuthorizationToken(request.getResourceId(),request.getPath(),request.getResourceType(),httpMethod,request.getHeaders(),this.masterKey,this.resourceTokens);
    try {
      authorization=URLEncoder.encode(authorization,"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      throw new IllegalStateException("String_Node_Str",e);
    }
    request.getHeaders().put(HttpConstants.HttpHeaders.AUTHORIZATION,authorization);
  }
  if ((httpMethod == HttpConstants.HttpMethods.POST || httpMethod == HttpConstants.HttpMethods.PUT) && !request.getHeaders().containsKey(HttpConstants.HttpHeaders.CONTENT_TYPE)) {
    request.getHeaders().put(HttpConstants.HttpHeaders.CONTENT_TYPE,RuntimeConstants.MediaTypes.JSON);
  }
  if (!request.getHeaders().containsKey(HttpConstants.HttpHeaders.ACCEPT)) {
    request.getHeaders().put(HttpConstants.HttpHeaders.ACCEPT,RuntimeConstants.MediaTypes.JSON);
  }
}

Fixed version (ground truth):
private void putMoreContentIntoDocumentServiceRequest(DocumentServiceRequest request,String httpMethod){
  if (this.masterKey != null) {
    final Date currentTime=new Date();
    final SimpleDateFormat sdf=new SimpleDateFormat("String_Node_Str",Locale.US);
    sdf.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
    String xDate=sdf.format(currentTime);
    request.getHeaders().put(HttpConstants.HttpHeaders.X_DATE,xDate);
  }
  if (this.masterKey != null || this.resourceTokens != null) {
    String authorization=this.getAuthorizationToken(request.getResourceId(),request.getPath(),request.getResourceType(),httpMethod,request.getHeaders(),this.masterKey,this.resourceTokens);
    try {
      authorization=URLEncoder.encode(authorization,"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      throw new IllegalStateException("String_Node_Str",e);
    }
    request.getHeaders().put(HttpConstants.HttpHeaders.AUTHORIZATION,authorization);
  }
  if ((httpMethod == HttpConstants.HttpMethods.POST || httpMethod == HttpConstants.HttpMethods.PUT) && !request.getHeaders().containsKey(HttpConstants.HttpHeaders.CONTENT_TYPE)) {
    request.getHeaders().put(HttpConstants.HttpHeaders.CONTENT_TYPE,RuntimeConstants.MediaTypes.JSON);
  }
  if (!request.getHeaders().containsKey(HttpConstants.HttpHeaders.ACCEPT)) {
    request.getHeaders().put(HttpConstants.HttpHeaders.ACCEPT,RuntimeConstants.MediaTypes.JSON);
  }
}