Re: Code review request for 6891113: More methods for java.util.Objects: deepEquals, hash, toString with default

2009-10-23 Thread Joseph D. Darcy
Joe Darcy wrote: Neal Gafter wrote: There should be a shortcut in Arrays.deepEquals0 when e1==e2. That shortcut is in Objects.deepEquals(Object a, Object b) and Arrays.deepEquals on lines 3947 and 3948. The nested call in deepEquals0 is to deepEquals rather than deepEquals0 so the

Code review request for 6891113: More methods for java.util.Objects: deepEquals, hash, toString with default

2009-10-21 Thread Joseph D. Darcy
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/ Thanks, -Joe

Re: Code review request for 6891113: More methods for java.util.Objects: deepEquals, hash, toString with default

2009-10-21 Thread Neal Gafter
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.

Re: Code review request for 6891113: More methods for java.util.Objects: deepEquals, hash, toString with default

2009-10-21 Thread Joe Darcy
Neal Gafter wrote: There should be a shortcut in Arrays.deepEquals0 when e1==e2. That shortcut is in Objects.deepEquals(Object a, Object b) and Arrays.deepEquals on lines 3947 and 3948. The nested call in deepEquals0 is to deepEquals rather than deepEquals0 so the shortcut is used on all