kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | eb74149ffde994cde4aadabe5f4d25e43b64438fd3711e762d877635d3afa7da |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2016-12-09 17:54 -06:00 |
| Committer | Olivier Michallat <olim7t@users.noreply.github.com> · 2016-12-09 15:54 -08:00 |
| Parents | 37a0d01b83e2 |
3 files changed
modified changelog/README.md +1 −0
| @@ -3,6 +3,7 @@ | ||
| 3 | 3 | ### 3.0.6 (in progress) |
| 4 | 4 | |
| 5 | 5 | - [bug] JAVA-1330: Add un/register for SchemaChangeListener in DelegatingCluster |
| 6 | +- [bug] JAVA-1351: Include Custom Payload in Request.copy. | |
| 6 | 7 | |
| 7 | 8 | |
| 8 | 9 | ### 3.0.5 |
modified driver-core/src/main/java/com/datastax/driver/core/Message.java +13 −1
| @@ -180,9 +180,21 @@ | ||
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - abstract Request copy(); | |
| 183 | + Request copy() { | |
| 184 | + Request request = copyInternal(); | |
| 185 | + request.setCustomPayload(this.getCustomPayload()); | |
| 186 | + return request; | |
| 187 | + } | |
| 188 | + | |
| 189 | + protected abstract Request copyInternal(); | |
| 184 | 190 | |
| 185 | 191 | Request copy(ConsistencyLevel newConsistencyLevel) { |
| 192 | + Request request = copyInternal(newConsistencyLevel); | |
| 193 | + request.setCustomPayload(this.getCustomPayload()); | |
| 194 | + return request; | |
| 195 | + } | |
| 196 | + | |
| 197 | + protected Request copyInternal(ConsistencyLevel newConsistencyLevel) { | |
| 186 | 198 | throw new UnsupportedOperationException(); |
| 187 | 199 | } |
| 188 | 200 | } |
modified driver-core/src/main/java/com/datastax/driver/core/Requests.java +12 −12
| @@ -63,7 +63,7 @@ | ||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | @Override |
| 66 | - Request copy() { | |
| 66 | + protected Request copyInternal() { | |
| 67 | 67 | return new Startup(compression); |
| 68 | 68 | } |
| 69 | 69 | |
| @@ -99,7 +99,7 @@ | ||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | @Override |
| 102 | - Request copy() { | |
| 102 | + protected Request copyInternal() { | |
| 103 | 103 | return new Credentials(credentials); |
| 104 | 104 | } |
| 105 | 105 | } |
| @@ -122,7 +122,7 @@ | ||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | @Override |
| 125 | - Request copy() { | |
| 125 | + protected Request copyInternal() { | |
| 126 | 126 | return new Options(); |
| 127 | 127 | } |
| 128 | 128 | |
| @@ -162,12 +162,12 @@ | ||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | @Override |
| 165 | - Request copy() { | |
| 165 | + protected Request copyInternal() { | |
| 166 | 166 | return new Query(this.query, options, isTracingRequested()); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | @Override |
| 170 | - Request copy(ConsistencyLevel newConsistencyLevel) { | |
| 170 | + protected Request copyInternal(ConsistencyLevel newConsistencyLevel) { | |
| 171 | 171 | return new Query(this.query, options.copy(newConsistencyLevel), isTracingRequested()); |
| 172 | 172 | } |
| 173 | 173 | |
| @@ -203,12 +203,12 @@ | ||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | @Override |
| 206 | - Request copy() { | |
| 206 | + protected Request copyInternal() { | |
| 207 | 207 | return new Execute(statementId, options, isTracingRequested()); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | @Override |
| 211 | - Request copy(ConsistencyLevel newConsistencyLevel) { | |
| 211 | + protected Request copyInternal(ConsistencyLevel newConsistencyLevel) { | |
| 212 | 212 | return new Execute(statementId, options.copy(newConsistencyLevel), isTracingRequested()); |
| 213 | 213 | } |
| 214 | 214 | |
| @@ -460,12 +460,12 @@ | ||
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | @Override |
| 463 | - Request copy() { | |
| 463 | + protected Request copyInternal() { | |
| 464 | 464 | return new Batch(type, queryOrIdList, values, options, isTracingRequested()); |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | @Override |
| 468 | - Request copy(ConsistencyLevel newConsistencyLevel) { | |
| 468 | + protected Request copyInternal(ConsistencyLevel newConsistencyLevel) { | |
| 469 | 469 | return new Batch(type, queryOrIdList, values, options.copy(newConsistencyLevel), isTracingRequested()); |
| 470 | 470 | } |
| 471 | 471 | |
| @@ -571,7 +571,7 @@ | ||
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | @Override |
| 574 | - Request copy() { | |
| 574 | + protected Request copyInternal() { | |
| 575 | 575 | return new Prepare(query); |
| 576 | 576 | } |
| 577 | 577 | |
| @@ -608,7 +608,7 @@ | ||
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | @Override |
| 611 | - Request copy() { | |
| 611 | + protected Request copyInternal() { | |
| 612 | 612 | return new Register(eventTypes); |
| 613 | 613 | } |
| 614 | 614 | |
| @@ -641,7 +641,7 @@ | ||
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | @Override |
| 644 | - Request copy() { | |
| 644 | + protected Request copyInternal() { | |
| 645 | 645 | return new AuthResponse(token); |
| 646 | 646 | } |
| 647 | 647 | } |