Program: 62112
Project: 62112
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_history,container,false);
  ListView listHistory=(ListView)view.findViewById(R.id.list_view_history);
  listHistory.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int i,    long l){
      Intent intent=new Intent(getActivity(),AppDetail.class);
      NotificationAppView clickedApp=(NotificationAppView)adapterView.getAdapter().getItem(i);
      intent.putExtra(Intent.EXTRA_SUBJECT,clickedApp.AppName);
      startActivity(intent);
    }
  }
);
  BarChart chart=new BarChart(getActivity());
  chart.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,((int)getResources().getDimension(R.dimen.bar_chart_height))));
  chart.setDrawBarShadow(false);
  chart.setDrawLegend(false);
  chart.setDescription("String_Node_Str");
  chart.setDrawGridBackground(false);
  chart.setDrawHorizontalGrid(false);
  chart.setDrawVerticalGrid(false);
  chart.setPaint(paintWhite,Chart.PAINT_XLABEL);
  chart.setDrawXLabels(true);
  chart.setDrawYLabels(false);
  chart.setValueFormatter(new ValueFormatter(){
    @Override public String getFormattedValue(    float value){
      return Integer.toString((int)value);
    }
  }
);
  chart.setOnChartValueSelectedListener(new OnChartValueSelectedListener(){
    @Override public void onValueSelected(    Entry e,    int dataSetIndex){
      showDayListView((Date)e.getData());
    }
    @Override public void onNothingSelected(){
    }
  }
);
  chart.setValueTextColor(Color.WHITE);
  try {
    List<NotificationDateView> rawData=this.getChartData(14);
    ArrayList<String> xVals=new ArrayList<String>(rawData.size());
    ArrayList<BarEntry> yVals=new ArrayList<BarEntry>(rawData.size());
    for (int i=0; i < rawData.size(); i++) {
      Date currentDate=rawData.get(i).Date;
      xVals.add(i,dateFormat.format(currentDate));
      yVals.add(i,new BarEntry(rawData.get(i).Notifications.floatValue(),i,currentDate));
    }
    BarDataSet dataSet=new BarDataSet(yVals,"String_Node_Str");
    BarData data=new BarData(xVals,dataSet);
    chart.setData(data);
    listHistory.addHeaderView(chart,null,false);
    listHistory.setBackgroundColor(getResources().getColor(android.R.color.holo_green_dark));
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.fragment_history,container,false);
  ListView listHistory=(ListView)view.findViewById(R.id.list_view_history);
  listHistory.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int i,    long l){
      Intent intent=new Intent(getActivity(),AppDetail.class);
      NotificationAppView clickedApp=(NotificationAppView)adapterView.getAdapter().getItem(i);
      intent.putExtra(Intent.EXTRA_SUBJECT,clickedApp.AppName);
      startActivity(intent);
    }
  }
);
  BarChart chart=new BarChart(getActivity());
  chart.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,((int)getResources().getDimension(R.dimen.bar_chart_height))));
  chart.setDrawBarShadow(false);
  chart.setDrawLegend(false);
  chart.setDescription("String_Node_Str");
  chart.setDrawGridBackground(false);
  chart.setDrawHorizontalGrid(false);
  chart.setDrawVerticalGrid(false);
  chart.setPaint(paintWhite,Chart.PAINT_XLABEL);
  chart.setDrawXLabels(true);
  chart.setDrawYLabels(false);
  chart.setValueFormatter(new ValueFormatter(){
    @Override public String getFormattedValue(    float value){
      return Integer.toString((int)value);
    }
  }
);
  chart.setOnChartValueSelectedListener(new OnChartValueSelectedListener(){
    @Override public void onValueSelected(    Entry e,    int dataSetIndex){
      showDayListView((Date)e.getData());
    }
    @Override public void onNothingSelected(){
    }
  }
);
  chart.setValueTextColor(Color.WHITE);
  try {
    List<NotificationDateView> rawData=this.getChartData(14);
    ArrayList<String> xVals=new ArrayList<String>(rawData.size());
    ArrayList<BarEntry> yVals=new ArrayList<BarEntry>(rawData.size());
    for (int i=0; i < rawData.size(); i++) {
      Date currentDate=rawData.get(i).Date;
      xVals.add(i,dateFormat.format(currentDate));
      yVals.add(i,new BarEntry(rawData.get(i).Notifications.floatValue(),i,currentDate));
    }
    BarDataSet dataSet=new BarDataSet(yVals,"String_Node_Str");
    BarData data=new BarData(xVals,dataSet);
    chart.setData(data);
    listHistory.addHeaderView(chart,null,false);
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  return view;
}