Program: 18617
Project: 18617
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.isHighlightEnabled())     mChart.setHighlightEnabled(false);
 else     mChart.setHighlightEnabled(true);
    mChart.invalidate();
    break;
  }
case R.id.actionTogglePinch:
{
  if (mChart.isPinchZoomEnabled())   mChart.setPinchZoom(false);
 else   mChart.setPinchZoom(true);
  mChart.invalidate();
  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.actionToggleAdjustXLegend:
{
XAxis xLabels=mChart.getXAxis();
if (xLabels.isAdjustXLabelsEnabled()) xLabels.setAdjustXLabels(false);
 else xLabels.setAdjustXLabels(true);
mChart.invalidate();
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 (      DataSet<?> set : mChart.getData().getDataSets())       set.setDrawValues(!set.isDrawValuesEnabled());
      mChart.invalidate();
      break;
    }
case R.id.actionToggleHighlight:
{
    if (mChart.isHighlightEnabled())     mChart.setHighlightEnabled(false);
 else     mChart.setHighlightEnabled(true);
    mChart.invalidate();
    break;
  }
case R.id.actionTogglePinch:
{
  if (mChart.isPinchZoomEnabled())   mChart.setPinchZoom(false);
 else   mChart.setPinchZoom(true);
  mChart.invalidate();
  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.notifyDataSetChanged();
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.actionToggleAdjustXLegend:
{
XAxis xLabels=mChart.getXAxis();
if (xLabels.isAdjustXLabelsEnabled()) xLabels.setAdjustXLabels(false);
 else xLabels.setAdjustXLabels(true);
mChart.invalidate();
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;
}