Program: 18306
Project: 18306
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleValues:
{
      for (      DataSet<?> set : mChart.getData().getDataSets())       set.setDrawValues(!set.isDrawValuesEnabled());
      mChart.invalidate();
      break;
    }
case R.id.actionToggleHighlight:
{
    if (mChart.getData() != null) {
      mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
      mChart.invalidate();
    }
    break;
  }
case R.id.actionTogglePinch:
{
  if (mChart.isPinchZoomEnabled())   mChart.setPinchZoom(false);
 else   mChart.setPinchZoom(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleAutoScaleMinMax:
{
mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled());
mChart.notifyDataSetChanged();
break;
}
case R.id.actionToggleHighlightArrow:
{
if (mChart.isDrawHighlightArrowEnabled()) mChart.setDrawHighlightArrow(false);
 else mChart.setDrawHighlightArrow(true);
mChart.invalidate();
break;
}
case R.id.actionToggleStartzero:
{
mChart.getAxisLeft().setStartAtZero(!mChart.getAxisLeft().isStartAtZeroEnabled());
mChart.getAxisRight().setStartAtZero(!mChart.getAxisRight().isStartAtZeroEnabled());
mChart.invalidate();
break;
}
case R.id.animateX:
{
mChart.animateX(3000);
break;
}
case R.id.animateY:
{
mChart.animateY(3000);
break;
}
case R.id.animateXY:
{
mChart.animateXY(3000,3000);
break;
}
case R.id.actionToggleFilter:
{
Approximator a=new Approximator(ApproximatorType.DOUGLAS_PEUCKER,25);
if (!mChart.isFilteringEnabled()) {
mChart.enableFiltering(a);
}
 else {
mChart.disableFiltering();
}
mChart.invalidate();
break;
}
case R.id.actionSave:
{
if (mChart.saveToGallery("String_Node_Str" + System.currentTimeMillis(),50)) {
Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
}
 else Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
break;
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.actionToggleValues:
{
      for (      IDataSet set : mChart.getData().getDataSets())       set.setDrawValues(!set.isDrawValuesEnabled());
      mChart.invalidate();
      break;
    }
case R.id.actionToggleHighlight:
{
    if (mChart.getData() != null) {
      mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
      mChart.invalidate();
    }
    break;
  }
case R.id.actionTogglePinch:
{
  if (mChart.isPinchZoomEnabled())   mChart.setPinchZoom(false);
 else   mChart.setPinchZoom(true);
  mChart.invalidate();
  break;
}
case R.id.actionToggleAutoScaleMinMax:
{
mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled());
mChart.notifyDataSetChanged();
break;
}
case R.id.actionToggleHighlightArrow:
{
if (mChart.isDrawHighlightArrowEnabled()) mChart.setDrawHighlightArrow(false);
 else mChart.setDrawHighlightArrow(true);
mChart.invalidate();
break;
}
case R.id.actionToggleStartzero:
{
mChart.getAxisLeft().setStartAtZero(!mChart.getAxisLeft().isStartAtZeroEnabled());
mChart.getAxisRight().setStartAtZero(!mChart.getAxisRight().isStartAtZeroEnabled());
mChart.invalidate();
break;
}
case R.id.animateX:
{
mChart.animateX(3000);
break;
}
case R.id.animateY:
{
mChart.animateY(3000);
break;
}
case R.id.animateXY:
{
mChart.animateXY(3000,3000);
break;
}
case R.id.actionToggleFilter:
{
Approximator a=new Approximator(ApproximatorType.DOUGLAS_PEUCKER,25);
if (!mChart.isFilteringEnabled()) {
mChart.enableFiltering(a);
}
 else {
mChart.disableFiltering();
}
mChart.invalidate();
break;
}
case R.id.actionSave:
{
if (mChart.saveToGallery("String_Node_Str" + System.currentTimeMillis(),50)) {
Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
}
 else Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
break;
}
}
return true;
}