classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] java.nio hashcode methods


From: Michael Koch
Subject: Re: [cp-patches] java.nio hashcode methods
Date: Thu, 16 Sep 2004 14:50:52 +0200
User-agent: KMail/1.6.2

On Thursday 16 September 2004 14:17, Sven de Marothy wrote:
> Hi,
>
> Here is a patch implementing the java.nio.*Buffer class hashCode()
> methods. Although it shouldn't be necessary, I've made it
> semi-compatible with the corresponding JDK hash codes.
> (Done cleanly by hashing a one byte buffer, a two byte buffer
> and so on. Not very hard to figure out.)
>
> For FloatBuffer, DoubleBuffer and LongBuffer the JDK is buggy and
> does not give useful hash codes. So in this case, the
> implementation is not compatible. The hash function is also stated
> in the docs.
>
> Ok?

I'm generally okay with this patch but I don't like the source code 
formatting. It doesn't follow "our" style.

- Please add " " (space) around operators.

+    for (int i = position()+1; i < limit(); i++)
...
+       hashCode += (get(i) + 30)*multiplier;

- The curly brackets need to be indented by two spaces after for 
statements.

What you have fixed this please commit.


Michael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]