Program: 10628
Project: 10628
Buggy source:
@Override public void onDraw(Canvas canvas,int cX,int cY,int w,int h,Calendar calendar){
  final Location loc=mLocation != null ? mLocation : getRecentLocation();
  final int insetW=(int)(w / 2.0f / 2.0f);
  final int insetH=(int)(h / 2.0f / 2.0f);
  inset.set(cX - insetW,cY - insetH,cX + insetW,cY + insetH);
  if (loc == null) {
    drawPlaceholder(canvas);
    return;
  }
  ll.setLatitude(loc.getLatitude());
  ll.setLongitude(loc.getLongitude());
  final TimeZone tz=calendar.getTimeZone();
  final boolean dst=calendar.get(Calendar.DST_OFFSET) != 0;
  try {
    final Time morningSunrise=Sun.sunriseTime(calendar,ll,tz,dst);
    final Time morningCivil=Sun.morningCivilTwilightTime(calendar,ll,tz,dst);
    final Time morningNautical=Sun.morningNauticalTwilightTime(calendar,ll,tz,dst);
    final Time morningAstro=Sun.morningAstronomicalTwilightTime(calendar,ll,tz,dst);
    final float morningSunAngle=getHourArcAngle(morningSunrise.getHours(),morningSunrise.getMinutes());
    final float morningCivAngle=getHourArcAngle(morningCivil.getHours(),morningCivil.getMinutes());
    final float morningNauAngle=getHourArcAngle(morningNautical.getHours(),morningNautical.getMinutes());
    final float morningAstAngle=getHourArcAngle(morningAstro.getHours(),morningAstro.getMinutes());
    final Time eveningSunset=Sun.sunsetTime(calendar,ll,tz,dst);
    final Time eveningCivil=Sun.eveningCivilTwilightTime(calendar,ll,tz,dst);
    final Time eveningNautical=Sun.eveningNauticalTwilightTime(calendar,ll,tz,dst);
    final Time eveningAstro=Sun.eveningAstronomicalTwilightTime(calendar,ll,tz,dst);
    final float eveningSunAngle=getHourArcAngle(eveningSunset.getHours(),eveningSunset.getMinutes());
    final float eveningCivAngle=getHourArcAngle(eveningCivil.getHours(),eveningCivil.getMinutes());
    final float eveningNauAngle=getHourArcAngle(eveningNautical.getHours(),eveningNautical.getMinutes());
    final float eveningAstAngle=getHourArcAngle(eveningAstro.getHours(),eveningAstro.getMinutes());
    final float highNoon=0.5f * (eveningSunAngle + morningSunAngle) + 180f;
    canvas.drawArc(inset,eveningSunAngle,(360 + (morningSunAngle - eveningSunAngle)) % 360,true,OVERLAY_NIGHT);
    canvas.drawArc(inset,eveningCivAngle,(360 + (morningCivAngle - eveningCivAngle)) % 360,true,OVERLAY_CIVIL);
    canvas.drawArc(inset,eveningNauAngle,(360 + (morningNauAngle - eveningNauAngle)) % 360,true,OVERLAY_NAUTICAL);
    canvas.drawArc(inset,eveningAstAngle,(360 + (morningAstAngle - eveningAstAngle)) % 360,true,OVERLAY_ASTRO);
    canvas.drawArc(inset,highNoon - 3,6,true,OVERLAY_SUN);
  }
 catch (  final IllegalArgumentException e) {
    Log.e(TAG,"String_Node_Str",e);
    drawPlaceholder(canvas);
  }
}

Fixed version (ground truth):
@Override public void onDraw(Canvas canvas,int cX,int cY,int w,int h,Calendar calendar){
  final Location loc=mLocation != null ? mLocation : getRecentLocation();
  final int insetW=(int)(w / 2.0f / 2.0f);
  final int insetH=(int)(h / 2.0f / 2.0f);
  inset.set(cX - insetW,cY - insetH,cX + insetW,cY + insetH);
  if (loc == null) {
    drawPlaceholder(canvas);
    return;
  }
  ll.setLatitude(loc.getLatitude());
  ll.setLongitude(loc.getLongitude());
  final TimeZone tz=calendar.getTimeZone();
  final boolean dst=calendar.get(Calendar.DST_OFFSET) != 0;
  try {
    final Time morningSunrise=Sun.sunriseTime(calendar,ll,tz,dst);
    final Time morningCivil=Sun.morningCivilTwilightTime(calendar,ll,tz,dst);
    final Time morningNautical=Sun.morningNauticalTwilightTime(calendar,ll,tz,dst);
    final Time morningAstro=Sun.morningAstronomicalTwilightTime(calendar,ll,tz,dst);
    final float morningSunAngle=getHourArcAngle(morningSunrise.getHours(),morningSunrise.getMinutes());
    final float morningCivAngle=getHourArcAngle(morningCivil.getHours(),morningCivil.getMinutes());
    final float morningNauAngle=getHourArcAngle(morningNautical.getHours(),morningNautical.getMinutes());
    final float morningAstAngle=getHourArcAngle(morningAstro.getHours(),morningAstro.getMinutes());
    final Time eveningSunset=Sun.sunsetTime(calendar,ll,tz,dst);
    final Time eveningCivil=Sun.eveningCivilTwilightTime(calendar,ll,tz,dst);
    final Time eveningNautical=Sun.eveningNauticalTwilightTime(calendar,ll,tz,dst);
    final Time eveningAstro=Sun.eveningAstronomicalTwilightTime(calendar,ll,tz,dst);
    final float eveningSunAngle=getHourArcAngle(eveningSunset.getHours(),eveningSunset.getMinutes());
    final float eveningCivAngle=getHourArcAngle(eveningCivil.getHours(),eveningCivil.getMinutes());
    final float eveningNauAngle=getHourArcAngle(eveningNautical.getHours(),eveningNautical.getMinutes());
    final float eveningAstAngle=getHourArcAngle(eveningAstro.getHours(),eveningAstro.getMinutes());
    final float highNoon=(360 + morningSunAngle + ((360 + (eveningSunAngle - morningSunAngle)) % 360) * 0.5f) % 360;
    canvas.drawArc(inset,eveningSunAngle,(360 + (morningSunAngle - eveningSunAngle)) % 360,true,OVERLAY_NIGHT);
    canvas.drawArc(inset,eveningCivAngle,(360 + (morningCivAngle - eveningCivAngle)) % 360,true,OVERLAY_CIVIL);
    canvas.drawArc(inset,eveningNauAngle,(360 + (morningNauAngle - eveningNauAngle)) % 360,true,OVERLAY_NAUTICAL);
    canvas.drawArc(inset,eveningAstAngle,(360 + (morningAstAngle - eveningAstAngle)) % 360,true,OVERLAY_ASTRO);
    if (Math.abs(eveningSunAngle - morningSunAngle) > 0) {
      canvas.drawArc(inset,highNoon - 1,2,true,OVERLAY_SUN);
    }
  }
 catch (  final IllegalArgumentException e) {
    Log.e(TAG,"String_Node_Str",e);
    drawPlaceholder(canvas);
  }
}