Skip to main content

Blog Archive for emcmanus during July 2007

I was using this Java idiom today, not for the first time, and thought I'd blog it for people not aware of it. You probably know that if you compare two objects x and y using x.equals(y), the result will be false if they are distinct arrays, even if their contents are the same. There is an easy way to get the right result for arrays. It is Arrays.deepEquals(new Object[] {x}, new Object[] {y...