Elffuss BraidHub

kikocis/java-driver public

Improve equals for Metadata classes.
Changesetce9d16ecadced95a60b4057ba1330d4664c7092e47021ba541c7ecfdec690d44
Authorolim7t <omichallat+github@gmail.com> · 2015-09-17 21:48 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2015-09-17 21:48 +02:00
Parentsff0d4e2c4987

Browse the files at this changeset

2 files changed

modified driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java +3 −0
@@ -293,6 +293,9 @@
293293
294294 @Override
295295 public boolean equals(Object other) {
296+ if (other == this)
297+ return true;
298+
296299 if (other instanceof AggregateMetadata) {
297300 AggregateMetadata that = (AggregateMetadata)other;
298301 return this.keyspace.getName().equals(that.keyspace.getName()) &&
modified driver-core/src/main/java/com/datastax/driver/core/FunctionMetadata.java +3 −0
@@ -272,6 +272,9 @@
272272
273273 @Override
274274 public boolean equals(Object other) {
275+ if (other == this)
276+ return true;
277+
275278 if (other instanceof FunctionMetadata) {
276279 FunctionMetadata that = (FunctionMetadata)other;
277280 return this.keyspace.getName().equals(that.keyspace.getName()) &&