avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu" <aok...@bellsouth.net>
Subject [OT] Bug in NIO
Date Thu, 19 Feb 2004 06:09:06 GMT
I think I found a bug in NIO but I'm seeing double right now
after chasing it for so long.  The bug has to do with a simple 
hashCode function - nothing really to do with the core operations
of the API.  

I was wondering if others can look at this junit testcase I have here
and perhaps even run it to confirm that I'm not smoking crack.
I this really a bug?

The test is simply this here:

    public void testBufferHashing() throws Exception
        HashMap l_map = new HashMap() ;
        for( int ii = 0; ii < 10; ii++ )
            ByteBuffer l_buf = ByteBuffer.allocateDirect( 4096 ) ;
            l_map.put( l_buf, new Integer( ii ) ) ;
        assertTrue( l_map.size() == 10 ) ;

Seems like there's a hashCode problem with the direct buffer.

Thanks in advance,

View raw message