import com.google.pubsub.v1.SubscriptionName
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.shouldBe
class PubSub:WordSpec({
"equals" should{
"not except when compared to an object of another class"{
SubscriptionName.newBuilder().setSubscription("foo").setProject("bar").build().equals("foo") shouldBe false
}
}
})
Though not an explicit breach of Object.equals' contract, I wouldn't expect any Object.equals override to throw an exception.
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.