nus-yam/ex-repair huggingface dataset:
Program: 87837
Project: 87837
Buggy source:
@Override public void showMoreKeysPanel(final View parentView,final Controller controller,final int pointX,final int pointY,final KeyboardActionListener listener){
  mController=controller;
  mListener=listener;
  final View container=getContainerView();
  final int x=pointX - getDefaultCoordX() - container.getPaddingLeft();
  final int y=pointY - container.getMeasuredHeight() + container.getPaddingBottom();
  parentView.getLocationInWindow(mCoordinates);
  final int maxX=parentView.getMeasuredWidth() - container.getMeasuredWidth();
  final int panelX=Math.max(0,Math.min(maxX,x + CoordinateUtils.x(mCoordinates)));
  final int panelY=y + CoordinateUtils.y(mCoordinates);
  container.setX(panelX);
  container.setY(panelY);
  mOriginX=x + container.getPaddingLeft();
  mOriginY=y + container.getPaddingTop();
  controller.onShowMoreKeysPanel(this);
}

Fixed version (ground truth):
@Override public void showMoreKeysPanel(final View parentView,final Controller controller,final int pointX,final int pointY,final KeyboardActionListener listener){
  mController=controller;
  mListener=listener;
  final View container=getContainerView();
  final int x=pointX - getDefaultCoordX() - container.getPaddingLeft();
  final int y=pointY - container.getMeasuredHeight() + container.getPaddingBottom();
  parentView.getLocationInWindow(mCoordinates);
  final int maxX=parentView.getMeasuredWidth() - container.getMeasuredWidth();
  final int panelX=Math.max(0,Math.min(maxX,x)) + CoordinateUtils.x(mCoordinates);
  final int panelY=y + CoordinateUtils.y(mCoordinates);
  container.setX(panelX);
  container.setY(panelY);
  mOriginX=x + container.getPaddingLeft();
  mOriginY=y + container.getPaddingTop();
  controller.onShowMoreKeysPanel(this);
}
Program: 87841
Project: 87841
Buggy source:
public static void latinIME_onWindowHidden(final int savedSelectionStart,final int savedSelectionEnd,final InputConnection ic){
  if (ic != null) {
    ic.beginBatchEdit();
    ic.performContextMenuAction(android.R.id.selectAll);
    CharSequence charSequence=ic.getSelectedText(0);
    ic.setSelection(savedSelectionStart,savedSelectionEnd);
    ic.endBatchEdit();
    sLatinIMEExpectingUpdateSelection=true;
    final Object[] values=new Object[2];
    if (OUTPUT_ENTIRE_BUFFER) {
      if (TextUtils.isEmpty(charSequence)) {
        values[0]=false;
        values[1]="String_Node_Str";
      }
 else {
        if (charSequence.length() > MAX_INPUTVIEW_LENGTH_TO_CAPTURE) {
          int length=MAX_INPUTVIEW_LENGTH_TO_CAPTURE;
          final char c=charSequence.charAt(length - 1);
          if (Character.isHighSurrogate(c)) {
            length--;
          }
          final CharSequence truncatedCharSequence=charSequence.subSequence(0,length);
          values[0]=true;
          values[1]=truncatedCharSequence.toString();
        }
 else {
          values[0]=false;
          values[1]=charSequence.toString();
        }
      }
    }
 else {
      values[0]=true;
      values[1]="String_Node_Str";
    }
    final ResearchLogger researchLogger=getInstance();
    researchLogger.enqueueEvent(EVENTKEYS_LATINIME_ONWINDOWHIDDEN,values);
    researchLogger.commitCurrentLogUnit();
    getInstance().stop();
  }
}

Fixed version (ground truth):
public static void latinIME_onWindowHidden(final int savedSelectionStart,final int savedSelectionEnd,final InputConnection ic){
  if (ic != null) {
    final Object[] values=new Object[2];
    if (OUTPUT_ENTIRE_BUFFER) {
      ic.beginBatchEdit();
      ic.performContextMenuAction(android.R.id.selectAll);
      CharSequence charSequence=ic.getSelectedText(0);
      if (savedSelectionStart != -1 && savedSelectionEnd != -1) {
        ic.setSelection(savedSelectionStart,savedSelectionEnd);
      }
      ic.endBatchEdit();
      sLatinIMEExpectingUpdateSelection=true;
      if (TextUtils.isEmpty(charSequence)) {
        values[0]=false;
        values[1]="String_Node_Str";
      }
 else {
        if (charSequence.length() > MAX_INPUTVIEW_LENGTH_TO_CAPTURE) {
          int length=MAX_INPUTVIEW_LENGTH_TO_CAPTURE;
          final char c=charSequence.charAt(length - 1);
          if (Character.isHighSurrogate(c)) {
            length--;
          }
          final CharSequence truncatedCharSequence=charSequence.subSequence(0,length);
          values[0]=true;
          values[1]=truncatedCharSequence.toString();
        }
 else {
          values[0]=false;
          values[1]=charSequence.toString();
        }
      }
    }
 else {
      values[0]=true;
      values[1]="String_Node_Str";
    }
    final ResearchLogger researchLogger=getInstance();
    researchLogger.enqueueEvent(EVENTKEYS_LATINIME_ONWINDOWHIDDEN,values);
    researchLogger.commitCurrentLogUnit();
    getInstance().stop();
  }
}
Program: 87842
Project: 87842
Buggy source:
public static void latinIME_onWindowHidden(final int savedSelectionStart,final int savedSelectionEnd,final InputConnection ic){
  if (ic != null) {
    ic.beginBatchEdit();
    ic.performContextMenuAction(android.R.id.selectAll);
    CharSequence charSequence=ic.getSelectedText(0);
    ic.setSelection(savedSelectionStart,savedSelectionEnd);
    ic.endBatchEdit();
    sLatinIMEExpectingUpdateSelection=true;
    final Object[] values=new Object[2];
    if (OUTPUT_ENTIRE_BUFFER) {
      if (TextUtils.isEmpty(charSequence)) {
        values[0]=false;
        values[1]="String_Node_Str";
      }
 else {
        if (charSequence.length() > MAX_INPUTVIEW_LENGTH_TO_CAPTURE) {
          int length=MAX_INPUTVIEW_LENGTH_TO_CAPTURE;
          final char c=charSequence.charAt(length - 1);
          if (Character.isHighSurrogate(c)) {
            length--;
          }
          final CharSequence truncatedCharSequence=charSequence.subSequence(0,length);
          values[0]=true;
          values[1]=truncatedCharSequence.toString();
        }
 else {
          values[0]=false;
          values[1]=charSequence.toString();
        }
      }
    }
 else {
      values[0]=true;
      values[1]="String_Node_Str";
    }
    final ResearchLogger researchLogger=getInstance();
    researchLogger.enqueueEvent(EVENTKEYS_LATINIME_ONWINDOWHIDDEN,values);
    researchLogger.commitCurrentLogUnit();
    getInstance().stop();
  }
}

Fixed version (ground truth):
public static void latinIME_onWindowHidden(final int savedSelectionStart,final int savedSelectionEnd,final InputConnection ic){
  if (ic != null) {
    final Object[] values=new Object[2];
    if (OUTPUT_ENTIRE_BUFFER) {
      ic.beginBatchEdit();
      ic.performContextMenuAction(android.R.id.selectAll);
      CharSequence charSequence=ic.getSelectedText(0);
      if (savedSelectionStart != -1 && savedSelectionEnd != -1) {
        ic.setSelection(savedSelectionStart,savedSelectionEnd);
      }
      ic.endBatchEdit();
      sLatinIMEExpectingUpdateSelection=true;
      if (TextUtils.isEmpty(charSequence)) {
        values[0]=false;
        values[1]="String_Node_Str";
      }
 else {
        if (charSequence.length() > MAX_INPUTVIEW_LENGTH_TO_CAPTURE) {
          int length=MAX_INPUTVIEW_LENGTH_TO_CAPTURE;
          final char c=charSequence.charAt(length - 1);
          if (Character.isHighSurrogate(c)) {
            length--;
          }
          final CharSequence truncatedCharSequence=charSequence.subSequence(0,length);
          values[0]=true;
          values[1]=truncatedCharSequence.toString();
        }
 else {
          values[0]=false;
          values[1]=charSequence.toString();
        }
      }
    }
 else {
      values[0]=true;
      values[1]="String_Node_Str";
    }
    final ResearchLogger researchLogger=getInstance();
    researchLogger.enqueueEvent(EVENTKEYS_LATINIME_ONWINDOWHIDDEN,values);
    researchLogger.commitCurrentLogUnit();
    getInstance().stop();
  }
}
Program: 87843
Project: 87843
Buggy source:
private void setContextThemeWrapper(Context context,KeyboardTheme keyboardTheme){
  if (mKeyboardTheme.mThemeId != keyboardTheme.mThemeId) {
    mKeyboardTheme=keyboardTheme;
    mThemeContext=new ContextThemeWrapper(context,keyboardTheme.mStyleId);
    KeyboardLayoutSet.clearKeyboardCache();
  }
}

Fixed version (ground truth):
private void setContextThemeWrapper(Context context,KeyboardTheme keyboardTheme){
  if (mThemeContext == null || mKeyboardTheme.mThemeId != keyboardTheme.mThemeId) {
    mKeyboardTheme=keyboardTheme;
    mThemeContext=new ContextThemeWrapper(context,keyboardTheme.mStyleId);
    KeyboardLayoutSet.clearKeyboardCache();
  }
}
Program: 87844
Project: 87844
Buggy source:
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  mCommittedTextBeforeComposingText.append(getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0));
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}

Fixed version (ground truth):
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  final CharSequence textBeforeCursor=getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0);
  if (null != textBeforeCursor)   mCommittedTextBeforeComposingText.append(textBeforeCursor);
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}
Program: 87845
Project: 87845
Buggy source:
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  mCommittedTextBeforeComposingText.append(getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0));
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}

Fixed version (ground truth):
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  final CharSequence textBeforeCursor=getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0);
  if (null != textBeforeCursor)   mCommittedTextBeforeComposingText.append(textBeforeCursor);
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}
Program: 87846
Project: 87846
Buggy source:
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  mCommittedTextBeforeComposingText.append(getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0));
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}

Fixed version (ground truth):
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  final CharSequence textBeforeCursor=getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0);
  if (null != textBeforeCursor)   mCommittedTextBeforeComposingText.append(textBeforeCursor);
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}
Program: 87847
Project: 87847
Buggy source:
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  mCommittedTextBeforeComposingText.append(getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0));
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}

Fixed version (ground truth):
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  final CharSequence textBeforeCursor=getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0);
  if (null != textBeforeCursor)   mCommittedTextBeforeComposingText.append(textBeforeCursor);
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}
Program: 87848
Project: 87848
Buggy source:
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  mCommittedTextBeforeComposingText.append(getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0));
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}

Fixed version (ground truth):
public void resetCachesUponCursorMove(final int newCursorPosition){
  mCurrentCursorPosition=newCursorPosition;
  mComposingText.setLength(0);
  mCommittedTextBeforeComposingText.setLength(0);
  final CharSequence textBeforeCursor=getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE,0);
  if (null != textBeforeCursor)   mCommittedTextBeforeComposingText.append(textBeforeCursor);
  mCharAfterTheCursor=getTextAfterCursor(1,0);
  if (null != mIC) {
    mIC.finishComposingText();
    if (ProductionFlag.IS_EXPERIMENTAL) {
      ResearchLogger.richInputConnection_finishComposingText();
    }
  }
}
Program: 87849
Project: 87849
Buggy source:
private static boolean hasAttributesDifferencesAndPrintThemIfAny(final String word,final String type,final ArrayList<WeightedString> list0,final ArrayList<WeightedString> list1){
  if (null == list1) {
    if (null == list0)     return false;
    for (    final WeightedString attribute0 : list0) {
      System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute0.mWord+ "String_Node_Str"+ attribute0.mFrequency);
    }
    return true;
  }
  boolean hasDifferences=false;
  if (null != list0) {
    for (    final WeightedString attribute0 : list0) {
      if (!list1.contains(attribute0)) {
        hasDifferences=true;
        for (        final WeightedString attribute1 : list1) {
          if (attribute0.mWord.equals(attribute1.mWord)) {
            System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute0.mWord+ "String_Node_Str"+ attribute0.mFrequency+ "String_Node_Str"+ attribute1.mFrequency);
            list1.remove(attribute1);
            break;
          }
          System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute0.mWord);
        }
      }
 else {
        list1.remove(attribute0);
      }
    }
  }
  for (  final WeightedString attribute1 : list1) {
    hasDifferences=true;
    System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute1.mWord+ "String_Node_Str"+ attribute1.mFrequency);
  }
  return hasDifferences;
}

Fixed version (ground truth):
private static boolean hasAttributesDifferencesAndPrintThemIfAny(final String word,final String type,final ArrayList<WeightedString> list0,final ArrayList<WeightedString> list1){
  if (null == list1) {
    if (null == list0)     return false;
    for (    final WeightedString attribute0 : list0) {
      System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute0.mWord+ "String_Node_Str"+ attribute0.mFrequency);
    }
    return true;
  }
  boolean hasDifferences=false;
  if (null != list0) {
    for (    final WeightedString attribute0 : list0) {
      if (!list1.contains(attribute0)) {
        hasDifferences=true;
        boolean foundString=false;
        for (        final WeightedString attribute1 : list1) {
          if (attribute0.mWord.equals(attribute1.mWord)) {
            System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute0.mWord+ "String_Node_Str"+ attribute0.mFrequency+ "String_Node_Str"+ attribute1.mFrequency);
            list1.remove(attribute1);
            foundString=true;
            break;
          }
        }
        if (!foundString) {
          System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute0.mWord+ "String_Node_Str"+ attribute0.mFrequency);
        }
      }
 else {
        list1.remove(attribute0);
      }
    }
  }
  for (  final WeightedString attribute1 : list1) {
    hasDifferences=true;
    System.out.println(type + "String_Node_Str" + word+ "String_Node_Str"+ attribute1.mWord+ "String_Node_Str"+ attribute1.mFrequency);
  }
  return hasDifferences;
}
Program: 87850
Project: 87850
Buggy source:
/** 
 * Helper method to add a new bigram to the dictionary.
 * @param word1 the previous word of the context
 * @param word2 the next word of the context
 * @param frequency the bigram frequency
 */
public void setBigram(final String word1,final String word2,final int frequency){
  CharGroup charGroup=findWordInTree(mRoot,word1);
  if (charGroup != null) {
    final CharGroup charGroup2=findWordInTree(mRoot,word2);
    if (charGroup2 == null) {
      add(getCodePoints(word2),0,null,false,false);
    }
    charGroup.addBigram(word2,frequency);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Helper method to add a new bigram to the dictionary.
 * @param word1 the previous word of the context
 * @param word2 the next word of the context
 * @param frequency the bigram frequency
 */
public void setBigram(final String word1,final String word2,final int frequency){
  CharGroup charGroup=findWordInTree(mRoot,word1);
  if (charGroup != null) {
    final CharGroup charGroup2=findWordInTree(mRoot,word2);
    if (charGroup2 == null) {
      add(getCodePoints(word2),0,null,false,false);
      charGroup=findWordInTree(mRoot,word1);
    }
    charGroup.addBigram(word2,frequency);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 87856
Project: 87856
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  if (size() <= 1) {
    return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED;
  }
 else {
    return mCapsCount == size();
  }
}
Program: 87857
Project: 87857
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  if (size() <= 1) {
    return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED;
  }
 else {
    return mCapsCount == size();
  }
}
Program: 87858
Project: 87858
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 0) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}
Program: 87859
Project: 87859
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 0) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}
Program: 87860
Project: 87860
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 0) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}
Program: 87861
Project: 87861
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  if (size() <= 1) {
    return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED;
  }
 else {
    return mCapsCount == size();
  }
}
Program: 87862
Project: 87862
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  if (size() <= 1) {
    return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED;
  }
 else {
    return mCapsCount == size();
  }
}
Program: 87863
Project: 87863
Buggy source:
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < s.length()) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < s.length());
  if (index < s.length())   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}

Fixed version (ground truth):
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  final int codePointCountInS=s.codePointCount(0,s.length());
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < codePointCountInS) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < codePointCountInS);
  if (index < codePointCountInS)   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}
Program: 87864
Project: 87864
Buggy source:
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < s.length()) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < s.length());
  if (index < s.length())   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}

Fixed version (ground truth):
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  final int codePointCountInS=s.codePointCount(0,s.length());
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < codePointCountInS) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < codePointCountInS);
  if (index < codePointCountInS)   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}
Program: 87865
Project: 87865
Buggy source:
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 0) && (mCapsCount == size());
}

Fixed version (ground truth):
/** 
 * Whether or not all of the user typed chars are upper case
 * @return true if all user typed chars are upper case, false otherwise
 */
public boolean isAllUpperCase(){
  return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED || (mCapsCount > 1) && (mCapsCount == size());
}
Program: 87866
Project: 87866
Buggy source:
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < s.length()) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < s.length());
  if (index < s.length())   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}

Fixed version (ground truth):
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  final int codePointCountInS=s.codePointCount(0,s.length());
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < codePointCountInS) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < codePointCountInS);
  if (index < codePointCountInS)   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}
Program: 87867
Project: 87867
Buggy source:
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < s.length()) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < s.length());
  if (index < s.length())   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}

Fixed version (ground truth):
/** 
 * Helper method to find a word in a given branch.
 */
public static CharGroup findWordInTree(Node node,final String s){
  int index=0;
  final StringBuilder checker=DBG ? new StringBuilder() : null;
  CharGroup currentGroup;
  final int codePointCountInS=s.codePointCount(0,s.length());
  do {
    int indexOfGroup=findIndexOfChar(node,s.codePointAt(index));
    if (CHARACTER_NOT_FOUND == indexOfGroup)     return null;
    currentGroup=node.mData.get(indexOfGroup);
    if (s.length() - index < currentGroup.mChars.length)     return null;
    int newIndex=index;
    while (newIndex < s.length() && newIndex - index < currentGroup.mChars.length) {
      if (currentGroup.mChars[newIndex - index] != s.codePointAt(newIndex))       return null;
      newIndex++;
    }
    index=newIndex;
    if (DBG)     checker.append(new String(currentGroup.mChars,0,currentGroup.mChars.length));
    if (index < codePointCountInS) {
      node=currentGroup.mChildren;
    }
  }
 while (null != node && index < codePointCountInS);
  if (index < codePointCountInS)   return null;
  if (!currentGroup.isTerminal())   return null;
  if (DBG && !s.equals(checker.toString()))   return null;
  return currentGroup;
}
Program: 87871
Project: 87871
Buggy source:
/** 
 * Append the times, x-coordinates and y-coordinates in the specified   {@link ResizableIntArray}to the end of this.
 * @param pointerId the pointer id of the source.
 * @param times the source {@link ResizableIntArray} to read the event times from.
 * @param xCoordinates the source {@link ResizableIntArray} to read the x-coordinates from.
 * @param yCoordinates the source {@link ResizableIntArray} to read the y-coordinates from.
 * @param startPos the starting index of the data in {@code times} and etc.
 * @param length the number of data to be appended.
 */
public void append(int pointerId,ResizableIntArray times,ResizableIntArray xCoordinates,ResizableIntArray yCoordinates,int startPos,int length){
  if (length == 0) {
    return;
  }
  mXCoordinates.append(xCoordinates,startPos,length);
  mYCoordinates.append(yCoordinates,startPos,length);
  mPointerIds.fill(pointerId,startPos,length);
  mTimes.append(times,startPos,length);
}

Fixed version (ground truth):
/** 
 * Append the times, x-coordinates and y-coordinates in the specified   {@link ResizableIntArray}to the end of this.
 * @param pointerId the pointer id of the source.
 * @param times the source {@link ResizableIntArray} to read the event times from.
 * @param xCoordinates the source {@link ResizableIntArray} to read the x-coordinates from.
 * @param yCoordinates the source {@link ResizableIntArray} to read the y-coordinates from.
 * @param startPos the starting index of the data in {@code times} and etc.
 * @param length the number of data to be appended.
 */
public void append(int pointerId,ResizableIntArray times,ResizableIntArray xCoordinates,ResizableIntArray yCoordinates,int startPos,int length){
  if (length == 0) {
    return;
  }
  mXCoordinates.append(xCoordinates,startPos,length);
  mYCoordinates.append(yCoordinates,startPos,length);
  mPointerIds.fill(pointerId,mPointerIds.getLength(),length);
  mTimes.append(times,startPos,length);
}
Program: 87872
Project: 87872
Buggy source:
/** 
 * Append the times, x-coordinates and y-coordinates in the specified   {@link ResizableIntArray}to the end of this.
 * @param pointerId the pointer id of the source.
 * @param times the source {@link ResizableIntArray} to read the event times from.
 * @param xCoordinates the source {@link ResizableIntArray} to read the x-coordinates from.
 * @param yCoordinates the source {@link ResizableIntArray} to read the y-coordinates from.
 * @param startPos the starting index of the data in {@code times} and etc.
 * @param length the number of data to be appended.
 */
public void append(int pointerId,ResizableIntArray times,ResizableIntArray xCoordinates,ResizableIntArray yCoordinates,int startPos,int length){
  if (length == 0) {
    return;
  }
  mXCoordinates.append(xCoordinates,startPos,length);
  mYCoordinates.append(yCoordinates,startPos,length);
  mPointerIds.fill(pointerId,startPos,length);
  mTimes.append(times,startPos,length);
}

Fixed version (ground truth):
/** 
 * Append the times, x-coordinates and y-coordinates in the specified   {@link ResizableIntArray}to the end of this.
 * @param pointerId the pointer id of the source.
 * @param times the source {@link ResizableIntArray} to read the event times from.
 * @param xCoordinates the source {@link ResizableIntArray} to read the x-coordinates from.
 * @param yCoordinates the source {@link ResizableIntArray} to read the y-coordinates from.
 * @param startPos the starting index of the data in {@code times} and etc.
 * @param length the number of data to be appended.
 */
public void append(int pointerId,ResizableIntArray times,ResizableIntArray xCoordinates,ResizableIntArray yCoordinates,int startPos,int length){
  if (length == 0) {
    return;
  }
  mXCoordinates.append(xCoordinates,startPos,length);
  mYCoordinates.append(yCoordinates,startPos,length);
  mPointerIds.fill(pointerId,mPointerIds.getLength(),length);
  mTimes.append(times,startPos,length);
}
Program: 87873
Project: 87873
Buggy source:
/** 
 * Append the times, x-coordinates and y-coordinates in the specified   {@link ResizableIntArray}to the end of this.
 * @param pointerId the pointer id of the source.
 * @param times the source {@link ResizableIntArray} to read the event times from.
 * @param xCoordinates the source {@link ResizableIntArray} to read the x-coordinates from.
 * @param yCoordinates the source {@link ResizableIntArray} to read the y-coordinates from.
 * @param startPos the starting index of the data in {@code times} and etc.
 * @param length the number of data to be appended.
 */
public void append(int pointerId,ResizableIntArray times,ResizableIntArray xCoordinates,ResizableIntArray yCoordinates,int startPos,int length){
  if (length == 0) {
    return;
  }
  mXCoordinates.append(xCoordinates,startPos,length);
  mYCoordinates.append(yCoordinates,startPos,length);
  mPointerIds.fill(pointerId,startPos,length);
  mTimes.append(times,startPos,length);
}

Fixed version (ground truth):
/** 
 * Append the times, x-coordinates and y-coordinates in the specified   {@link ResizableIntArray}to the end of this.
 * @param pointerId the pointer id of the source.
 * @param times the source {@link ResizableIntArray} to read the event times from.
 * @param xCoordinates the source {@link ResizableIntArray} to read the x-coordinates from.
 * @param yCoordinates the source {@link ResizableIntArray} to read the y-coordinates from.
 * @param startPos the starting index of the data in {@code times} and etc.
 * @param length the number of data to be appended.
 */
public void append(int pointerId,ResizableIntArray times,ResizableIntArray xCoordinates,ResizableIntArray yCoordinates,int startPos,int length){
  if (length == 0) {
    return;
  }
  mXCoordinates.append(xCoordinates,startPos,length);
  mYCoordinates.append(yCoordinates,startPos,length);
  mPointerIds.fill(pointerId,mPointerIds.getLength(),length);
  mTimes.append(times,startPos,length);
}
Program: 87874
Project: 87874
Buggy source:
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() <= 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=new ArrayList<SuggestedWordInfo>();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}

Fixed version (ground truth):
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() > 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=new ArrayList<SuggestedWordInfo>();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}
Program: 87875
Project: 87875
Buggy source:
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() <= 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}

Fixed version (ground truth):
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() > 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}
Program: 87876
Project: 87876
Buggy source:
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() <= 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}

Fixed version (ground truth):
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() > 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}
Program: 87877
Project: 87877
Buggy source:
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() <= 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}

Fixed version (ground truth):
@Override public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer,final CharSequence prevWord,final ProximityInfo proximityInfo){
  if (reloadDictionaryIfRequired())   return null;
  if (composer.size() > 1) {
    if (composer.size() >= BinaryDictionary.MAX_WORD_LENGTH) {
      return null;
    }
    final ArrayList<SuggestedWordInfo> suggestions=getWordsInner(composer,prevWord,proximityInfo);
    return suggestions;
  }
 else {
    if (TextUtils.isEmpty(prevWord))     return null;
    final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
    runBigramReverseLookUp(prevWord,suggestions);
    return suggestions;
  }
}
Program: 87881
Project: 87881
Buggy source:
@Override public void onDraw(Canvas canvas){
  super.onDraw(canvas);
  canvas.translate(mParams.mCoordinates[0],mParams.mCoordinates[1]);
  PointerTracker.drawGestureTrailForAllPointerTrackers(canvas,mGesturePaint);
}

Fixed version (ground truth):
@Override public void onDraw(Canvas canvas){
  super.onDraw(canvas);
  canvas.translate(mParams.mCoordinates[0],mParams.mCoordinates[1]);
  PointerTracker.drawGestureTrailForAllPointerTrackers(canvas,mGesturePaint);
  canvas.translate(-mParams.mCoordinates[0],-mParams.mCoordinates[1]);
}
Program: 87883
Project: 87883
Buggy source:
@Override public void onDraw(Canvas canvas){
  super.onDraw(canvas);
  canvas.translate(mParams.mCoordinates[0],mParams.mCoordinates[1]);
  PointerTracker.drawGestureTrailForAllPointerTrackers(canvas,mGesturePaint);
}

Fixed version (ground truth):
@Override public void onDraw(Canvas canvas){
  super.onDraw(canvas);
  canvas.translate(mParams.mCoordinates[0],mParams.mCoordinates[1]);
  PointerTracker.drawGestureTrailForAllPointerTrackers(canvas,mGesturePaint);
  canvas.translate(-mParams.mCoordinates[0],-mParams.mCoordinates[1]);
}
Program: 87885
Project: 87885
Buggy source:
public LastComposedWord commitWord(final int type,final String committedWord,final int separatorCode,final CharSequence prevWord){
  final int[] primaryKeyCodes=mPrimaryKeyCodes;
  mPrimaryKeyCodes=new int[N];
  final LastComposedWord lastComposedWord=new LastComposedWord(primaryKeyCodes,mInputPointers,mTypedWord.toString(),committedWord,separatorCode,prevWord);
  mInputPointers.reset();
  if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD && type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) {
    lastComposedWord.deactivate();
  }
  mTypedWord.setLength(0);
  mTrailingSingleQuotesCount=0;
  refreshSize();
  mAutoCorrection=null;
  mIsResumed=false;
  return lastComposedWord;
}

Fixed version (ground truth):
public LastComposedWord commitWord(final int type,final String committedWord,final int separatorCode,final CharSequence prevWord){
  final int[] primaryKeyCodes=mPrimaryKeyCodes;
  mPrimaryKeyCodes=new int[N];
  final LastComposedWord lastComposedWord=new LastComposedWord(primaryKeyCodes,mInputPointers,mTypedWord.toString(),committedWord,separatorCode,prevWord);
  mInputPointers.reset();
  if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD && type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) {
    lastComposedWord.deactivate();
  }
  mCapsCount=0;
  mIsBatchMode=false;
  mTypedWord.setLength(0);
  mTrailingSingleQuotesCount=0;
  mIsFirstCharCapitalized=false;
  refreshSize();
  mAutoCorrection=null;
  mIsResumed=false;
  return lastComposedWord;
}