DoubleBuffer.compareTo is not anti-symmetric

Alan Bateman Alan.Bateman at Sun.COM
Wed Nov 25 06:40:22 PST 2009


Martin Buchholz wrote:
> :
> I improved the spec to make it hopefully less clumsy,
> and added some more tests as well.
>   
It is better. One small comment on equals is that it might be better if 
the "Unlike ..." statement were changed slightly to say that the method 
considers positive zero and negative zero to be equal before 
{Float,Double}.equals is mentioned. That way the mention of the 
difference is more of a "by the way" and the reader don't have to follow 
the link.

In compareTo, it might be better if we changed "This method compares two 
XXX values as if by ..."  to "Elements are compared as if by ..." (just 
a suggestion to make it make it follow the second paragraph a bit better).

> :
>   
> I'm pretty sure that the only change is in the doc for CharBuffer.java.
> It now talks about "char buffer" instead of "character buffer",
> which is (sadly) a clear improvement.
>   
OK and thanks for checking.

> I'd like to commit my latest version.  webrev regenerated.
>
> (Unless of course we suddenly become bold enough to
> switch to saner semantics)
>   
Assuming you mean +0.0/-0.0 then it's not clear what/who it would break. 
Minimally it would require a "get out of jail" switch to restore the 
long standing behavior.

-Alan.


More information about the nio-dev mailing list