private int compareNullSafe(Configuration c) { int rc = 0; if ((this.getUser() == null && c.getUser() != null)) { rc = 1; } else if (c.getUser() == null && this.getUser() != null) { rc = -1; } else { // e1 and e2 != null rc = compareNullSafe(c.getUser()); } return rc; }
private String loadLogin(CnATreeElement element) { String login = null; try { LoadConfiguration command = new LoadConfiguration(element); command = ServiceFactory.lookupCommandService().executeCommand(command); Configuration configuration = command.getConfiguration(); if (configuration != null) { login = configuration.getUser(); } } catch (CommandException e) { LOG.error("Error while loading account data.", e); // $NON-NLS-1$ } return login; }