@@ -401,6 +401,7 @@ public void listen(
401
401
}
402
402
403
403
@ Override
404
+ @ SuppressWarnings ("FutureReturnValueIgnored" )
404
405
public Task <Object > get (List <String > path , Map <String , Object > queryParams ) {
405
406
QuerySpec query = new QuerySpec (path , queryParams );
406
407
TaskCompletionSource <Object > source = new TaskCompletionSource <>();
@@ -415,36 +416,29 @@ public Task<Object> get(List<String> path, Map<String, Object> queryParams) {
415
416
new OutstandingGet (
416
417
REQUEST_ACTION_GET ,
417
418
request ,
418
- new ConnectionRequestCallback () {
419
- @ Override
420
- public void onResponse (Map <String , Object > response ) {
421
- String status = (String ) response .get (REQUEST_STATUS );
422
- if (status .equals ("ok" )) {
423
- Object body = response .get (SERVER_DATA_UPDATE_BODY );
424
- delegate .onDataUpdate (query .path , body , /*isMerge=*/ false , /*tagNumber=*/ null );
425
- source .setResult (body );
426
- } else {
427
- source .setException (
428
- new Exception ((String ) response .get (SERVER_DATA_UPDATE_BODY )));
429
- }
419
+ response -> {
420
+ String status = (String ) response .get (REQUEST_STATUS );
421
+ if (status .equals ("ok" )) {
422
+ Object body = response .get (SERVER_DATA_UPDATE_BODY );
423
+ delegate .onDataUpdate (query .path , body , /*isMerge=*/ false , /*tagNumber=*/ null );
424
+ source .setResult (body );
425
+ } else {
426
+ source .setException (new Exception ((String ) response .get (SERVER_DATA_UPDATE_BODY )));
430
427
}
431
428
});
432
429
outstandingGets .put (readId , outstandingGet );
433
430
434
431
if (!connected ()) {
435
432
executorService .schedule (
436
- new Runnable () {
437
- @ Override
438
- public void run () {
439
- if (!outstandingGet .markSent ()) {
440
- return ;
441
- }
442
- if (logger .logsDebug ()) {
443
- logger .debug ("get " + readId + " timed out waiting for connection" );
444
- }
445
- outstandingGets .remove (readId );
446
- source .setException (new Exception ("Client is offline" ));
433
+ () -> {
434
+ if (!outstandingGet .markSent ()) {
435
+ return ;
436
+ }
437
+ if (logger .logsDebug ()) {
438
+ logger .debug ("get " + readId + " timed out waiting for connection" );
447
439
}
440
+ outstandingGets .remove (readId );
441
+ source .setException (new Exception ("Client is offline" ));
448
442
},
449
443
GET_CONNECT_TIMEOUT ,
450
444
TimeUnit .MILLISECONDS );
0 commit comments