I noticed that two new classes have been added in org.geotools.util: EqualUtils
and HashCodeUtil. Can we consolidate them in org.geotools.resources.Utilities,
maybe moving the later to org.geotools.util if people really wish to commit
ourself in public API?
* The implementation of EqualUtils.equals(Object,Object) is in contradiction
with its Javadoc (it said that it is not for arrays, but actually do check
for arrays).
* EqualUtils.equals(Object,Object) duplicates Utilities.deepEquals.
* HashCodeUtils.equals(Object) duplicates Utilities.deepHashCode(Object).
* "deepEquals" whould be safer than overloading "equals" as a method name
for a method expecting (Object,Object) argument. Otherwise the "deepEquals"
check would be trigger more often than needed (especially in the context of
autoboxing of primitive type, given than current EqualsUtils do not overload
all of them).
* "deepHashCode" would be safer than overloading "hash" as a method name for
a method expecting (Object) argument, for the same reason than above.
For the two last points, if the goal was to make sure that array are always
checked deeply, a possible approach may be add an "assert" statement making
sure
that the argument is not an array in the "equals(Object,Object)" method. In
case
of doubt, developper would be suggested to use "deepEquals(Object,Object)".
We I make this consolidation?
Martin
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel