Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-27 22:15:32-0400)
Maven home: c:\Program Files\apache-maven-3.1.0
Java version: 1.7.0_40, vendor: Oracle Corporation
Java home: c:\Program Files\Java\jdk1.7.0_40\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-27 22:15:32-0400) Maven home: c:\Program Files\apache-maven-3.1.0 Java version: 1.7.0_40, vendor: Oracle Corporation Java home: c:\Program Files\Java\jdk1.7.0_40\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Description
I'm seeing MicroKernelIT.getNodesHash() test failures on the environment described above.
The problem seems to be caused by the way AbstractNode uses a hash map for properties and doesn't sort the keys before serialization. Since the ordering of properties in a hashmap is undefined and can change for implementation reasons, it's possible for two serializations of the same node to be different.
To avoid this problem AbstractNode should either use a sorted map like TreeMap for properties, or explicitly sort the properties during serialization.