if (username != null) { for (final LoginAlias loginAlias : RootDomainObject.getInstance().getLoginAlias()) { if (loginAlias.getAlias().equalsIgnoreCase(username)) { return loginAlias.getLogin(); }
final String lowerCaseUsername = username.toLowerCase(); final SoftReference<Login> loginReference = loginMap.get(lowerCaseUsername); if (loginReference != null) { final Login login = loginReference.get(); if (login != null && login.getRootDomainObject() == RootDomainObject.getInstance() && login.hasUsername(lowerCaseUsername)) { return login; } else { loginMap.remove(lowerCaseUsername); } }   for (final LoginAlias loginAlias : RootDomainObject.getInstance().getLoginAlias()) {   final String lowerCaseLoginUsername = loginAlias.getAlias().toLowerCase(); if (!loginMap.containsKey(lowerCaseLoginUsername)) { loginMap.put(lowerCaseLoginUsername, new SoftReference<Login>(loginAlias.getLogin())); }   if (lowerCaseLoginUsername.equalsIgnoreCase(lowerCaseUsername)) { return loginAlias.getLogin();
    public static Login readLoginByUsername(String username) {	if (username != null) {	    for (final LoginAlias loginAlias : RootDomainObject.getInstance().getLoginAlias()) {		if (loginAlias.getAlias().equalsIgnoreCase(username)) {		    return loginAlias.getLogin();		}	    }	}	return null;    }