@@ -129,7 +129,7 @@ public T getNow(T valueIfAbsent) {
129129 return completionStage .getNow (valueIfAbsent );
130130 }
131131
132- public T getNow (Supplier <T > valueIfAbsent ) {
132+ public T getNow (Supplier <? extends T > valueIfAbsent ) {
133133 return completionStage .getNow (valueIfAbsent );
134134 }
135135
@@ -203,31 +203,31 @@ public DependentPromise<T> onTimeout(T value, Duration duration, boolean cancelO
203203 return onTimeout (() -> value , duration , enlistOrigin );
204204 }
205205
206- public DependentPromise <T > onTimeout (Supplier <T > supplier , long timeout , TimeUnit unit ) {
206+ public DependentPromise <T > onTimeout (Supplier <? extends T > supplier , long timeout , TimeUnit unit ) {
207207 return onTimeout (supplier , timeout , unit , true );
208208 }
209209
210- public DependentPromise <T > onTimeout (Supplier <T > supplier , long timeout , TimeUnit unit , boolean cancelOnTimeout ) {
210+ public DependentPromise <T > onTimeout (Supplier <? extends T > supplier , long timeout , TimeUnit unit , boolean cancelOnTimeout ) {
211211 return onTimeout (supplier , Promises .toDuration (timeout , unit ), false );
212212 }
213213
214- public DependentPromise <T > onTimeout (Supplier <T > supplier , long timeout , TimeUnit unit , boolean cancelOnTimeout , boolean enlistOrigin ) {
214+ public DependentPromise <T > onTimeout (Supplier <? extends T > supplier , long timeout , TimeUnit unit , boolean cancelOnTimeout , boolean enlistOrigin ) {
215215 return onTimeout (supplier , Promises .toDuration (timeout , unit ), enlistOrigin );
216216 }
217217
218- public DependentPromise <T > onTimeout (Supplier <T > supplier , Duration duration ) {
218+ public DependentPromise <T > onTimeout (Supplier <? extends T > supplier , Duration duration ) {
219219 return onTimeout (supplier , duration , true );
220220 }
221221
222- public DependentPromise <T > onTimeout (Supplier <T > supplier , Duration duration , boolean cancelOnTimeout ) {
222+ public DependentPromise <T > onTimeout (Supplier <? extends T > supplier , Duration duration , boolean cancelOnTimeout ) {
223223 return onTimeout (supplier , duration , cancelOnTimeout , false );
224224 }
225225
226- public DependentPromise <T > onTimeout (Supplier <T > supplier , Duration duration , boolean cancelOnTimeout , boolean enlistOrigin ) {
227- Function <T , Supplier <T >> valueToSupplier = v -> () -> v ;
226+ public DependentPromise <T > onTimeout (Supplier <? extends T > supplier , Duration duration , boolean cancelOnTimeout , boolean enlistOrigin ) {
227+ Function <T , Supplier <? extends T >> valueToSupplier = v -> () -> v ;
228228
229229 // timeout converted to supplier
230- Promise <Supplier <T >> onTimeout = Promises
230+ Promise <Supplier <? extends T >> onTimeout = Promises
231231 .delay (duration )
232232 .dependent ()
233233 .thenApply (d -> supplier , true );
0 commit comments