directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <>
Subject [jira] [Commented] (DIRAPI-320) ClassCastException on Objects.equals(Value,Value) for userPassword attribute
Date Wed, 12 Sep 2018 21:35:00 GMT


Emmanuel Lecharny commented on DIRAPI-320:

Actually, when loading the schema from {{OpenLDAP}}, we don't get any information regarding
the {{LdapComapators}} (and same thing for LdapSyntax, SyntaxCheckers, Normalizers). In strict
mode, the schema won't load because you will get errors due to those lacking elements. In
relaxed mode, the schema will load, but you will have issues when trying to use it...

I'm going to investigate further, to see if there is a way to workaround/fix this issue

> ClassCastException on Objects.equals(Value,Value) for userPassword attribute
> ----------------------------------------------------------------------------
>                 Key: DIRAPI-320
>                 URL:
>             Project: Directory Client API
>          Issue Type: Bug
>    Affects Versions: 2.0.0.AM2
>            Reporter: Pavel Zlámal
>            Priority: Minor
> When I use _JarLdifSchemaLoader_ it seems to load _userPassword_ attribute type with
different Comparator than when I load it from LDAP connection (openLDAP in my case).
> Then If I call:
> {code:java}
> Objects.equals(val, attribute.get())
> {code}
> to check if value passed to my method is the first in the attribute, I get _ClassCastException_,
since it tries to pass _String_ (normalized value) to the _ByteArrayComparator._
> When I use Schema only loaded from connection, then it works, since it uses _ComparableComparator._
> {code:java}
> java.lang.ClassCastException: java.lang.String cannot be cast to [B
>     at
>     at
>     at java.util.Objects.equals(
> {code}
> So there is probably bug in schema ldif included in JAR or in equals() implementation
of Value.

This message was sent by Atlassian JIRA

View raw message