Program: 187809
Project: 187809
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mDecryptedText=null;
  mSelectionStart=0;
  mSelectionStop=0;
  if (savedInstanceState != null) {
    mOriginalContent=savedInstanceState.getString(BUNDLE_ORIGINAL_CONTENT);
    mState=savedInstanceState.getInt(BUNDLE_STATE);
    mUri=Uri.parse(savedInstanceState.getString(BUNDLE_URI));
    mSelectionStart=savedInstanceState.getInt(BUNDLE_SELECTION_START);
    mSelectionStop=savedInstanceState.getInt(BUNDLE_SELECTION_STOP);
    mFileContent=savedInstanceState.getString(BUNDLE_FILE_CONTENT);
  }
 else {
    final Intent intent=getIntent();
    final String action=intent.getAction();
    if (Intent.ACTION_EDIT.equals(action) || Intent.ACTION_VIEW.equals(action)) {
      mState=STATE_EDIT;
      mUri=intent.getData();
      if (mUri.getScheme().equals("String_Node_Str")) {
        mState=STATE_EDIT_NOTE_FROM_SDCARD;
        mFileContent=readFile(FileUriUtils.getFile(mUri));
      }
    }
 else     if (Intent.ACTION_INSERT.equals(action)) {
      mState=STATE_INSERT;
      mUri=getContentResolver().insert(intent.getData(),null);
      if (mUri == null) {
        Log.e(TAG,"String_Node_Str" + getIntent().getData());
        finish();
        return;
      }
      setResult(RESULT_OK,intent);
    }
 else {
      Log.e(TAG,"String_Node_Str");
      finish();
      return;
    }
  }
  requestWindowFeature(Window.FEATURE_RIGHT_ICON);
  setContentView(R.layout.note_editor);
  mText=(EditText)findViewById(R.id.note);
  if (mState == STATE_EDIT_NOTE_FROM_SDCARD) {
    mText.addTextChangedListener(mTextWatcherSdCard);
  }
  if (mState != STATE_EDIT_NOTE_FROM_SDCARD) {
    mCursor=managedQuery(mUri,PROJECTION,null,null,null);
  }
 else {
    mCursor=null;
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (debug)   Log.i(TAG,"String_Node_Str");
  mDecryptedText=null;
  mSelectionStart=0;
  mSelectionStop=0;
  if (savedInstanceState != null) {
    mOriginalContent=savedInstanceState.getString(BUNDLE_ORIGINAL_CONTENT);
    mState=savedInstanceState.getInt(BUNDLE_STATE);
    mUri=Uri.parse(savedInstanceState.getString(BUNDLE_URI));
    mSelectionStart=savedInstanceState.getInt(BUNDLE_SELECTION_START);
    mSelectionStop=savedInstanceState.getInt(BUNDLE_SELECTION_STOP);
    mFileContent=savedInstanceState.getString(BUNDLE_FILE_CONTENT);
  }
 else {
    final Intent intent=getIntent();
    final String action=intent.getAction();
    if (Intent.ACTION_EDIT.equals(action) || Intent.ACTION_VIEW.equals(action)) {
      mState=STATE_EDIT;
      mUri=intent.getData();
      if (mUri.getScheme().equals("String_Node_Str")) {
        mState=STATE_EDIT_NOTE_FROM_SDCARD;
        mFileContent=readFile(FileUriUtils.getFile(mUri));
      }
    }
 else     if (Intent.ACTION_INSERT.equals(action)) {
      mState=STATE_INSERT;
      mUri=getContentResolver().insert(intent.getData(),null);
      if (mUri == null) {
        Log.e(TAG,"String_Node_Str" + getIntent().getData());
        finish();
        return;
      }
      setResult(RESULT_OK,intent);
    }
 else {
      Log.e(TAG,"String_Node_Str");
      finish();
      return;
    }
  }
  requestWindowFeature(Window.FEATURE_RIGHT_ICON);
  setContentView(R.layout.note_editor);
  mText=(EditText)findViewById(R.id.note);
  if (mState == STATE_EDIT_NOTE_FROM_SDCARD) {
    mText.addTextChangedListener(mTextWatcherSdCard);
  }
  if (mState != STATE_EDIT_NOTE_FROM_SDCARD) {
    mCursor=managedQuery(mUri,PROJECTION,null,null,null);
  }
 else {
    mCursor=null;
  }
}