Skip to content

Commit ebaba54

Browse files
dk2kbeikov
authored andcommitted
HHH-18122 removed check of the arg type for private classes
1 parent 2b965f6 commit ebaba54

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

hibernate-core/src/main/java/org/hibernate/internal/util/collections/BoundedConcurrentHashMap.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ public int hashCode() {
225225

226226
@Override
227227
public boolean equals(Object o) {
228-
if (!(o instanceof HashEntry)) {
229-
return false;
230-
}
231228
// HashEntry is internal class, never leaks out of CHM, hence slight optimization
232229
if ( this == o ) {
233230
return true;
@@ -487,9 +484,6 @@ public int hashCode() {
487484

488485
@Override
489486
public boolean equals(Object o) {
490-
if (!(o instanceof LIRSHashEntry)) {
491-
return false;
492-
}
493487
// HashEntry is internal class, never leaks out of CHM, hence slight optimization
494488
if ( this == o ) {
495489
return true;

hibernate-core/src/main/java/org/hibernate/mapping/Table.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,13 +840,12 @@ public int hashCode() {
840840
}
841841

842842
public boolean equals(Object other) {
843-
if (!(other instanceof ForeignKeyKey)) {
843+
if ( !( other instanceof ForeignKeyKey ) ) {
844844
return false;
845845
}
846846
ForeignKeyKey fkk = (ForeignKeyKey) other;
847-
return fkk != null
848-
&& Arrays.equals( fkk.columns, columns )
849-
&& Arrays.equals( fkk.referencedColumns, referencedColumns );
847+
return Arrays.equals( fkk.columns, columns )
848+
&& Arrays.equals( fkk.referencedColumns, referencedColumns );
850849
}
851850

852851
@Override

hibernate-core/src/main/java/org/hibernate/spi/NavigablePath.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ public int hashCode() {
126126

127127
@Override
128128
public boolean equals(@Nullable Object other) {
129-
if (!(other instanceof NavigablePath)) {
130-
return false;
131-
}
132-
133129
if ( this == other ) {
134130
return true;
135131
}

hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,6 @@ public ArrayCacheKey(SqmExpressible<?>[] components) {
642642

643643
@Override
644644
public boolean equals(Object o) {
645-
if (!(o instanceof ArrayCacheKey)) {
646-
return false;
647-
}
648645
return Arrays.equals( components, ((ArrayCacheKey) o).components );
649646
}
650647

0 commit comments

Comments
 (0)