Program: 86290
Project: 86290
Buggy source:
@Override protected Object[] doInBackground(Object... params){
  AccountDataSource data=new AccountDataSource(ReminderCheckService.this);
  data.open();
  List<Account> accounts=data.getAccountsWithPassword();
  if (accounts.size() == 0)   return null;
  Log.i("String_Node_Str","String_Node_Str");
  SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(ReminderCheckService.this);
  long now=new Date().getTime();
  long warning=Long.decode(sp.getString("String_Node_Str","String_Node_Str"));
  long expired_new=0;
  long expired_total=0;
  long affected_accounts=0;
  long first=0;
  long first_affected_account=0;
  Bundle notified=new Bundle();
  OpacClient app=(OpacClient)getApplication();
  for (  Account account : accounts) {
    Log.i("String_Node_Str","String_Node_Str" + account.toString());
    try {
      Library library=app.getLibrary(account.getLibrary());
      OpacApi api=app.getNewApi(library);
      if (!api.isAccountSupported(library))       continue;
      AccountData res=api.account(account);
      if (res == null)       continue;
      data.storeCachedAccountData(account,res);
      int this_account=0;
      for (      ContentValues item : res.getLent()) {
        if (item.containsKey(AccountData.KEY_LENT_DOWNLOAD)) {
          if (item.getAsString(AccountData.KEY_LENT_DOWNLOAD).startsWith("String_Node_Str"))           continue;
        }
        if (item.containsKey(AccountData.KEY_LENT_DEADLINE_TIMESTAMP)) {
          long expiring=item.getAsLong(AccountData.KEY_LENT_DEADLINE_TIMESTAMP);
          if ((expiring - now) < warning) {
            expired_total++;
            if (!data.notificationIsSent(account.getId(),expiring)) {
              expired_new++;
            }
            this_account++;
          }
          notified.putLongArray(account.getId() + "String_Node_Str" + expiring,new long[]{account.getId(),expiring});
          if (expiring < first || first == 0) {
            first=expiring;
          }
        }
      }
      if (this_account > 0) {
        affected_accounts++;
        if (first_affected_account == 0)         first_affected_account=account.getId();
      }
    }
 catch (    ClientProtocolException e) {
      e.printStackTrace();
    }
catch (    SocketException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
catch (    Exception e) {
      ACRA.getErrorReporter().handleException(e);
    }
  }
  data.close();
  return new Object[]{expired_new,expired_total,notified,first,affected_accounts,first_affected_account};
}

Fixed version (ground truth):
@Override protected Object[] doInBackground(Object... params){
  AccountDataSource data=new AccountDataSource(ReminderCheckService.this);
  data.open();
  List<Account> accounts=data.getAccountsWithPassword();
  if (accounts.size() == 0)   return null;
  Log.i("String_Node_Str","String_Node_Str");
  SharedPreferences sp=PreferenceManager.getDefaultSharedPreferences(ReminderCheckService.this);
  long now=new Date().getTime();
  long warning=Long.decode(sp.getString("String_Node_Str","String_Node_Str"));
  long expired_new=0;
  long expired_total=0;
  long affected_accounts=0;
  long first=0;
  long first_affected_account=0;
  Bundle notified=new Bundle();
  OpacClient app=(OpacClient)getApplication();
  for (  Account account : accounts) {
    Log.i("String_Node_Str","String_Node_Str" + account.toString());
    try {
      Library library=app.getLibrary(account.getLibrary());
      OpacApi api=app.getNewApi(library);
      if (!api.isAccountSupported(library))       continue;
      AccountData res=api.account(account);
      if (res == null)       continue;
      data.storeCachedAccountData(account,res);
      int this_account=0;
      for (      ContentValues item : res.getLent()) {
        if (item.containsKey(AccountData.KEY_LENT_DOWNLOAD)) {
          if (item.getAsString(AccountData.KEY_LENT_DOWNLOAD).startsWith("String_Node_Str"))           continue;
        }
        if (item.containsKey(AccountData.KEY_LENT_DEADLINE_TIMESTAMP)) {
          long expiring=item.getAsLong(AccountData.KEY_LENT_DEADLINE_TIMESTAMP);
          if ((expiring - now) < warning) {
            expired_total++;
            if (!data.notificationIsSent(account.getId(),expiring)) {
              expired_new++;
            }
            this_account++;
          }
          notified.putLongArray(account.getId() + "String_Node_Str" + expiring,new long[]{account.getId(),expiring});
          if (expiring < first || first == 0) {
            first=expiring;
          }
        }
      }
      if (this_account > 0) {
        affected_accounts++;
        if (first_affected_account == 0)         first_affected_account=account.getId();
      }
    }
 catch (    ClientProtocolException e) {
      e.printStackTrace();
    }
catch (    SocketException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
catch (    OpacErrorException e) {
      e.printStackTrace();
    }
catch (    Exception e) {
      ACRA.getErrorReporter().handleException(e);
    }
  }
  data.close();
  return new Object[]{expired_new,expired_total,notified,first,affected_accounts,first_affected_account};
}