From: Martin D. <mar...@ge...> - 2007-11-30 10:59:25
|
Jody Garnett a écrit : > Changing Utilities.equals( obj, obj ) to do reflection on arrays has > helped matters to the point that shapefile renderer tests pass. Woot! Thanks for doing that. However if nobody object, I will rename this method "deepEquals" for consistency with Java 5 method: http://java.sun.com/javase/6/docs/api/java/util/Arrays.html#deepEquals(java.lang.Object[],%20java.lang.Object[]) The old "equals" method could still be used when the object is know to not be an array (avoid the getClass().isArray() check and is also consistent with the "equals" method in java.util.Arrays). I also noticed that a new public static boolean equals(float[], float[]) method has been introduced. Again if no body object, I will remove this method and replace their call by a call to the following: http://java.sun.com/javase/6/docs/api/java/util/Arrays.html#equals(float[],%20float[]) One reason for using standard Java methods when available is that they are often implemented in a better way than we do. The new Utilities.equals(float[], float[]) method fails with the usual suspect: NaN numbers. The Java implementation work correctly with them. Martin |