Source:
protected Identity attributesToIdentity(LdapName dn){ LdapContext context = getServiceContext(); try { Attributes search = context.getAttributes(dn); log.trace("Attributes for dn: " + dn + " to translate: " + search); String externalIdType; String accountName; String externalId = dn.toString(); String login; Boolean user = false; if (isType(search, getConstantsConfig().getUserObjectClass())){ externalIdType = getConstantsConfig().getUserScope(); if (search.get(getConstantsConfig().getUserNameField()) != null) { accountName = (String) search.get(getConstantsConfig().getUserNameField()).get(); } else { accountName = externalId; } login = (String) search.get(getConstantsConfig().getUserLoginField()).get(); user = true; } else if (isType(search, getConstantsConfig().getGroupObjectClass())) { externalIdType = getConstantsConfig().getGroupScope(); if (search.get(getConstantsConfig().getGroupNameField()) != null) { accountName = (String) search.get(getConstantsConfig().getGroupNameField()).get(); } else { accountName = externalId; } if (search.get(getConstantsConfig().getUserLoginField()) != null) { login = (String) search.get(getConstantsConfig().getUserLoginField()).get(); } else { login = accountName; } } else { return null; } return new Identity(externalIdType, externalId, accountName, null, null, login, user); } catch (NamingException e) { getLogger().error("Failed to get attributes: : {}", dn, e.getExplanation()); if(!LDAPUtils.isRecoverable(e)) { invalidateServiceContext(context); context = null; } return null; } finally { if (context != null) { returnServiceContext(context); } } }

Target:
protected Identity attributesToIdentity(LdapName dn){ LdapContext context = getServiceContext(); try { Attributes search = context.getAttributes(dn); log.trace("Attributes for dn: " + dn + " to translate: " + search); String externalIdType; String accountName; String externalId = dn.toString(); String login; boolean user = false; if (isType(search, getConstantsConfig().getUserObjectClass())){ externalIdType = getConstantsConfig().getUserScope(); if (search.get(getConstantsConfig().getUserNameField()) != null) { accountName = (String) search.get(getConstantsConfig().getUserNameField()).get(); } else { accountName = externalId; } login = (String) search.get(getConstantsConfig().getUserLoginField()).get(); user = true; } else if (isType(search, getConstantsConfig().getGroupObjectClass())) { externalIdType = getConstantsConfig().getGroupScope(); if (search.get(getConstantsConfig().getGroupNameField()) != null) { accountName = (String) search.get(getConstantsConfig().getGroupNameField()).get(); } else { accountName = externalId; } if (search.get(getConstantsConfig().getUserLoginField()) != null) { login = (String) search.get(getConstantsConfig().getUserLoginField()).get(); } else { login = accountName; } } else { return null; } return new Identity(externalIdType, externalId, accountName, null, null, login, user); } catch (NamingException e) { getLogger().error("Failed to get attributes: : {}", dn, e.getExplanation()); if(!LDAPUtils.isRecoverable(e)) { invalidateServiceContext(context); context = null; } return null; } finally { if (context != null) { returnServiceContext(context); } } }