directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Closed: (DIR-12) Direct NIO ByteBuffer does not produce correct hashCodes
Date Thu, 19 Feb 2004 07:16:52 GMT

   The following issue has been closed.

   Resolver: Alex Karasulu
       Date: Wed, 18 Feb 2004 11:15 PM

Turns out this is the actual behavoir Buffers are supposed to have.  Yeah I was totally spooked
by this one and feel stupid for it.  Here's what the hashCode documentations says for it:

The hash code of a byte buffer depends only upon its remaining elements; that is, upon the
elements from position() up to, and including, the element at limit() - 1. 

Because buffer hash codes are content-dependent, it is inadvisable to use buffers as keys
in hash maps or similar data structures unless it is known that their contents will not change.

So there ya go - the lookup of buffers now needs to change in the buffer pool.  This specific
problem also makes the need for a custom buffer pool implementation all that much more legitamate
instead of basing it on another pooling implementation that might not consider these factors.

View the issue:

Here is an overview of the issue:
        Key: DIR-12
    Summary: Direct NIO ByteBuffer does not produce correct hashCodes
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: WON'T FIX

    Project: Directory

   Assignee: Alex Karasulu
   Reporter: Alex Karasulu

    Created: Wed, 18 Feb 2004 10:28 PM
    Updated: Wed, 18 Feb 2004 11:15 PM
    Due:     Thu, 19 Feb 2004 12:00 AM

We need to basically find a work around for dealing with this issue in the BufferPool component.
 I'll add this today.

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message