@ Nullable private String normalizedDn ( String dn ) { if ( isNullOrEmpty ( dn ) ) { return dn ; } else { try { return new Dn ( dn ) . getNormName ( ) ; } catch ( LdapInvalidDnException e ) { LOG . debug ( "Invalid DN" , e ) ; return dn ; } } }
When the given string is a DN the method ensures that the DN gets normalized so it can be used in string comparison .