Program: 157292
Project: 157292
Buggy source:
@Override public void onStartInputView(final EditorInfo attribute,final boolean restarting){
  Logger.v(TAG,"String_Node_Str",attribute.imeOptions,attribute.inputType,restarting);
  super.onStartInputView(attribute,restarting);
  if (mVoiceRecognitionTrigger != null) {
    mVoiceRecognitionTrigger.onStartInputView();
  }
  if (getInputView() == null) {
    return;
  }
  getInputView().dismissPopupKeyboard();
  getInputView().setKeyboardActionType(attribute.imeOptions);
  mPredictionOn=false;
  mCompletionOn=false;
  mCompletions=null;
switch (attribute.inputType & EditorInfo.TYPE_MASK_CLASS) {
case EditorInfo.TYPE_CLASS_DATETIME:
    Logger.d(TAG,"String_Node_Str");
  getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_DATETIME,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_NUMBER:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_NUMBERS,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_PHONE:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_PHONE,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_TEXT:
Logger.d(TAG,"String_Node_Str");
final int variation=attribute.inputType & EditorInfo.TYPE_MASK_VARIATION;
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_PASSWORD:
case EditorInfo.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_PASSWORD:
Logger.d(TAG,"String_Node_Str");
mPredictionOn=false;
break;
default :
mPredictionOn=true;
}
if (mAskPrefs.getInsertSpaceAfterCandidatePick()) {
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_URI:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
mAutoSpace=false;
break;
default :
mAutoSpace=true;
}
}
 else {
mAutoSpace=false;
}
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_EMAIL,attribute,restarting);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_URI:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_URL,attribute,restarting);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_IM,attribute,restarting);
break;
default :
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_TEXT,attribute,restarting);
}
final int textFlag=attribute.inputType & EditorInfo.TYPE_MASK_FLAGS;
if ((textFlag & EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS) == EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS || (textFlag & EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) == EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) {
Logger.d(TAG,"String_Node_Str");
mPredictionOn=false;
}
break;
default :
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_TEXT,attribute,restarting);
mPredictionOn=false;
mAutoSpace=true;
}
mPredicting=false;
mJustAddedAutoSpace=false;
setCandidatesViewShown(false);
mPredictionOn=mPredictionOn && (mShowSuggestions);
clearSuggestions();
if (mPredictionOn) {
if (mLastDictionaryRefresh < 0 || (SystemClock.elapsedRealtime() - mLastDictionaryRefresh) > MINIMUM_REFRESH_TIME_FOR_DICTIONARIES) {
setDictionariesForCurrentKeyboard();
}
}
updateShiftStateNow();
}

Fixed version (ground truth):
@Override public void onStartInputView(final EditorInfo attribute,final boolean restarting){
  Logger.v(TAG,"String_Node_Str",attribute.imeOptions,attribute.inputType,restarting);
  super.onStartInputView(attribute,restarting);
  if (mVoiceRecognitionTrigger != null) {
    mVoiceRecognitionTrigger.onStartInputView();
  }
  if (getInputView() == null) {
    return;
  }
  getInputView().dismissPopupKeyboard();
  getInputView().setKeyboardActionType(attribute.imeOptions);
  mPredictionOn=false;
  mCompletionOn=false;
  mCompletions=null;
switch (attribute.inputType & EditorInfo.TYPE_MASK_CLASS) {
case EditorInfo.TYPE_CLASS_DATETIME:
    Logger.d(TAG,"String_Node_Str");
  getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_DATETIME,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_NUMBER:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_NUMBERS,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_PHONE:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_PHONE,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_TEXT:
Logger.d(TAG,"String_Node_Str");
final int variation=attribute.inputType & EditorInfo.TYPE_MASK_VARIATION;
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_PASSWORD:
case EditorInfo.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_PASSWORD:
Logger.d(TAG,"String_Node_Str");
mPredictionOn=false;
break;
default :
mPredictionOn=true;
}
if (mAskPrefs.getInsertSpaceAfterCandidatePick()) {
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_URI:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
mAutoSpace=false;
break;
default :
mAutoSpace=true;
}
}
 else {
mAutoSpace=false;
}
final int textFlag=attribute.inputType & EditorInfo.TYPE_MASK_FLAGS;
if ((textFlag & EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS) == EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS || (textFlag & EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) == EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) {
Logger.d(TAG,"String_Node_Str");
mPredictionOn=false;
}
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_EMAIL,attribute,restarting);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_URI:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_URL,attribute,restarting);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_IM,attribute,restarting);
break;
default :
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_TEXT,attribute,restarting);
}
break;
default :
Logger.d(TAG,"String_Node_Str");
mPredictionOn=false;
mAutoSpace=true;
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_TEXT,attribute,restarting);
}
mPredicting=false;
mJustAddedAutoSpace=false;
setCandidatesViewShown(false);
mPredictionOn=mPredictionOn && (mShowSuggestions);
clearSuggestions();
updateShiftStateNow();
}