@@ -216,15 +216,15 @@ public AppiumFluentWait<T> withPollingStrategy(Function<IterationInfo, Duration>
216
216
*/
217
217
@ Override
218
218
public <V > V until (Function <? super T , V > isTrue ) {
219
- final Instant start = getClock ().instant ();
219
+ final var start = getClock ().instant ();
220
220
// Adding pollDelay to end instant will allow to verify the condition for the expected timeout duration.
221
- final Instant end = start .plus (getTimeout ()).plus (pollDelay );
221
+ final var end = start .plus (getTimeout ()).plus (pollDelay );
222
222
223
223
return performIteration (isTrue , start , end );
224
224
}
225
225
226
226
private <V > V performIteration (Function <? super T , V > isTrue , Instant start , Instant end ) {
227
- long iterationNumber = 1 ;
227
+ var iterationNumber = 1 ;
228
228
Throwable lastException ;
229
229
230
230
sleepInterruptibly (pollDelay );
@@ -250,19 +250,19 @@ private <V> V performIteration(Function<? super T, V> isTrue, Instant start, Ins
250
250
handleTimeoutException (lastException , isTrue );
251
251
}
252
252
253
- Duration interval = getIntervalWithPollingStrategy (start , iterationNumber );
253
+ var interval = getIntervalWithPollingStrategy (start , iterationNumber );
254
254
sleepInterruptibly (interval );
255
255
256
256
++iterationNumber ;
257
257
}
258
258
}
259
259
260
260
private <V > void handleTimeoutException (Throwable lastException , Function <? super T , V > isTrue ) {
261
- String message = Optional .ofNullable (getMessageSupplier ())
261
+ var message = Optional .ofNullable (getMessageSupplier ())
262
262
.map (Supplier ::get )
263
263
.orElseGet (() -> "waiting for " + isTrue );
264
264
265
- String timeoutMessage = String .format (
265
+ var timeoutMessage = String .format (
266
266
"Expected condition failed: %s (tried for %s millis with an interval of %s millis)" ,
267
267
message ,
268
268
getTimeout ().toMillis (),
@@ -273,10 +273,10 @@ private <V> void handleTimeoutException(Throwable lastException, Function<? supe
273
273
}
274
274
275
275
private Duration getIntervalWithPollingStrategy (Instant start , long iterationNumber ) {
276
- Duration interval = getInterval ();
276
+ var interval = getInterval ();
277
277
return Optional .ofNullable (pollingStrategy )
278
278
.map (strategy -> {
279
- final IterationInfo info = new IterationInfo (
279
+ final var info = new IterationInfo (
280
280
iterationNumber ,
281
281
Duration .between (start , getClock ().instant ()), getTimeout (), interval );
282
282
return strategy .apply (info );
0 commit comments