Program: 191057
Project: 191057
Buggy source:
/** 
 * Called when the set of account has changed, given the new array of active accounts.
 */
public void doDatabaseCleanup(Account[] accounts,int userId){
synchronized (mAuthorities) {
    if (Log.isLoggable(TAG,Log.VERBOSE)) {
      Slog.v(TAG,"String_Node_Str");
    }
    SparseArray<AuthorityInfo> removing=new SparseArray<AuthorityInfo>();
    Iterator<AccountInfo> accIt=mAccounts.values().iterator();
    while (accIt.hasNext()) {
      AccountInfo acc=accIt.next();
      if (!ArrayUtils.contains(accounts,acc.accountAndUser.account) && acc.accountAndUser.userId == userId) {
        if (Log.isLoggable(TAG,Log.VERBOSE)) {
          Slog.v(TAG,"String_Node_Str" + acc.accountAndUser);
        }
        for (        AuthorityInfo auth : acc.authorities.values()) {
          removing.put(auth.ident,auth);
        }
        accIt.remove();
      }
    }
    int i=removing.size();
    if (i > 0) {
      while (i > 0) {
        i--;
        int ident=removing.keyAt(i);
        AuthorityInfo auth=removing.valueAt(i);
        if (mAuthorityRemovedListener != null) {
          mAuthorityRemovedListener.onAuthorityRemoved(auth.target);
        }
        mAuthorities.remove(ident);
        int j=mSyncStatus.size();
        while (j > 0) {
          j--;
          if (mSyncStatus.keyAt(j) == ident) {
            mSyncStatus.remove(mSyncStatus.keyAt(j));
          }
        }
        j=mSyncHistory.size();
        while (j > 0) {
          j--;
          if (mSyncHistory.get(j).authorityId == ident) {
            mSyncHistory.remove(j);
          }
        }
      }
      writeAccountInfoLocked();
      writeStatusLocked();
      writeStatisticsLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * Called when the set of account has changed, given the new array of active accounts.
 */
public void doDatabaseCleanup(Account[] accounts,int userId){
  if (SystemProperties.getBoolean("String_Node_Str",false)) {
    return;
  }
synchronized (mAuthorities) {
    if (Log.isLoggable(TAG,Log.VERBOSE)) {
      Slog.v(TAG,"String_Node_Str");
    }
    SparseArray<AuthorityInfo> removing=new SparseArray<AuthorityInfo>();
    Iterator<AccountInfo> accIt=mAccounts.values().iterator();
    while (accIt.hasNext()) {
      AccountInfo acc=accIt.next();
      if (!ArrayUtils.contains(accounts,acc.accountAndUser.account) && acc.accountAndUser.userId == userId) {
        if (Log.isLoggable(TAG,Log.VERBOSE)) {
          Slog.v(TAG,"String_Node_Str" + acc.accountAndUser);
        }
        for (        AuthorityInfo auth : acc.authorities.values()) {
          removing.put(auth.ident,auth);
        }
        accIt.remove();
      }
    }
    int i=removing.size();
    if (i > 0) {
      while (i > 0) {
        i--;
        int ident=removing.keyAt(i);
        AuthorityInfo auth=removing.valueAt(i);
        if (mAuthorityRemovedListener != null) {
          mAuthorityRemovedListener.onAuthorityRemoved(auth.target);
        }
        mAuthorities.remove(ident);
        int j=mSyncStatus.size();
        while (j > 0) {
          j--;
          if (mSyncStatus.keyAt(j) == ident) {
            mSyncStatus.remove(mSyncStatus.keyAt(j));
          }
        }
        j=mSyncHistory.size();
        while (j > 0) {
          j--;
          if (mSyncHistory.get(j).authorityId == ident) {
            mSyncHistory.remove(j);
          }
        }
      }
      writeAccountInfoLocked();
      writeStatusLocked();
      writeStatisticsLocked();
    }
  }
}