jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: JCAConnectionRequestInfo: equals() and hashCode() are inconsistent?
Date Mon, 30 Jun 2008 11:49:39 GMT
On Mon, Jun 30, 2008 at 7:31 AM, Roman Puchkovskiy
<roman.puchkovskiy@blandware.com> wrote:
>
> Looking at JCAConnectionRequestInfo, I see that in its equals() method it
> handles the comparison of SimpleCredentials as a special case.
> SimpleCredentials does not override equals() method, so
> JCAConnectionRequestInfo.equals() makes the comparison by hand.
> But hashCode() method just delegates to Credentials' hashCode() method which
> is not overridden in SimpleCredentials too. So, when you place a
> JCAConnectionRequestInfo in the HashSet (or into a HashMap as a key) you
> will never see hits.
> This, in particular, seems to break JCR session pooling.
> Is this just a bug, or there's some rationale behind such inconsistency?

Have you verified that it actually does not work in a HashMap? If yes,
I would consider this as a bug, and would be happy if you could file
one at JIRA.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message