Program: 157515
Project: 157515
Buggy source:
@Override public void onStartInputView(EditorInfo attribute,boolean restarting){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + attribute.imeOptions + "String_Node_Str"+ attribute.inputType+ "String_Node_Str"+ restarting+ "String_Node_Str");
  super.onStartInputView(attribute,restarting);
  if (mVoiceRecognitionTrigger != null) {
    mVoiceRecognitionTrigger.onStartInputView();
  }
  if (mInputView == null) {
    return;
  }
  mInputView.setKeyboardActionType(attribute.imeOptions);
  mKeyboardSwitcher.makeKeyboards(false);
  mPredictionOn=false;
  mCompletionOn=false;
  mCompletions=null;
  mCapsLock=false;
switch (attribute.inputType & EditorInfo.TYPE_MASK_CLASS) {
case EditorInfo.TYPE_CLASS_DATETIME:
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
  mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_DATETIME,attribute);
break;
case EditorInfo.TYPE_CLASS_NUMBER:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_NUMBERS,attribute);
break;
case EditorInfo.TYPE_CLASS_PHONE:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_PHONE,attribute);
break;
case EditorInfo.TYPE_CLASS_TEXT:
if (DEBUG) Log.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 0xe0:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mPredictionOn=false;
break;
default :
mPredictionOn=true;
}
if (mConfig.getInsertSpaceAfterCandidatePick()) {
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_URI:
case 0xd0:
mAutoSpace=false;
break;
default :
mAutoSpace=true;
}
}
 else {
mAutoSpace=false;
}
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case 0xd0:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_EMAIL,attribute);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_URI:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_URL,attribute);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_IM,attribute);
break;
default :
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT,attribute);
}
final int textFlag=attribute.inputType & EditorInfo.TYPE_MASK_FLAGS;
switch (textFlag) {
case 0x00080000:
case EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mPredictionOn=false;
break;
default :
}
break;
default :
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT,attribute);
mPredictionOn=false;
mAutoSpace=true;
}
mPredicting=false;
mJustAddedAutoSpace=false;
setCandidatesViewShown(false);
updateShiftKeyState(attribute);
if (mSuggest != null) {
mSuggest.setCorrectionMode(mQuickFixes,mShowSuggestions);
}
mPredictionOn=mPredictionOn && (mShowSuggestions);
if (mCandidateView != null) mCandidateView.setSuggestions(null,false,false,false);
if (mPredictionOn) {
if ((SystemClock.elapsedRealtime() - mLastDictionaryRefresh) > MINIMUM_REFRESH_TIME_FOR_DICTIONARIES) setDictionariesForCurrentKeyboard();
}
 else {
setDictionariesForCurrentKeyboard();
}
if (TRACE_SDCARD) Debug.startMethodTracing("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onStartInputView(final EditorInfo attribute,final boolean restarting){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + attribute.imeOptions + "String_Node_Str"+ attribute.inputType+ "String_Node_Str"+ restarting+ "String_Node_Str");
  super.onStartInputView(attribute,restarting);
  if (mVoiceRecognitionTrigger != null) {
    mVoiceRecognitionTrigger.onStartInputView();
  }
  if (mInputView == null) {
    return;
  }
  mInputView.setKeyboardActionType(attribute.imeOptions);
  mKeyboardSwitcher.makeKeyboards(false);
  mPredictionOn=false;
  mCompletionOn=false;
  mCompletions=null;
  mCapsLock=false;
switch (attribute.inputType & EditorInfo.TYPE_MASK_CLASS) {
case EditorInfo.TYPE_CLASS_DATETIME:
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
  mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_DATETIME,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_NUMBER:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_NUMBERS,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_PHONE:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_PHONE,attribute,restarting);
break;
case EditorInfo.TYPE_CLASS_TEXT:
if (DEBUG) Log.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 0xe0:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mPredictionOn=false;
break;
default :
mPredictionOn=true;
}
if (mConfig.getInsertSpaceAfterCandidatePick()) {
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case EditorInfo.TYPE_TEXT_VARIATION_URI:
case 0xd0:
mAutoSpace=false;
break;
default :
mAutoSpace=true;
}
}
 else {
mAutoSpace=false;
}
switch (variation) {
case EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS:
case 0xd0:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_EMAIL,attribute,restarting);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_URI:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_URL,attribute,restarting);
mPredictionOn=false;
break;
case EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_IM,attribute,restarting);
break;
default :
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT,attribute,restarting);
}
final int textFlag=attribute.inputType & EditorInfo.TYPE_MASK_FLAGS;
switch (textFlag) {
case 0x00080000:
case EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE:
if (DEBUG) Log.d(TAG,"String_Node_Str");
mPredictionOn=false;
break;
default :
}
break;
default :
if (DEBUG) Log.d(TAG,"String_Node_Str");
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT,attribute,restarting);
mPredictionOn=false;
mAutoSpace=true;
}
mPredicting=false;
mJustAddedAutoSpace=false;
setCandidatesViewShown(false);
updateShiftKeyState(attribute);
if (mSuggest != null) {
mSuggest.setCorrectionMode(mQuickFixes,mShowSuggestions);
}
mPredictionOn=mPredictionOn && (mShowSuggestions);
if (mCandidateView != null) mCandidateView.setSuggestions(null,false,false,false);
if (mPredictionOn) {
if ((SystemClock.elapsedRealtime() - mLastDictionaryRefresh) > MINIMUM_REFRESH_TIME_FOR_DICTIONARIES) setDictionariesForCurrentKeyboard();
}
 else {
setDictionariesForCurrentKeyboard();
}
if (TRACE_SDCARD) Debug.startMethodTracing("String_Node_Str");
}