Program: 44693
Project: 44693
Buggy source:
/** 
 * Invoked when a view is clicked
 */
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.switchView:
    if (streetView == 0) {
      map.setStreetView(true);
      streetView=1;
      map.setSatellite(false);
    }
 else {
      map.setStreetView(false);
      streetView=0;
      map.setSatellite(true);
    }
  map.invalidate();
break;
case R.id.showHappy:
if (checkHappy == 0) {
map.getOverlays().add(happyOverlay);
checkHappy=1;
}
 else {
map.getOverlays().clear();
if (checkSad == 1) {
  map.getOverlays().add(sadOverlay);
}
checkHappy=0;
}
invalidateOverlay();
break;
case R.id.showSad:
if (checkSad == 0) {
map.getOverlays().add(sadOverlay);
checkSad=1;
}
 else {
map.getOverlays().clear();
if (checkHappy == 1) {
map.getOverlays().add(happyOverlay);
}
checkSad=0;
}
invalidateOverlay();
break;
case R.id.map:
Intent j=new Intent(this,MyMap.class);
j.putExtra("String_Node_Str",streetView);
j.putExtra("String_Node_Str",false);
j.putExtra("String_Node_Str",checkHappy);
j.putExtra("String_Node_Str",checkSad);
startActivity(j);
finish();
break;
case R.id.myTrack_button:
startActivity(new Intent(this,History.class));
break;
case R.id.myChart_button:
startActivity(new Intent(this,ChartList.class));
break;
case R.id.date_button:
showDialog(DATE_DIALOG_ID);
break;
case R.id.time_button:
showDialog(TIME_DIALOG_ID);
break;
case R.id.arrowLeft:
if (newBottles == null || newBottles.size() == 0) {
handler.removeCallbacks(running);
Runnable runnable=new Runnable(){
@Override public void run(){
Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
;
running=runnable;
handler.postDelayed(runnable,1000);
}
if (newBottles != null && newBottles.size() > 0) {
mapClear();
epochTime=newBottles.get(newBottles.size() - 1).getTime();
timeForView.set(epochTime);
setTimeObjectValues();
}
break;
case R.id.arrowRight:
ArrayList<HappyBottle> temp=updateViewAfter();
if (temp != null && temp.size() > 1) {
epochTime=temp.get(temp.size() - 1).getTime();
timeForView.set(epochTime);
mapClear();
setTimeObjectValues();
dateTimeUpdate();
}
 else {
handler.removeCallbacks(running);
Runnable runnable=new Runnable(){
@Override public void run(){
Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
;
running=runnable;
handler.postDelayed(runnable,1000);
}
break;
}
}

Fixed version (ground truth):
/** 
 * Invoked when a view is clicked
 */
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.switchView:
    if (streetView == 0) {
      map.setStreetView(true);
      streetView=1;
      map.setSatellite(false);
    }
 else {
      map.setStreetView(false);
      streetView=0;
      map.setSatellite(true);
    }
  map.invalidate();
break;
case R.id.showHappy:
if (checkHappy == 0) {
map.getOverlays().add(happyOverlay);
checkHappy=1;
}
 else {
map.getOverlays().clear();
if (checkSad == 1) {
  map.getOverlays().add(sadOverlay);
}
checkHappy=0;
}
invalidateOverlay();
break;
case R.id.showSad:
if (checkSad == 0) {
map.getOverlays().add(sadOverlay);
checkSad=1;
}
 else {
map.getOverlays().clear();
if (checkHappy == 1) {
map.getOverlays().add(happyOverlay);
}
checkSad=0;
}
invalidateOverlay();
break;
case R.id.map:
Intent j=new Intent(this,MyMap.class);
j.putExtra("String_Node_Str",streetView);
j.putExtra("String_Node_Str",false);
j.putExtra("String_Node_Str",checkHappy);
j.putExtra("String_Node_Str",checkSad);
startActivity(j);
finish();
break;
case R.id.myTrack_button:
startActivity(new Intent(this,History.class));
break;
case R.id.myChart_button:
startActivity(new Intent(this,ChartList.class));
break;
case R.id.date_button:
showDialog(DATE_DIALOG_ID);
break;
case R.id.time_button:
showDialog(TIME_DIALOG_ID);
break;
case R.id.arrowLeft:
if (newBottles == null || newBottles.size() == 0) {
handler.removeCallbacks(running);
Runnable runnable=new Runnable(){
@Override public void run(){
Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
;
running=runnable;
handler.postDelayed(runnable,1000);
}
if (newBottles != null && newBottles.size() > 0) {
mapClear();
epochTime=newBottles.get(newBottles.size() - 1).getTime();
timeForView.set(epochTime);
setTimeObjectValues();
}
break;
case R.id.arrowRight:
ArrayList<HappyBottle> temp=updateViewAfter();
if (temp != null && temp.size() > 1) {
epochTime=temp.get(temp.size() - 1).getTime();
timeForView.set(epochTime);
mapClear();
setTimeObjectValues();
dateTimeUpdate();
}
 else {
handler.removeCallbacks(running);
Runnable runnable=new Runnable(){
@Override public void run(){
Toast.makeText(getApplicationContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
}
}
;
running=runnable;
handler.postDelayed(runnable,1000);
}
break;
}
map.invalidate();
}