Elffuss BraidHub

kikocis/java-driver public

Merge pull request #462 from datastax/java929

JAVA-929 Fix equals method for index_interval columns.
Changeset6c83957faf4c0c30fd337453df3fbb5416b74aef724e3897a9c067bb1b651978
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2015-09-29 15:48 -07:00
CommitterOlivier Michallat <olim7t@users.noreply.github.com> · 2015-09-29 15:48 -07:00
Parentse0c6a4e0504f, c07d4751c7dd

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java +8 −2
@@ -842,7 +842,11 @@
842842 return false;
843843 if (defaultTTL != options.defaultTTL)
844844 return false;
845- if (indexInterval != options.indexInterval)
845+ if (indexInterval != null ? !indexInterval.equals(options.indexInterval) : options.indexInterval != null)
846+ return false;
847+ if (minIndexInterval != null ? !minIndexInterval.equals(options.minIndexInterval) : options.minIndexInterval != null)
848+ return false;
849+ if (maxIndexInterval != null ? !maxIndexInterval.equals(options.maxIndexInterval) : options.maxIndexInterval != null)
846850 return false;
847851 if (comment != null ? !comment.equals(options.comment) : options.comment != null)
848852 return false;
@@ -875,7 +879,9 @@
875879 result = 31 * result + memtableFlushPeriodMs;
876880 result = 31 * result + defaultTTL;
877881 result = 31 * result + (speculativeRetry != null ? speculativeRetry.hashCode() : 0);
878- result = 31 * result + indexInterval;
882+ result = 31 * result + (indexInterval != null ? indexInterval.hashCode() : 0);
883+ result = 31 * result + (minIndexInterval != null ? minIndexInterval.hashCode() : 0);
884+ result = 31 * result + (maxIndexInterval != null ? maxIndexInterval.hashCode() : 0);
879885 result = 31 * result + (compaction != null ? compaction.hashCode() : 0);
880886 result = 31 * result + (compression != null ? compression.hashCode() : 0);
881887 return result;