Program: 24654
Project: 24654
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  prefs=new PreferenceSingleton();
  Chronos forUpdate=new Chronos(getApplicationContext());
  SQLiteDatabase db=forUpdate.getWritableDatabase();
  db.close();
  StaticFunctions.fixMidnight(prefs.getStartOfThisPP(getApplicationContext()),prefs.getWeeksInPP(getApplicationContext()),getApplicationContext());
  setUpAlarm();
  GregorianCalendar midnightAlarm=new GregorianCalendar();
  midnightAlarm.add(Calendar.DAY_OF_YEAR,1);
  midnightAlarm.set(Calendar.HOUR_OF_DAY,0);
  midnightAlarm.set(Calendar.MINUTE,0);
  midnightAlarm.set(Calendar.SECOND,0);
  Intent sentIntent=new Intent(getApplicationContext(),MidnightBroadcast.class);
  PendingIntent sender=PendingIntent.getBroadcast(getApplicationContext(),Defines.MIDNIGHT_ALARM,sentIntent,PendingIntent.FLAG_UPDATE_CURRENT);
  AlarmManager am=(AlarmManager)getSystemService(ALARM_SERVICE);
  am.setRepeating(AlarmManager.RTC,midnightAlarm.getTimeInMillis(),AlarmManager.INTERVAL_DAY,sender);
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,com.kopysoft.chronos.ClockInAndOut.class);
  spec=tabHost.newTabSpec("String_Node_Str").setIndicator("String_Node_Str").setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,com.kopysoft.chronos.WeekView.class);
  spec=tabHost.newTabSpec("String_Node_Str").setIndicator("String_Node_Str").setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,com.kopysoft.chronos.PastView.class);
  spec=tabHost.newTabSpec("String_Node_Str").setIndicator("String_Node_Str").setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
  ListenerObj.getInstance().addPropertyChangeListener(new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (DEBUG_PRINT)       Log.d(TAG,"String_Node_Str");
      setUpAlarm();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  prefs=new PreferenceSingleton();
  Chronos forUpdate=new Chronos(getApplicationContext());
  SQLiteDatabase db=forUpdate.getWritableDatabase();
  db.close();
  StaticFunctions.fixMidnight(prefs.getStartOfThisPP(getApplicationContext()),prefs.getWeeksInPP(getApplicationContext()),getApplicationContext());
  setUpAlarm();
  GregorianCalendar midnightAlarm=new GregorianCalendar();
  midnightAlarm.add(Calendar.DAY_OF_YEAR,1);
  midnightAlarm.set(Calendar.HOUR_OF_DAY,0);
  midnightAlarm.set(Calendar.MINUTE,0);
  midnightAlarm.set(Calendar.SECOND,0);
  Intent sentIntent=new Intent(getApplicationContext(),MidnightBroadcast.class);
  PendingIntent sender=PendingIntent.getBroadcast(getApplicationContext(),Defines.MIDNIGHT_ALARM,sentIntent,PendingIntent.FLAG_UPDATE_CURRENT);
  AlarmManager am=(AlarmManager)getSystemService(ALARM_SERVICE);
  am.setRepeating(AlarmManager.RTC_WAKEUP,midnightAlarm.getTimeInMillis(),AlarmManager.INTERVAL_DAY,sender);
  TabHost tabHost=getTabHost();
  TabHost.TabSpec spec;
  Intent intent;
  intent=new Intent().setClass(this,com.kopysoft.chronos.ClockInAndOut.class);
  spec=tabHost.newTabSpec("String_Node_Str").setIndicator("String_Node_Str").setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,com.kopysoft.chronos.WeekView.class);
  spec=tabHost.newTabSpec("String_Node_Str").setIndicator("String_Node_Str").setContent(intent);
  tabHost.addTab(spec);
  intent=new Intent().setClass(this,com.kopysoft.chronos.PastView.class);
  spec=tabHost.newTabSpec("String_Node_Str").setIndicator("String_Node_Str").setContent(intent);
  tabHost.addTab(spec);
  tabHost.setCurrentTab(0);
  ListenerObj.getInstance().addPropertyChangeListener(new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (DEBUG_PRINT)       Log.d(TAG,"String_Node_Str");
      setUpAlarm();
    }
  }
);
}