Program: 39392
Project: 39392
Buggy source:
private void refreshPie(int delMon){
  Calendar calendar=Calendar.getInstance();
  calendar.add(Calendar.MONTH,delMon);
  calendar.set(Calendar.DAY_OF_MONTH,1);
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  int year=calendar.get(Calendar.YEAR);
  int month=calendar.get(Calendar.MONTH);
  long start=calendar.getTimeInMillis();
  calendar.add(Calendar.MONTH,1);
  calendar.add(Calendar.DATE,-1);
  if (DateTimeUtil.isThisYear(calendar.getTime())) {
    dateTv.setText(format1.format(new Date(start)) + "String_Node_Str" + format2.format(calendar.getTime()));
  }
 else {
    dateTv.setText(format3.format(new Date(start)) + "String_Node_Str" + format2.format(calendar.getTime()));
  }
  mRecordManager.getOutOrInRecordByMonth(new Handler(){
    @Override public void handleMessage(    Message msg){
      super.handleMessage(msg);
      chartRecordDoList.clear();
      chartRecordDoList.addAll((List<ChartRecordDo>)msg.obj);
      recordPieAnalysisAdapter.notifyDataSetChanged();
      mTypePieChart.clear();
      xVals1.clear();
      yVals1.clear();
      List<ChartRecordDo> list=(List<ChartRecordDo>)msg.obj;
      ArrayList<Integer> colors=new ArrayList<Integer>();
      allOutOrInMoney=0;
      int i=0;
      for (      ChartRecordDo chartRecordDo : list) {
        allOutOrInMoney+=Math.abs(TextUtil.gwtFormatNum(chartRecordDo.getRecordMoney()));
        yVals1.add(new Entry(Math.abs(new Double(TextUtil.gwtFormatNum(chartRecordDo.getRecordMoney())).floatValue()),i));
        xVals1.add(chartRecordDo.getRecordDesc());
        colors.add(IconTypeUtil.getTypeIconOrColor(chartRecordDo.getIconId(),false));
        i++;
      }
      PieDataSet dataSet=new PieDataSet(yVals1,"String_Node_Str");
      dataSet.setSliceSpace(1f);
      dataSet.setSelectionShift(2f);
      dataSet.setColors(colors);
      PieData data=new PieData(xVals1,dataSet);
      data.setDrawValues(false);
      mTypePieChart.setData(data);
      if (list.size() == 0) {
        mTypePieChart.setCenterText("String_Node_Str" + (pieOut ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
        mTypePieChart.setCenterTextColor(Color.RED);
      }
 else {
        mTypePieChart.setCenterTextColor(mainColor);
        mTypePieChart.setCenterText((pieOut ? "String_Node_Str" : "String_Node_Str") + TextUtil.getFormatMoney(allOutOrInMoney));
      }
      mTypePieChart.animateXY(500,500);
    }
  }
,pieOut,year,month);
}

Fixed version (ground truth):
private void refreshPie(int delMon){
  Calendar calendar=Calendar.getInstance();
  calendar.add(Calendar.MONTH,delMon);
  calendar.set(Calendar.DAY_OF_MONTH,1);
  calendar.set(Calendar.HOUR_OF_DAY,0);
  calendar.set(Calendar.MINUTE,0);
  calendar.set(Calendar.SECOND,0);
  calendar.set(Calendar.MILLISECOND,0);
  int year=calendar.get(Calendar.YEAR);
  int month=calendar.get(Calendar.MONTH);
  long start=calendar.getTimeInMillis();
  calendar.add(Calendar.MONTH,1);
  calendar.add(Calendar.DATE,-1);
  if (DateTimeUtil.isThisYear(calendar.getTime())) {
    dateTv.setText(format1.format(new Date(start)) + "String_Node_Str" + format2.format(calendar.getTime()));
  }
 else {
    dateTv.setText(format3.format(new Date(start)) + "String_Node_Str" + format2.format(calendar.getTime()));
  }
  mRecordManager.getOutOrInRecordByMonth(new Handler(){
    @Override public void handleMessage(    Message msg){
      super.handleMessage(msg);
      chartRecordDoList.clear();
      chartRecordDoList.addAll((List<ChartRecordDo>)msg.obj);
      recordPieAnalysisAdapter.notifyDataSetChanged();
      mTypePieChart.clear();
      xVals1.clear();
      yVals1.clear();
      List<ChartRecordDo> list=(List<ChartRecordDo>)msg.obj;
      ArrayList<Integer> colors=new ArrayList<Integer>();
      allOutOrInMoney=0;
      int i=0;
      double min=Double.MAX_VALUE;
      for (      ChartRecordDo chartRecordDo : list) {
        if (Math.abs(TextUtil.gwtFormatNum(chartRecordDo.getRecordMoney())) < min)         min=Math.abs(TextUtil.gwtFormatNum(chartRecordDo.getRecordMoney()));
        allOutOrInMoney+=Math.abs(TextUtil.gwtFormatNum(chartRecordDo.getRecordMoney()));
        yVals1.add(new Entry(Math.abs(new Double(TextUtil.gwtFormatNum(chartRecordDo.getRecordMoney())).floatValue()),i));
        xVals1.add(chartRecordDo.getRecordDesc());
        colors.add(IconTypeUtil.getTypeIconOrColor(chartRecordDo.getIconId(),false));
        i++;
      }
      PieDataSet dataSet=new PieDataSet(yVals1,"String_Node_Str");
      if (min / allOutOrInMoney > 0.001) {
        dataSet.setSliceSpace(1f);
      }
      dataSet.setSelectionShift(2f);
      dataSet.setColors(colors);
      PieData data=new PieData(xVals1,dataSet);
      data.setDrawValues(false);
      mTypePieChart.setData(data);
      if (list.size() == 0) {
        mTypePieChart.setCenterText("String_Node_Str" + (pieOut ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
        mTypePieChart.setCenterTextColor(Color.RED);
      }
 else {
        mTypePieChart.setCenterTextColor(mainColor);
        mTypePieChart.setCenterText((pieOut ? "String_Node_Str" : "String_Node_Str") + TextUtil.getFormatMoney(allOutOrInMoney));
      }
      mTypePieChart.animateXY(500,500);
    }
  }
,pieOut,year,month);
}