Program: 34264
Project: 34264
Buggy source:
/** 
 * Handles requests sent to the BackgroundService via Intents
 * @param - An Intent object that has been received by the BackgroundService
 */
@Override protected void onHandleIntent(Intent i){
  Log.i(TAG,"String_Node_Str");
  if (i.hasExtra(PERIODIC_BACKGROUND_PROCESSING_REQUEST)) {
    processTasks();
  }
 else   if (i.hasExtra(UI_REQUEST)) {
    String uiRequest=i.getStringExtra(UI_REQUEST);
    TaskController taskController=new TaskController();
    if (uiRequest.equals(UI_REQUEST_SEND_MESSAGE)) {
      Log.i(TAG,"String_Node_Str");
      Bundle extras=i.getExtras();
      long messageID=extras.getLong(MESSAGE_ID);
      Message messageToSend=null;
      try {
        MessageProvider msgProv=MessageProvider.get(getApplicationContext());
        messageToSend=msgProv.searchForSingleRecord(messageID);
      }
 catch (      RuntimeException e) {
        Log.i(TAG,"String_Node_Str" + UI_REQUEST_SEND_MESSAGE + "String_Node_Str"+ "String_Node_Str");
        return;
      }
      QueueRecordProcessor queueProc=new QueueRecordProcessor();
      QueueRecord queueRecord=queueProc.createAndSaveQueueRecord(TASK_SEND_MESSAGE,0,0,messageToSend,null);
      queueProc.createAndSaveQueueRecord(TASK_SEND_MESSAGE,(System.currentTimeMillis() / 1000) + FIRST_ATTEMPT_TTL,1,messageToSend,null);
      if (NetworkHelper.checkInternetAvailability() == true) {
        taskController.sendMessage(queueRecord,messageToSend,DO_POW,FIRST_ATTEMPT_TTL,FIRST_ATTEMPT_TTL);
      }
    }
 else     if (uiRequest.equals(UI_REQUEST_CREATE_IDENTITY)) {
      Log.i(TAG,"String_Node_Str");
      Bundle extras=i.getExtras();
      long addressId=extras.getLong(ADDRESS_ID);
      Address address=null;
      try {
        AddressProvider addProv=AddressProvider.get(getApplicationContext());
        address=addProv.searchForSingleRecord(addressId);
      }
 catch (      RuntimeException e) {
        Log.i(TAG,"String_Node_Str" + UI_REQUEST_CREATE_IDENTITY + "String_Node_Str"+ "String_Node_Str");
        return;
      }
      QueueRecordProcessor queueProc=new QueueRecordProcessor();
      QueueRecord queueRecord=queueProc.createAndSaveQueueRecord(TASK_CREATE_IDENTITY,0,0,address,null);
      taskController.createIdentity(queueRecord,DO_POW);
    }
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
  Intent intent=new Intent(getApplicationContext(),BackgroundService.class);
  intent.putExtra(BackgroundService.PERIODIC_BACKGROUND_PROCESSING_REQUEST,BackgroundService.BACKGROUND_PROCESSING_REQUEST);
  PendingIntent pendingIntent=PendingIntent.getService(getApplicationContext(),0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
  Calendar cal=Calendar.getInstance();
  cal.add(Calendar.SECOND,BACKGROUND_SERVICE_NORMAL_START_INTERVAL);
  Log.i(TAG,"String_Node_Str" + BACKGROUND_SERVICE_NORMAL_START_INTERVAL + "String_Node_Str");
  AlarmManager am=(AlarmManager)getApplicationContext().getSystemService(Context.ALARM_SERVICE);
  am.set(AlarmManager.RTC_WAKEUP,cal.getTimeInMillis(),pendingIntent);
}

Fixed version (ground truth):
/** 
 * Handles requests sent to the BackgroundService via Intents
 * @param - An Intent object that has been received by the BackgroundService
 */
@Override protected void onHandleIntent(Intent i){
  Log.i(TAG,"String_Node_Str");
  if (i.hasExtra(PERIODIC_BACKGROUND_PROCESSING_REQUEST)) {
    processTasks();
  }
 else   if (i.hasExtra(UI_REQUEST)) {
    String uiRequest=i.getStringExtra(UI_REQUEST);
    TaskController taskController=new TaskController();
    if (uiRequest.equals(UI_REQUEST_SEND_MESSAGE)) {
      Log.i(TAG,"String_Node_Str");
      Bundle extras=i.getExtras();
      long messageID=extras.getLong(MESSAGE_ID);
      Message messageToSend=null;
      try {
        MessageProvider msgProv=MessageProvider.get(getApplicationContext());
        messageToSend=msgProv.searchForSingleRecord(messageID);
      }
 catch (      RuntimeException e) {
        Log.i(TAG,"String_Node_Str" + UI_REQUEST_SEND_MESSAGE + "String_Node_Str"+ "String_Node_Str");
        return;
      }
      QueueRecordProcessor queueProc=new QueueRecordProcessor();
      QueueRecord queueRecord=queueProc.createAndSaveQueueRecord(TASK_SEND_MESSAGE,0,0,messageToSend,null);
      long currentTime=System.currentTimeMillis() / 1000;
      queueProc.createAndSaveQueueRecord(TASK_SEND_MESSAGE,currentTime + FIRST_ATTEMPT_TTL,1,messageToSend,null);
      if (NetworkHelper.checkInternetAvailability() == true) {
        taskController.sendMessage(queueRecord,messageToSend,DO_POW,FIRST_ATTEMPT_TTL,FIRST_ATTEMPT_TTL);
      }
    }
 else     if (uiRequest.equals(UI_REQUEST_CREATE_IDENTITY)) {
      Log.i(TAG,"String_Node_Str");
      Bundle extras=i.getExtras();
      long addressId=extras.getLong(ADDRESS_ID);
      Address address=null;
      try {
        AddressProvider addProv=AddressProvider.get(getApplicationContext());
        address=addProv.searchForSingleRecord(addressId);
      }
 catch (      RuntimeException e) {
        Log.i(TAG,"String_Node_Str" + UI_REQUEST_CREATE_IDENTITY + "String_Node_Str"+ "String_Node_Str");
        return;
      }
      QueueRecordProcessor queueProc=new QueueRecordProcessor();
      QueueRecord queueRecord=queueProc.createAndSaveQueueRecord(TASK_CREATE_IDENTITY,0,0,address,null);
      taskController.createIdentity(queueRecord,DO_POW);
    }
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
  Intent intent=new Intent(getApplicationContext(),BackgroundService.class);
  intent.putExtra(BackgroundService.PERIODIC_BACKGROUND_PROCESSING_REQUEST,BackgroundService.BACKGROUND_PROCESSING_REQUEST);
  PendingIntent pendingIntent=PendingIntent.getService(getApplicationContext(),0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
  Calendar cal=Calendar.getInstance();
  cal.add(Calendar.SECOND,BACKGROUND_SERVICE_NORMAL_START_INTERVAL);
  Log.i(TAG,"String_Node_Str" + BACKGROUND_SERVICE_NORMAL_START_INTERVAL + "String_Node_Str");
  AlarmManager am=(AlarmManager)getApplicationContext().getSystemService(Context.ALARM_SERVICE);
  am.set(AlarmManager.RTC_WAKEUP,cal.getTimeInMillis(),pendingIntent);
}