Skip to content

Commit c11fdeb

Browse files
gsmetgunnarmorling
authored andcommitted
HV-1480 Don't take into account the parent in hashCode and equals
Otherwise, we "compare" the whole path several times while comparing a path.
1 parent e76f701 commit c11fdeb

File tree

1 file changed

+0
-9
lines changed
  • engine/src/main/java/org/hibernate/validator/internal/engine/path

1 file changed

+0
-9
lines changed

engine/src/main/java/org/hibernate/validator/internal/engine/path/NodeImpl.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ public final int buildHashCode() {
439439
result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
440440
result = prime * result + ( ( parameterIndex == null ) ? 0 : parameterIndex.hashCode() );
441441
result = prime * result + ( ( parameterTypes == null ) ? 0 : Arrays.hashCode( parameterTypes ) );
442-
result = prime * result + ( ( parent == null ) ? 0 : parent.hashCode() );
443442
result = prime * result + ( ( containerClass == null ) ? 0 : containerClass.hashCode() );
444443
result = prime * result + ( ( typeArgumentIndex == null ) ? 0 : typeArgumentIndex.hashCode() );
445444
return result;
@@ -528,14 +527,6 @@ else if ( !parameterIndex.equals( other.parameterIndex ) ) {
528527
else if ( !Arrays.equals( parameterTypes, other.parameterTypes ) ) {
529528
return false;
530529
}
531-
if ( parent == null ) {
532-
if ( other.parent != null ) {
533-
return false;
534-
}
535-
}
536-
else if ( !parent.equals( other.parent ) ) {
537-
return false;
538-
}
539530
return true;
540531
}
541532
}

0 commit comments

Comments
 (0)