Program: 187135
Project: 187135
Buggy source:
public void addChooseAccountFragment(Bundle bundle){
  FragmentManager fragManager=getSupportFragmentManager();
  FragmentTransaction fragTrans=fragManager.beginTransaction();
  List<Account> accounts=new ArrayList<Account>();
  final AuthTable authTable=new AuthTable();
  String[] siteAvailableNames=Account.CONTROLLER_SITE_NAMES;
  String[] siteAvailableKeys=Account.CONTROLLER_SITE_KEYS;
  Auth auth;
  for (int i=0; i < siteAvailableKeys.length; i++) {
    auth=authTable.getAuthDefault(this,siteAvailableKeys[i]);
    if (auth == null) {
      accounts.add(new Account(null,siteAvailableNames[i],siteAvailableKeys[i],"String_Node_Str","String_Node_Str",null,false,false));
    }
 else {
      accounts.add(auth.convertToAccountObject());
    }
  }
  caFragment=new ChooseAccountFragment();
  caFragment.setArguments(bundle);
  caFragment.setAccountsList(accounts);
  caFragment.setOnEventListener(new OnEventListener(){
    @Override public void onSuccess(    Account account){
      Auth auth=authTable.getAuthDefault(getApplicationContext(),account.getSite());
      if (auth == null) {
        auth=new Auth(getApplicationContext(),-1,account.getName(),account.getSite(),null,null,null,null,null);
        auth.insert();
      }
      auth.setCredentials(account.getCredentials());
      auth.setData(account.getData());
      auth.setUserName(account.getUserName());
      auth.setExpires(null);
      authTable.updateLastLogin(getApplicationContext(),account.getSite(),auth.getUserName());
      auth.update();
    }
    @Override public void onFailure(    Account account,    String failureMessage){
      Auth auth=authTable.getAuthDefault(getApplicationContext(),account.getSite());
      if (auth != null) {
        auth.setCredentials(account.getCredentials());
        auth.setUserName(account.getName());
        auth.setData(account.getData());
        auth.setExpires(new Date());
        auth.update();
      }
    }
    @Override public void onRemove(    Account account){
      authTable.delete(getApplicationContext(),Integer.parseInt(account.getId()));
    }
  }
);
  fragTrans.add(R.id.fragmentLayout,caFragment);
  fragTrans.commit();
}

Fixed version (ground truth):
public void addChooseAccountFragment(Bundle bundle){
  FragmentManager fragManager=getSupportFragmentManager();
  FragmentTransaction fragTrans=fragManager.beginTransaction();
  List<Account> accounts=new ArrayList<Account>();
  final AuthTable authTable=new AuthTable();
  String[] siteAvailableNames=Account.CONTROLLER_SITE_NAMES;
  String[] siteAvailableKeys=Account.CONTROLLER_SITE_KEYS;
  Auth auth;
  for (int i=0; i < siteAvailableKeys.length; i++) {
    auth=authTable.getAuthDefault(this,siteAvailableKeys[i]);
    if (auth == null) {
      accounts.add(new Account(-1,siteAvailableNames[i],siteAvailableKeys[i],"String_Node_Str","String_Node_Str",null,false,false));
    }
 else {
      accounts.add(auth.convertToAccountObject());
    }
  }
  caFragment=new ChooseAccountFragment();
  caFragment.setArguments(bundle);
  caFragment.setAccountsList(accounts);
  caFragment.setOnEventListener(new OnEventListener(){
    @Override public void onSuccess(    Account account){
      Auth auth=authTable.getAuthDefault(getApplicationContext(),account.getSite());
      if (auth == null) {
        auth=new Auth(getApplicationContext(),-1,account.getName(),account.getSite(),null,null,null,null,null);
        auth.insert();
      }
      account.setId(auth.getId());
      auth.setCredentials(account.getCredentials());
      auth.setData(account.getData());
      auth.setUserName(account.getUserName());
      auth.setExpires(null);
      authTable.updateLastLogin(getApplicationContext(),account.getSite(),auth.getUserName());
      auth.update();
    }
    @Override public void onFailure(    Account account,    String failureMessage){
      Auth auth=authTable.getAuthDefault(getApplicationContext(),account.getSite());
      if (auth != null) {
        auth.setCredentials(account.getCredentials());
        auth.setUserName(account.getName());
        auth.setData(account.getData());
        auth.setExpires(new Date());
        auth.update();
      }
    }
    @Override public void onRemove(    Account account){
      authTable.delete(getApplicationContext(),account.getId());
    }
  }
);
  fragTrans.add(R.id.fragmentLayout,caFragment);
  fragTrans.commit();
}