Skip to content

Commit

Permalink
Fixed circular hashCode/equals calls
Browse files Browse the repository at this point in the history
  • Loading branch information
svettwer committed Feb 15, 2019
1 parent 38777f8 commit 935edb6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ public final boolean equals(final Object o) {
Objects.equals(parameters, that.parameters)&&
Objects.equals(httpClient, that.httpClient) &&
Objects.equals(serverUrl, that.serverUrl) &&
Objects.equals(connection, that.connection) &&
Objects.equals(resultSet, that.resultSet);
Objects.equals(connection, that.connection);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,12 @@ public boolean equals(final Object o) {
final JdbcStatement that = (JdbcStatement) o;
return Objects.equals(httpClient, that.httpClient) &&
Objects.equals(serverUrl, that.serverUrl) &&
Objects.equals(connection, that.connection) &&
Objects.equals(resultSet, that.resultSet);
Objects.equals(connection, that.connection);
}

@Override
public int hashCode() {
return Objects.hash(httpClient, serverUrl, connection, resultSet);
return Objects.hash(httpClient, serverUrl, connection);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ public void equalsContract(){
new JdbcResultSet(mock(DataSet.class), mock(JdbcStatement.class)),
new JdbcResultSet(mock(DataSet.class), mock(JdbcStatement.class)))
.suppress(Warning.NONFINAL_FIELDS)
.withIgnoredFields("resultSet")
.verify();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void equalsContract(){
new JdbcResultSet(PowerMockito.mock(DataSet.class), PowerMockito.mock(JdbcStatement.class)))
.withRedefinedSuperclass()
.suppress(Warning.NONFINAL_FIELDS)
.withIgnoredFields("resultSet")
.verify();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ public void equalsContract(){
new JdbcResultSet(PowerMockito.mock(DataSet.class), PowerMockito.mock(JdbcStatement.class)))
.withRedefinedSubclass(JdbcPreparedStatement.class)
.suppress(Warning.NONFINAL_FIELDS)
.withIgnoredFields("resultSet")
.verify();
}
}

0 comments on commit 935edb6

Please sign in to comment.