googleapis / googleapis/google-cloud-java

[java-spanner] test: OptionsTest checks for fixed values being returned from hashCode()

Open
#12,268 1 comment 0 reactions 0 assignees View on GitHub
api: spanner good first issue help wanted type: cleanup
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

The `Options#hashCode()` method does not guarantee to return a fixed value that is equal on all JVM's (at least; the documentation does not guarantee it). In reality it does, because the current implementation only uses hash codes that are guaranteed to be equal on all JVM's. The method should either be documented to have this behavior, or these tests should be replaced with tests that assert that the `hashCode` and `equals` methods comply with the general contract regarding these methods.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.