Program: 24621
Project: 24621
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Log.d(TAG,"String_Node_Str");
  AppWidgetManager manager=AppWidgetManager.getInstance(context);
  RemoteViews views=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  Intent intentSend=new Intent(context,com.kopysoft.chronos.content.EnableWidget.class);
  intentSend.setAction(SEND_CLOCK);
  PendingIntent pendingIntent=PendingIntent.getBroadcast(context,0,intentSend,0);
  Chronos chron=new Chronos(context);
  Job currentJob=chron.getAllJobs().get(0);
  PunchTable punchTable=chron.getAllPunchesForThisPayPeriodByJob(currentJob);
  Task defaultTask=chron.getAllTasks().get(0);
  Duration dur=PayPeriodAdapterList.getTime(punchTable.getPunchPair(DateTime.now()),true);
  if (intent.getAction().compareTo(SEND_CLOCK) == 0) {
    if (dur.getMillis() < 0) {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_enabled);
    }
 else {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_disabled);
    }
    Punch newPunch=new Punch(currentJob,defaultTask,DateTime.now());
    chron.insertPunch(newPunch);
    punchTable=chron.getAllPunchesForThisPayPeriodByJob(currentJob);
    defaultTask=chron.getAllTasks().get(0);
    dur=PayPeriodAdapterList.getTime(punchTable.getPunchPair(DateTime.now()));
    Intent runIntent=new Intent().setClass(context,com.kopysoft.chronos.content.NotificationBroadcast.class);
    runIntent.putExtra("String_Node_Str",dur.getMillis());
    context.sendBroadcast(runIntent);
  }
 else   if (intent.getAction().compareTo(UPDATE_FROM_APP) == 0) {
    if (dur.getMillis() > 0) {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_disabled);
    }
 else {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_enabled);
    }
  }
 else {
    super.onReceive(context,intent);
    return;
  }
  Intent runIntent=new Intent().setClass(context,com.kopysoft.chronos.content.NotificationBroadcast.class);
  runIntent.putExtra("String_Node_Str",dur.getMillis());
  context.sendBroadcast(runIntent);
  chron.close();
  if (printDebugMessages)   Log.d(TAG,intent.getAction());
  views.setOnClickPendingIntent(R.id.imageButton,pendingIntent);
  manager.updateAppWidget(new ComponentName(context,EnableWidget.class),views);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Log.d(TAG,"String_Node_Str");
  AppWidgetManager manager=AppWidgetManager.getInstance(context);
  RemoteViews views=new RemoteViews(context.getPackageName(),R.layout.widget_layout);
  Intent intentSend=new Intent(context,com.kopysoft.chronos.content.EnableWidget.class);
  intentSend.setAction(SEND_CLOCK);
  PendingIntent pendingIntent=PendingIntent.getBroadcast(context,0,intentSend,0);
  Chronos chron=new Chronos(context);
  Job currentJob=chron.getAllJobs().get(0);
  PunchTable punchTable=chron.getAllPunchesForThisPayPeriodByJob(currentJob);
  Task defaultTask=chron.getAllTasks().get(0);
  Duration dur=PayPeriodAdapterList.getTime(punchTable.getPunchPair(DateTime.now()),true);
  if (intent.getAction().compareTo(SEND_CLOCK) == 0) {
    if (dur.getMillis() >= 0) {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_enabled);
    }
 else {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_disabled);
    }
    Punch newPunch=new Punch(currentJob,defaultTask,DateTime.now());
    chron.insertPunch(newPunch);
    punchTable=chron.getAllPunchesForThisPayPeriodByJob(currentJob);
    defaultTask=chron.getAllTasks().get(0);
    dur=PayPeriodAdapterList.getTime(punchTable.getPunchPair(DateTime.now()));
    Intent runIntent=new Intent().setClass(context,com.kopysoft.chronos.content.NotificationBroadcast.class);
    runIntent.putExtra("String_Node_Str",dur.getMillis());
    context.sendBroadcast(runIntent);
  }
 else   if (intent.getAction().compareTo(UPDATE_FROM_APP) == 0) {
    if (dur.getMillis() < 0) {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_disabled);
    }
 else {
      views.setImageViewResource(R.id.imageButton,R.drawable.widget_enabled);
    }
  }
 else {
    super.onReceive(context,intent);
    return;
  }
  Intent runIntent=new Intent().setClass(context,com.kopysoft.chronos.content.NotificationBroadcast.class);
  runIntent.putExtra("String_Node_Str",dur.getMillis());
  context.sendBroadcast(runIntent);
  chron.close();
  if (printDebugMessages)   Log.d(TAG,intent.getAction());
  views.setOnClickPendingIntent(R.id.imageButton,pendingIntent);
  manager.updateAppWidget(new ComponentName(context,EnableWidget.class),views);
}