kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 8e4ed2ba40a73b7f08bbb72c18f1651febf9d3a1f2812a4c37d159d122b71774 |
|---|---|
| Author | Alexandre Dutra <adutra@users.noreply.github.com> · 2016-04-08 18:12 +02:00 |
| Committer | Alexandre Dutra <adutra@users.noreply.github.com> · 2016-04-08 18:12 +02:00 |
| Parents | 7853953cb7e6, 4d70731b99d5 |
2 files changed
modified changelog/README.md +2 −1
| @@ -2,7 +2,8 @@ | ||
| 2 | 2 | |
| 3 | 3 | ### 2.1.10.1 (in progress) |
| 4 | 4 | |
| 5 | -[bug] JAVA-1152: Fix NPE at ControlConnection.refreshNodeListAndTokenMap(). | |
| 5 | +- [bug] JAVA-1152: Fix NPE at ControlConnection.refreshNodeListAndTokenMap(). | |
| 6 | +- [bug] JAVA-1156: Fix NPE at TableMetadata.equals(). | |
| 6 | 7 | |
| 7 | 8 | |
| 8 | 9 | ### 2.1.10 |
modified driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java +11 −28
| @@ -15,6 +15,7 @@ | ||
| 15 | 15 | */ |
| 16 | 16 | package com.datastax.driver.core; |
| 17 | 17 | |
| 18 | +import com.google.common.base.Objects; | |
| 18 | 19 | import com.google.common.base.Predicate; |
| 19 | 20 | import com.google.common.collect.ImmutableMap; |
| 20 | 21 | import com.google.common.collect.Iterables; |
| @@ -394,39 +395,21 @@ | ||
| 394 | 395 | |
| 395 | 396 | @Override |
| 396 | 397 | public boolean equals(Object o) { |
| 397 | - if (this == o) | |
| 398 | - return true; | |
| 399 | - if (o == null || getClass() != o.getClass()) | |
| 400 | - return false; | |
| 401 | - | |
| 398 | + if (this == o) return true; | |
| 399 | + if (o == null || getClass() != o.getClass()) return false; | |
| 402 | 400 | TableMetadata that = (TableMetadata) o; |
| 403 | - | |
| 404 | - if (!name.equals(that.name)) | |
| 405 | - return false; | |
| 406 | - if (!partitionKey.equals(that.partitionKey)) | |
| 407 | - return false; | |
| 408 | - if (!clusteringColumns.equals(that.clusteringColumns)) | |
| 409 | - return false; | |
| 410 | - if (!columns.equals(that.columns)) | |
| 411 | - return false; | |
| 412 | - if (!options.equals(that.options)) | |
| 413 | - return false; | |
| 414 | - if (!clusteringOrder.equals(that.clusteringOrder)) | |
| 415 | - return false; | |
| 416 | - return cassandraVersion.equals(that.cassandraVersion); | |
| 417 | - | |
| 401 | + return Objects.equal(name, that.name) && | |
| 402 | + Objects.equal(partitionKey, that.partitionKey) && | |
| 403 | + Objects.equal(clusteringColumns, that.clusteringColumns) && | |
| 404 | + Objects.equal(columns, that.columns) && | |
| 405 | + Objects.equal(options, that.options) && | |
| 406 | + Objects.equal(clusteringOrder, that.clusteringOrder) && | |
| 407 | + Objects.equal(cassandraVersion, that.cassandraVersion); | |
| 418 | 408 | } |
| 419 | 409 | |
| 420 | 410 | @Override |
| 421 | 411 | public int hashCode() { |
| 422 | - int result = name.hashCode(); | |
| 423 | - result = 31 * result + partitionKey.hashCode(); | |
| 424 | - result = 31 * result + clusteringColumns.hashCode(); | |
| 425 | - result = 31 * result + columns.hashCode(); | |
| 426 | - result = 31 * result + options.hashCode(); | |
| 427 | - result = 31 * result + clusteringOrder.hashCode(); | |
| 428 | - result = 31 * result + cassandraVersion.hashCode(); | |
| 429 | - return result; | |
| 412 | + return Objects.hashCode(name, partitionKey, clusteringColumns, columns, options, clusteringOrder, cassandraVersion); | |
| 430 | 413 | } |
| 431 | 414 | |
| 432 | 415 | private String asCQLQuery(boolean formatted) { |