Code review request for 6891113: More methods for java.util.Objects: deepEquals, hash, toString with default
Neal Gafter
neal at gafter.com
Thu Oct 22 01:26:33 UTC 2009
There should be a shortcut in Arrays.deepEquals0 when e1==e2. Also, the
code will throw an assertion error if e1!=null and e2==null (which can occur
when called from Arrays.deepEquals). The simplest way to fix these is to
move the if statements from Objects.deepEquals into Arrays.deepEquals0.
Alternately, change the call of Arrays.deepEquals0 in Arrays.deepEquals to a
call to Objects.deepEquals. If you do the latter, you might as well move
all the code of deepEquals0 into the body of Object.deepEquals.
Cheers,
Neal
On Wed, Oct 21, 2009 at 5:24 PM, Joseph D. Darcy <Joe.Darcy at sun.com> wrote:
> Hello.
>
> Please review this webrev to add deepEquals(Object, Object),
> hash(Object...) and toString(Object, String) to j.u.Objects:
>
> 6891113 More methods for java.util.Objects: deepEquals, hash, toString with
> default
> http://cr.openjdk.java.net/~darcy/6891113.0/<http://cr.openjdk.java.net/%7Edarcy/6891113.0/>
>
> Thanks,
>
> -Joe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20091021/b5b87186/attachment.html>
More information about the core-libs-dev
mailing list