Program: 157216
Project: 157216
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;
  mInputFieldSupportsAutoPick=false;
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;
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_URI:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
Logger.d(TAG,"String_Node_Str");
mPredictionOn=true;
mInputFieldSupportsAutoPick=false;
break;
default :
mInputFieldSupportsAutoPick=true;
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);
break;
case EditorInfo.TYPE_TEXT_VARIATION_URI:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_URL,attribute,restarting);
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);
}
mJustAddedAutoSpace=false;
setCandidatesViewShown(false);
mPredictionOn=mPredictionOn && mShowSuggestions;
TextEntryState.newSession(mPredictionOn);
clearSuggestions();
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=EMPTY_COMPLETIONS;
  mInputFieldSupportsAutoPick=false;
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;
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_URI:
case EditorInfo.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS:
Logger.d(TAG,"String_Node_Str");
mPredictionOn=true;
mInputFieldSupportsAutoPick=false;
break;
default :
mInputFieldSupportsAutoPick=true;
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);
break;
case EditorInfo.TYPE_TEXT_VARIATION_URI:
Logger.d(TAG,"String_Node_Str");
getKeyboardSwitcher().setKeyboardMode(KeyboardSwitcher.INPUT_MODE_URL,attribute,restarting);
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);
}
mJustAddedAutoSpace=false;
setCandidatesViewShown(false);
mPredictionOn=mPredictionOn && mShowSuggestions;
TextEntryState.newSession(mPredictionOn);
clearSuggestions();
updateShiftStateNow();
}