Function PathImpl.createCopy(PathImpl path) creates new PathImpl that has hashCode==0. This value is fixed and never changes (due to the algorithm in hascode() funcion). The correct value after copying should have been -1 or the same value as in the source object.
The problematic PathImpl with the zero hashCode is unfortunately returned from the validate() function:
Hey , agreed, the hash code should be the same as the one of the copied node. Out of interest, is this a theoretical issue for you, or did you run into any problems in practice caused by that? Also, would you be interested in preparing a fix for this and sending a pull request for it?
Hi Gunnar, unfortunately we really found this bug during development of our app. We used Paths as keys to a HashMap and then weren't able to find them because cloned Path had the buggy hashCode.
The fix is easy, I will prepare it and try to send a first pull request in my life
CLA signed. Thanks.