PubSub Awkward implementation of SubscriptionName::equals #1928
Labels
api: pubsub
Issues related to the Pub/Sub API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
Steps to reproduce
Code example
Any additional information below
I'd imagine
if (o != null || getClass() == o.getClass()) {
https://github.com/googleapis/java-pubsub/blob/main/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionName.java#L140
Should be replaced with
if (o != null && getClass() == o.getClass()) {
Though not an explicit breach of Object.equals' contract, I wouldn't expect any Object.equals override to throw an exception.
The text was updated successfully, but these errors were encountered: