Skip to content

Commit 66fd092

Browse files
committed
minor cleanup
1 parent bcdd51b commit 66fd092

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

hibernate-core/src/main/java/org/hibernate/query/internal/QueryParameterNamedImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ public boolean equals(Object o) {
6060
if ( this == o ) {
6161
return true;
6262
}
63-
else if ( o == null ) {
64-
return false;
65-
}
6663
else if ( !(o instanceof QueryParameterNamedImpl<?> that) ) {
6764
return false;
6865
}

hibernate-core/src/main/java/org/hibernate/query/internal/QueryParameterPositionalImpl.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,20 @@ public Integer getPosition() {
6161

6262
@Override
6363
public NamedQueryMemento.ParameterMemento toMemento() {
64-
return session -> new QueryParameterPositionalImpl( getPosition(), allowsMultiValuedBinding(), getHibernateType() );
64+
return session -> new QueryParameterPositionalImpl<>( getPosition(), allowsMultiValuedBinding(), getHibernateType() );
6565
}
6666

6767
@Override
68-
public boolean equals(Object o) {
69-
if ( this == o ) {
68+
public boolean equals(Object object) {
69+
if ( this == object ) {
7070
return true;
7171
}
72-
if ( o == null || getClass() != o.getClass() ) {
72+
else if ( !(object instanceof QueryParameterPositionalImpl<?> that) ) {
7373
return false;
7474
}
75-
QueryParameterPositionalImpl<?> that = (QueryParameterPositionalImpl<?>) o;
76-
return position == that.position;
75+
else {
76+
return position == that.position;
77+
}
7778
}
7879

7980
@Override

0 commit comments

Comments
 (0)