nus-yam/ex-repair huggingface dataset:
Program: 87508
Project: 87508
Buggy source:
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiKeyboard() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}

Fixed version (ground truth):
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiPalettes() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}
Program: 87509
Project: 87509
Buggy source:
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final MainKeyboardView mainKeyboardView=mKeyboardSwitcher.getMainKeyboardView();
    final boolean inputViewShown=(mainKeyboardView != null) ? mainKeyboardView.isShown() : false;
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}

Fixed version (ground truth):
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final boolean inputViewShown=mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}
Program: 87510
Project: 87510
Buggy source:
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiKeyboard()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}

Fixed version (ground truth):
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiPalettes()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}
Program: 87511
Project: 87511
Buggy source:
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiKeyboard()) {
    mState.onSaveKeyboardState();
  }
}

Fixed version (ground truth):
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiPalettes()) {
    mState.onSaveKeyboardState();
  }
}
Program: 87512
Project: 87512
Buggy source:
public View getVisibleKeyboardView(){
  if (isShowingEmojiKeyboard()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}

Fixed version (ground truth):
public View getVisibleKeyboardView(){
  if (isShowingEmojiPalettes()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}
Program: 87513
Project: 87513
Buggy source:
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiKeyboard() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}

Fixed version (ground truth):
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiPalettes() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}
Program: 87514
Project: 87514
Buggy source:
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final MainKeyboardView mainKeyboardView=mKeyboardSwitcher.getMainKeyboardView();
    final boolean inputViewShown=(mainKeyboardView != null) ? mainKeyboardView.isShown() : false;
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}

Fixed version (ground truth):
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final boolean inputViewShown=mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}
Program: 87515
Project: 87515
Buggy source:
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiKeyboard()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}

Fixed version (ground truth):
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiPalettes()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}
Program: 87516
Project: 87516
Buggy source:
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiKeyboard()) {
    mState.onSaveKeyboardState();
  }
}

Fixed version (ground truth):
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiPalettes()) {
    mState.onSaveKeyboardState();
  }
}
Program: 87517
Project: 87517
Buggy source:
public View getVisibleKeyboardView(){
  if (isShowingEmojiKeyboard()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}

Fixed version (ground truth):
public View getVisibleKeyboardView(){
  if (isShowingEmojiPalettes()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}
Program: 87518
Project: 87518
Buggy source:
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiKeyboard() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}

Fixed version (ground truth):
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiPalettes() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}
Program: 87519
Project: 87519
Buggy source:
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final MainKeyboardView mainKeyboardView=mKeyboardSwitcher.getMainKeyboardView();
    final boolean inputViewShown=(mainKeyboardView != null) ? mainKeyboardView.isShown() : false;
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}

Fixed version (ground truth):
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final boolean inputViewShown=mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}
Program: 87520
Project: 87520
Buggy source:
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiKeyboard()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}

Fixed version (ground truth):
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiPalettes()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}
Program: 87521
Project: 87521
Buggy source:
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiKeyboard()) {
    mState.onSaveKeyboardState();
  }
}

Fixed version (ground truth):
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiPalettes()) {
    mState.onSaveKeyboardState();
  }
}
Program: 87522
Project: 87522
Buggy source:
public View getVisibleKeyboardView(){
  if (isShowingEmojiKeyboard()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}

Fixed version (ground truth):
public View getVisibleKeyboardView(){
  if (isShowingEmojiPalettes()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}
Program: 87523
Project: 87523
Buggy source:
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiKeyboard() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}

Fixed version (ground truth):
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiPalettes() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}
Program: 87524
Project: 87524
Buggy source:
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final MainKeyboardView mainKeyboardView=mKeyboardSwitcher.getMainKeyboardView();
    final boolean inputViewShown=(mainKeyboardView != null) ? mainKeyboardView.isShown() : false;
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}

Fixed version (ground truth):
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final boolean inputViewShown=mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}
Program: 87525
Project: 87525
Buggy source:
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiKeyboard()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}

Fixed version (ground truth):
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiPalettes()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}
Program: 87526
Project: 87526
Buggy source:
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiKeyboard()) {
    mState.onSaveKeyboardState();
  }
}

Fixed version (ground truth):
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiPalettes()) {
    mState.onSaveKeyboardState();
  }
}
Program: 87527
Project: 87527
Buggy source:
public View getVisibleKeyboardView(){
  if (isShowingEmojiKeyboard()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}

Fixed version (ground truth):
public View getVisibleKeyboardView(){
  if (isShowingEmojiPalettes()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}
Program: 87528
Project: 87528
Buggy source:
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiKeyboard() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}

Fixed version (ground truth):
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiPalettes() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}
Program: 87529
Project: 87529
Buggy source:
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final MainKeyboardView mainKeyboardView=mKeyboardSwitcher.getMainKeyboardView();
    final boolean inputViewShown=(mainKeyboardView != null) ? mainKeyboardView.isShown() : false;
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}

Fixed version (ground truth):
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final boolean inputViewShown=mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}
Program: 87530
Project: 87530
Buggy source:
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiKeyboard()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}

Fixed version (ground truth):
public boolean isShowingMoreKeysPanel(){
  if (isShowingEmojiPalettes()) {
    return false;
  }
  return mKeyboardView.isShowingMoreKeysPanel();
}
Program: 87531
Project: 87531
Buggy source:
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiKeyboard()) {
    mState.onSaveKeyboardState();
  }
}

Fixed version (ground truth):
public void saveKeyboardState(){
  if (getKeyboard() != null || isShowingEmojiPalettes()) {
    mState.onSaveKeyboardState();
  }
}
Program: 87532
Project: 87532
Buggy source:
public View getVisibleKeyboardView(){
  if (isShowingEmojiKeyboard()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}

Fixed version (ground truth):
public View getVisibleKeyboardView(){
  if (isShowingEmojiPalettes()) {
    return mEmojiPalettesView;
  }
  return mKeyboardView;
}
Program: 87533
Project: 87533
Buggy source:
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiKeyboard() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}

Fixed version (ground truth):
@Override public void onComputeInsets(final InputMethodService.Insets outInsets){
  super.onComputeInsets(outInsets);
  final View visibleKeyboardView=mKeyboardSwitcher.getVisibleKeyboardView();
  if (visibleKeyboardView == null || mSuggestionStripView == null) {
    return;
  }
  final int adjustedBackingHeight=getAdjustedBackingViewHeight();
  final boolean backingGone=(mKeyPreviewBackingView.getVisibility() == View.GONE);
  final int backingHeight=backingGone ? 0 : adjustedBackingHeight;
  final int extractHeight=isFullscreenMode() ? mExtractArea.getHeight() : 0;
  final int suggestionsHeight=(mSuggestionStripView.getVisibility() == View.GONE) ? 0 : mSuggestionStripView.getHeight();
  final int extraHeight=extractHeight + backingHeight + suggestionsHeight;
  int visibleTopY=extraHeight;
  if (visibleKeyboardView.isShown()) {
    if (mKeyboardSwitcher.isShowingEmojiPalettes() || mSuggestionStripView.getVisibility() == View.VISIBLE) {
      visibleTopY-=suggestionsHeight;
    }
    final int touchY=mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
    final int touchWidth=visibleKeyboardView.getWidth();
    final int touchHeight=visibleKeyboardView.getHeight() + extraHeight + EXTENDED_TOUCHABLE_REGION_HEIGHT;
    outInsets.touchableInsets=InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
    outInsets.touchableRegion.set(0,touchY,touchWidth,touchHeight);
  }
  outInsets.contentTopInsets=visibleTopY;
  outInsets.visibleTopInsets=visibleTopY;
}
Program: 87534
Project: 87534
Buggy source:
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final MainKeyboardView mainKeyboardView=mKeyboardSwitcher.getMainKeyboardView();
    final boolean inputViewShown=(mainKeyboardView != null) ? mainKeyboardView.isShown() : false;
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}

Fixed version (ground truth):
private void setSuggestionStripShownInternal(final boolean shown,final boolean needsInputViewShown){
  if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
    final boolean inputViewShown=mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
    final boolean shouldShowSuggestions=shown && (needsInputViewShown ? inputViewShown : true);
    if (isFullscreenMode()) {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.GONE);
    }
 else {
      mSuggestionStripView.setVisibility(shouldShowSuggestions ? View.VISIBLE : View.INVISIBLE);
    }
  }
}
Program: 87535
Project: 87535
Buggy source:
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}

Fixed version (ground truth):
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
    mSwitchActions.requestUpdatingShiftState();
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}
Program: 87536
Project: 87536
Buggy source:
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}

Fixed version (ground truth):
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  mKeyboardSwitcher.updateShiftState();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}
Program: 87537
Project: 87537
Buggy source:
private void updateBatchInput(final long eventTime){
synchronized (sAggregratedPointers) {
    final GestureStroke stroke=mGestureStrokeWithPreviewPoints;
    stroke.appendIncrementalBatchPoints(sAggregratedPointers);
    final int size=sAggregratedPointers.getPointerSize();
    if (size > sLastRecognitionPointSize && stroke.hasRecognitionTimePast(eventTime,sLastRecognitionTime)) {
      sLastRecognitionPointSize=size;
      sLastRecognitionTime=eventTime;
      if (DEBUG_LISTENER) {
        Log.d(TAG,String.format("String_Node_Str",mPointerId,size));
      }
      mTimerProxy.startUpdateBatchInputTimer(this);
      mListener.onUpdateBatchInput(sAggregratedPointers);
    }
  }
}

Fixed version (ground truth):
private void updateBatchInput(final long eventTime){
synchronized (sAggregratedPointers) {
    final GestureStroke stroke=mGestureStrokeWithPreviewPoints;
    stroke.appendIncrementalBatchPoints(sAggregratedPointers);
    final int size=sAggregratedPointers.getPointerSize();
    if (size > sLastRecognitionPointSize && stroke.hasRecognitionTimePast(eventTime,sLastRecognitionTime)) {
      if (DEBUG_LISTENER) {
        Log.d(TAG,String.format("String_Node_Str",mPointerId,size));
      }
      mTimerProxy.startUpdateBatchInputTimer(this);
      mListener.onUpdateBatchInput(sAggregratedPointers);
      sLastRecognitionPointSize=sAggregratedPointers.getPointerSize();
      sLastRecognitionTime=eventTime;
    }
  }
}
Program: 87538
Project: 87538
Buggy source:
private void updateBatchInput(final long eventTime){
synchronized (sAggregratedPointers) {
    final GestureStroke stroke=mGestureStrokeWithPreviewPoints;
    stroke.appendIncrementalBatchPoints(sAggregratedPointers);
    final int size=sAggregratedPointers.getPointerSize();
    if (size > sLastRecognitionPointSize && stroke.hasRecognitionTimePast(eventTime,sLastRecognitionTime)) {
      sLastRecognitionPointSize=size;
      sLastRecognitionTime=eventTime;
      if (DEBUG_LISTENER) {
        Log.d(TAG,String.format("String_Node_Str",mPointerId,size));
      }
      mTimerProxy.startUpdateBatchInputTimer(this);
      mListener.onUpdateBatchInput(sAggregratedPointers);
    }
  }
}

Fixed version (ground truth):
private void updateBatchInput(final long eventTime){
synchronized (sAggregratedPointers) {
    final GestureStroke stroke=mGestureStrokeWithPreviewPoints;
    stroke.appendIncrementalBatchPoints(sAggregratedPointers);
    final int size=sAggregratedPointers.getPointerSize();
    if (size > sLastRecognitionPointSize && stroke.hasRecognitionTimePast(eventTime,sLastRecognitionTime)) {
      if (DEBUG_LISTENER) {
        Log.d(TAG,String.format("String_Node_Str",mPointerId,size));
      }
      mTimerProxy.startUpdateBatchInputTimer(this);
      mListener.onUpdateBatchInput(sAggregratedPointers);
      sLastRecognitionPointSize=sAggregratedPointers.getPointerSize();
      sLastRecognitionTime=eventTime;
    }
  }
}
Program: 87539
Project: 87539
Buggy source:
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}

Fixed version (ground truth):
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
    mSwitchActions.requestUpdatingShiftState();
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}
Program: 87540
Project: 87540
Buggy source:
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}

Fixed version (ground truth):
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  mKeyboardSwitcher.updateShiftState();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}
Program: 87541
Project: 87541
Buggy source:
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}

Fixed version (ground truth):
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
    mSwitchActions.requestUpdatingShiftState();
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}
Program: 87542
Project: 87542
Buggy source:
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}

Fixed version (ground truth):
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  mKeyboardSwitcher.updateShiftState();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}
Program: 87543
Project: 87543
Buggy source:
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}

Fixed version (ground truth):
private void onRestoreKeyboardState(){
  final SavedKeyboardState state=mSavedKeyboardState;
  if (DEBUG_EVENT) {
    Log.d(TAG,"String_Node_Str" + state + "String_Node_Str"+ this);
  }
  if (!state.mIsValid || state.mIsAlphabetMode) {
    setAlphabetKeyboard();
  }
 else   if (state.mIsEmojiMode) {
    setEmojiKeyboard();
  }
 else {
    if (state.mShiftMode == MANUAL_SHIFT) {
      setSymbolsShiftedKeyboard();
    }
 else {
      setSymbolsKeyboard();
    }
  }
  if (!state.mIsValid)   return;
  state.mIsValid=false;
  if (state.mIsAlphabetMode) {
    setShiftLocked(state.mIsAlphabetShiftLocked);
    if (!state.mIsAlphabetShiftLocked) {
      setShifted(state.mShiftMode);
    }
    mSwitchActions.requestUpdatingShiftState();
  }
 else {
    mPrevMainKeyboardWasShiftLocked=state.mIsAlphabetShiftLocked;
  }
}
Program: 87544
Project: 87544
Buggy source:
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}

Fixed version (ground truth):
/** 
 * Retry resetting caches in the rich input connection. When the editor can't be accessed we can't reset the caches, so we schedule a retry. This method handles the retry, and re-schedules a new retry if we still can't access. We only retry up to 5 times before giving up.
 * @param tryResumeSuggestions Whether we should resume suggestions or not.
 * @param remainingTries How many times we may try again before giving up.
 */
private void retryResetCaches(final boolean tryResumeSuggestions,final int remainingTries){
  if (!mConnection.resetCachesUponCursorMoveAndReturnSuccess(mLastSelectionStart,false)) {
    if (0 < remainingTries) {
      mHandler.postResetCaches(tryResumeSuggestions,remainingTries - 1);
    }
    return;
  }
  tryFixLyingCursorPosition();
  mKeyboardSwitcher.updateShiftState();
  if (tryResumeSuggestions)   mHandler.postResumeSuggestions();
}