Program: 187763
Project: 187763
Buggy source:
public EditItemDialog(Context context,Uri itemUri,Uri relationUri){
  super(context);
  mContext=context;
  LayoutInflater inflater=LayoutInflater.from(context);
  final View view=inflater.inflate(R.layout.dialog_edit_item,null);
  setView(view);
  mEditText=(EditText)view.findViewById(R.id.edittext);
  mTags=(MultiAutoCompleteTextView)view.findViewById(R.id.edittags);
  mPrice=(EditText)view.findViewById(R.id.editprice);
  mQuantity=(EditText)view.findViewById(R.id.editquantity);
  mPriority=(EditText)view.findViewById(R.id.editpriority);
  mNote=(ImageView)view.findViewById(R.id.note);
  mNote.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Uri uri=ContentUris.withAppendedId(Shopping.Notes.CONTENT_URI,mItemId);
      if (mNoteText == null) {
        ContentValues values=new ContentValues();
        values.put("String_Node_Str","String_Node_Str");
        mContext.getContentResolver().update(mItemUri,values,null,null);
        mContext.getContentResolver().notifyChange(mItemUri,null);
      }
      Intent i=new Intent(Intent.ACTION_VIEW);
      i.setData(uri);
      try {
        mContext.startActivity(i);
      }
 catch (      ActivityNotFoundException e) {
        GetFromMarketDialog g=new GetFromMarketDialog(mContext,R.string.notepad_not_available,R.string.notepad_get,R.string.notepad_app_url,R.string.notepad_app_developer);
        g.show();
      }
    }
  }
);
  mPriceLabel=(TextView)view.findViewById(R.id.labeleditprice);
  final KeyListener kl=PreferenceActivity.getCapitalizationKeyListenerFromPrefs(context);
  mEditText.setKeyListener(kl);
  mTags.setKeyListener(kl);
  mTags.setImeOptions(EditorInfo.IME_ACTION_DONE);
  mTags.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
  mTags.setThreshold(0);
  mTags.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      toggleTaglistPopup();
    }
  }
);
  setTitle(R.string.ask_edit_item);
  setItemUri(itemUri);
  setRelationUri(relationUri);
  setButton(context.getText(R.string.ok),this);
  setButton2(context.getText(R.string.cancel),this);
  mQuantity.addTextChangedListener(mTextWatcher);
  mPrice.addTextChangedListener(mTextWatcher);
}

Fixed version (ground truth):
public EditItemDialog(Context context,Uri itemUri,Uri relationUri){
  super(context);
  mContext=context;
  LayoutInflater inflater=LayoutInflater.from(context);
  final View view=inflater.inflate(R.layout.dialog_edit_item,null);
  setView(view);
  mEditText=(EditText)view.findViewById(R.id.edittext);
  mTags=(MultiAutoCompleteTextView)view.findViewById(R.id.edittags);
  mPrice=(EditText)view.findViewById(R.id.editprice);
  mQuantity=(EditText)view.findViewById(R.id.editquantity);
  mPriority=(EditText)view.findViewById(R.id.editpriority);
  mNote=(ImageView)view.findViewById(R.id.note);
  mNote.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Uri uri=ContentUris.withAppendedId(Shopping.Notes.CONTENT_URI,mItemId);
      if (mNoteText == null) {
        String[] shortProjection={Shopping.Items.NOTE};
        Cursor c=mContext.getContentResolver().query(mItemUri,shortProjection,null,null,null);
        if (c != null && c.moveToFirst()) {
          mNoteText=c.getString(0);
        }
      }
      if (mNoteText == null) {
        ContentValues values=new ContentValues();
        values.put("String_Node_Str","String_Node_Str");
        mContext.getContentResolver().update(mItemUri,values,null,null);
        mContext.getContentResolver().notifyChange(mItemUri,null);
      }
      Intent i=new Intent(Intent.ACTION_VIEW);
      i.setData(uri);
      try {
        mContext.startActivity(i);
      }
 catch (      ActivityNotFoundException e) {
        GetFromMarketDialog g=new GetFromMarketDialog(mContext,R.string.notepad_not_available,R.string.notepad_get,R.string.notepad_app_url,R.string.notepad_app_developer);
        g.show();
      }
    }
  }
);
  mPriceLabel=(TextView)view.findViewById(R.id.labeleditprice);
  final KeyListener kl=PreferenceActivity.getCapitalizationKeyListenerFromPrefs(context);
  mEditText.setKeyListener(kl);
  mTags.setKeyListener(kl);
  mTags.setImeOptions(EditorInfo.IME_ACTION_DONE);
  mTags.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
  mTags.setThreshold(0);
  mTags.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      toggleTaglistPopup();
    }
  }
);
  setTitle(R.string.ask_edit_item);
  setItemUri(itemUri);
  setRelationUri(relationUri);
  setButton(context.getText(R.string.ok),this);
  setButton2(context.getText(R.string.cancel),this);
  mQuantity.addTextChangedListener(mTextWatcher);
  mPrice.addTextChangedListener(mTextWatcher);
}