|
|
|
|
|
|
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: {code} Set<ConstraintViolation<MyBean>> constraintViolations = validator.validate(myBean ); System.out.println(constraintViolations.iterator().next().getPropertyPath().hashCode()); // -- always 0 (provided the set is not empty, of course) {code} *Test:* {code} PathImpl p = PathImpl.createPathFromString("just.testing"); System.out.println(p.hashCode()); PathImpl pBad = PathImpl.createCopy(p1); System.out.println(pBad.hashCode()); // ----- returns always 0 {code}
|
|
|
|
|
|