Program: 35065
Project: 35065
Buggy source:
/** 
 * Helper function to reduce repeated code. Sets up the query and answer textViews
 * @param textView the TextView to setup
 * @param text the previous query or answer String
 */
private void setUpResultTextView(TextView textView,String text){
  textView.setText(text);
  textView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      int position=getListView().getPositionForView((View)view.getParent());
      Calculator calc=Calculator.getCalculator(getActivity());
      Result thisResult=mResultArray.get(position);
      String textPassBack="String_Node_Str";
      int viewID=view.getId();
      if (viewID == R.id.list_item_result_textPrevQuery)       textPassBack=thisResult.getQuerry();
      if (viewID == R.id.list_item_result_textPrevAnswer)       textPassBack=thisResult.getAnswer();
      if (!calc.isUnitIsSet() && thisResult.containsUnits()) {
        Unit unitPassBack;
        if (viewID == R.id.list_item_result_textPrevQuery)         unitPassBack=thisResult.getQuerryUnit();
 else         unitPassBack=thisResult.getAnswerUnit();
        mCallback.selectUnit(unitPassBack,thisResult.getUnitTypePos());
      }
      calc.parseKeyPressed(textPassBack);
      mCallback.updateScreen(false);
    }
  }
);
  textView.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View view){
      int position=getListView().getPositionForView((View)view.getParent());
      mResultArray.remove(position);
      mCallback.updateScreen(true);
      return false;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Helper function to reduce repeated code. Sets up the query and answer textViews
 * @param textView the TextView to setup
 * @param text the previous query or answer String
 */
private void setUpResultTextView(TextView textView,String text){
  textView.setText(text);
  textView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      int position=getListView().getPositionForView((View)view.getParent());
      Calculator calc=Calculator.getCalculator(getActivity());
      Result thisResult=mResultArray.get(position);
      String textPassBack="String_Node_Str";
      int viewID=view.getId();
      if (viewID == R.id.list_item_result_textPrevQuery)       textPassBack=thisResult.getQuerry();
      if (viewID == R.id.list_item_result_textPrevAnswer)       textPassBack=thisResult.getAnswer();
      if (!calc.isUnitSelected() && thisResult.containsUnits()) {
        Unit unitPassBack;
        if (viewID == R.id.list_item_result_textPrevQuery)         unitPassBack=thisResult.getQuerryUnit();
 else         unitPassBack=thisResult.getAnswerUnit();
        mCallback.selectUnit(unitPassBack,thisResult.getUnitTypePos());
      }
      calc.parseKeyPressed(textPassBack);
      mCallback.updateScreen(false);
    }
  }
);
  textView.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View view){
      int position=getListView().getPositionForView((View)view.getParent());
      mResultArray.remove(position);
      mCallback.updateScreen(true);
      return false;
    }
  }
);
}