@@ -73,23 +73,18 @@ public final class NettyResponseFuture<V> extends AbstractListenableFuture<V> {
73
73
private volatile int inAuth = 0 ;
74
74
private volatile int inProxyAuth = 0 ;
75
75
private volatile int statusReceived = 0 ;
76
+ @ SuppressWarnings ("unused" )
76
77
private volatile int contentProcessed = 0 ;
78
+ @ SuppressWarnings ("unused" )
77
79
private volatile int onThrowableCalled = 0 ;
78
80
79
- private static final AtomicIntegerFieldUpdater <NettyResponseFuture > isDoneField =
80
- AtomicIntegerFieldUpdater .newUpdater (NettyResponseFuture .class , "isDone" );
81
- private static final AtomicIntegerFieldUpdater <NettyResponseFuture > isCancelledField =
82
- AtomicIntegerFieldUpdater .newUpdater (NettyResponseFuture .class , "isCancelled" );
83
- private static final AtomicIntegerFieldUpdater <NettyResponseFuture > inAuthField =
84
- AtomicIntegerFieldUpdater .newUpdater (NettyResponseFuture .class , "inAuth" );
85
- private static final AtomicIntegerFieldUpdater <NettyResponseFuture > inProxyAuthField =
86
- AtomicIntegerFieldUpdater .newUpdater (NettyResponseFuture .class , "inProxyAuth" );
87
- private static final AtomicIntegerFieldUpdater <NettyResponseFuture > statusReceivedField =
88
- AtomicIntegerFieldUpdater .newUpdater (NettyResponseFuture .class , "statusReceived" );
89
- private static final AtomicIntegerFieldUpdater <NettyResponseFuture > contentProcessedField =
90
- AtomicIntegerFieldUpdater .newUpdater (NettyResponseFuture .class , "contentProcessed" );
91
- private static final AtomicIntegerFieldUpdater <NettyResponseFuture > onThrowableCalledField =
92
- AtomicIntegerFieldUpdater .newUpdater (NettyResponseFuture .class , "onThrowableCalled" );
81
+ private static final AtomicIntegerFieldUpdater <NettyResponseFuture <?>> isDoneField = newAtomicIntegerFieldUpdater (NettyResponseFuture .class , "isDone" );
82
+ private static final AtomicIntegerFieldUpdater <NettyResponseFuture <?>> isCancelledField = newAtomicIntegerFieldUpdater (NettyResponseFuture .class , "isCancelled" );
83
+ private static final AtomicIntegerFieldUpdater <NettyResponseFuture <?>> inAuthField = newAtomicIntegerFieldUpdater (NettyResponseFuture .class , "inAuth" );
84
+ private static final AtomicIntegerFieldUpdater <NettyResponseFuture <?>> inProxyAuthField = newAtomicIntegerFieldUpdater (NettyResponseFuture .class , "inProxyAuth" );
85
+ private static final AtomicIntegerFieldUpdater <NettyResponseFuture <?>> statusReceivedField = newAtomicIntegerFieldUpdater (NettyResponseFuture .class , "statusReceived" );
86
+ private static final AtomicIntegerFieldUpdater <NettyResponseFuture <?>> contentProcessedField = newAtomicIntegerFieldUpdater (NettyResponseFuture .class , "contentProcessed" );
87
+ private static final AtomicIntegerFieldUpdater <NettyResponseFuture <?>> onThrowableCalledField = newAtomicIntegerFieldUpdater (NettyResponseFuture .class , "onThrowableCalled" );
93
88
94
89
// volatile where we need CAS ops
95
90
private volatile int redirectCount = 0 ;
@@ -109,7 +104,7 @@ public final class NettyResponseFuture<V> extends AbstractListenableFuture<V> {
109
104
private Request currentRequest ;
110
105
private NettyRequest nettyRequest ;
111
106
private AsyncHandler <V > asyncHandler ;
112
- private boolean streamWasAlreadyConsumed ;
107
+ private boolean streamAlreadyConsumed ;
113
108
private boolean reuseChannel ;
114
109
private boolean headersAlreadyWrittenOnContinue ;
115
110
private boolean dontWriteBodyBecauseExpectContinue ;
@@ -354,27 +349,27 @@ public TimeoutsHolder getTimeoutsHolder() {
354
349
return timeoutsHolder ;
355
350
}
356
351
357
- public boolean getInAuth () {
352
+ public boolean isInAuth () {
358
353
return inAuth != 0 ;
359
354
}
360
355
361
356
public void setInAuth (boolean inAuth ) {
362
357
this .inAuth = inAuth ? 1 : 0 ;
363
358
}
364
359
365
- public boolean getAndSetInAuth (boolean set ) {
360
+ public boolean isAndSetInAuth (boolean set ) {
366
361
return inAuthField .getAndSet (this , set ? 1 : 0 ) != 0 ;
367
362
}
368
363
369
- public boolean getInProxyAuth () {
364
+ public boolean isInProxyAuth () {
370
365
return inProxyAuth != 0 ;
371
366
}
372
367
373
368
public void setInProxyAuth (boolean inProxyAuth ) {
374
369
this .inProxyAuth = inProxyAuth ? 1 : 0 ;
375
370
}
376
371
377
- public boolean getAndSetInProxyAuth (boolean inProxyAuth ) {
372
+ public boolean isAndSetInProxyAuth (boolean inProxyAuth ) {
378
373
return inProxyAuthField .getAndSet (this , inProxyAuth ? 1 : 0 ) != 0 ;
379
374
}
380
375
@@ -386,16 +381,16 @@ public void setChannelState(ChannelState channelState) {
386
381
this .channelState = channelState ;
387
382
}
388
383
389
- public boolean getAndSetStatusReceived (boolean sr ) {
384
+ public boolean isAndSetStatusReceived (boolean sr ) {
390
385
return statusReceivedField .getAndSet (this , sr ? 1 : 0 ) != 0 ;
391
386
}
392
387
393
- public boolean isStreamWasAlreadyConsumed () {
394
- return streamWasAlreadyConsumed ;
388
+ public boolean isStreamConsumed () {
389
+ return streamAlreadyConsumed ;
395
390
}
396
391
397
- public void setStreamWasAlreadyConsumed (boolean streamWasAlreadyConsumed ) {
398
- this .streamWasAlreadyConsumed = streamWasAlreadyConsumed ;
392
+ public void setStreamConsumed (boolean streamConsumed ) {
393
+ this .streamAlreadyConsumed = streamConsumed ;
399
394
}
400
395
401
396
public long getLastTouch () {
@@ -445,7 +440,7 @@ public Channel channel() {
445
440
return channel ;
446
441
}
447
442
448
- public boolean reuseChannel () {
443
+ public boolean isReuseChannel () {
449
444
return reuseChannel ;
450
445
}
451
446
@@ -467,10 +462,8 @@ public void setCurrentRequest(Request currentRequest) {
467
462
*
468
463
* @return true if that {@link Future} cannot be recovered.
469
464
*/
470
- public boolean canBeReplayed () {
471
- return !isDone () && !(Channels .isChannelValid (channel ) && !getUri ().getScheme ().equalsIgnoreCase ("https" ))
472
- && inAuth == 0
473
- && inProxyAuth == 0 ;
465
+ public boolean isReplayPossible () {
466
+ return !isDone () && !(Channels .isChannelValid (channel ) && !getUri ().getScheme ().equalsIgnoreCase ("https" )) && inAuth == 0 && inProxyAuth == 0 ;
474
467
}
475
468
476
469
public long getStart () {
0 commit comments