File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
httpcore5/src/main/java/org/apache/hc/core5/concurrent Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 26
26
*/
27
27
package org .apache .hc .core5 .concurrent ;
28
28
29
+ import java .util .Objects ;
30
+
29
31
/**
30
32
* Convenience base class for {@link FutureCallback}s that contribute a result
31
33
* of the operation to another {@link BasicFuture}.
@@ -40,24 +42,20 @@ public abstract class FutureContribution<T> implements FutureCallback<T> {
40
42
/**
41
43
* Constructs a new instance to callback the given {@link BasicFuture}.
42
44
*
43
- * @param future The callback.
45
+ * @param future The callback, non-null .
44
46
*/
45
47
public FutureContribution (final BasicFuture <?> future ) {
46
- this .future = future ;
48
+ this .future = Objects . requireNonNull ( future ) ;
47
49
}
48
50
49
51
@ Override
50
52
public final void failed (final Exception ex ) {
51
- if (future != null ) {
52
- future .failed (ex );
53
- }
53
+ future .failed (ex );
54
54
}
55
55
56
56
@ Override
57
57
public final void cancelled () {
58
- if (future != null ) {
59
- future .cancel ();
60
- }
58
+ future .cancel ();
61
59
}
62
60
63
61
@ SuppressWarnings ("unchecked" )
You can’t perform that action at this time.
0 commit comments