[ 
https://issues.apache.org/jira/browse/FLINK-10234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16625602#comment-16625602
 ] 

ASF GitHub Bot commented on FLINK-10234:
----------------------------------------

zentol closed pull request #6652: [FLINK-10234][runtime] Fix ambiguous lambda 
usage
URL: https://github.com/apache/flink/pull/6652
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
index d4a65dec8f6..41effc1fb88 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
@@ -200,7 +200,7 @@
                                                } else {
                                                        if (retries > 0 && 
retryPredicate.test(throwable)) {
                                                                final 
ScheduledFuture<?> scheduledFuture = scheduledExecutor.schedule(
-                                                                       () -> 
retryOperationWithDelay(resultFuture, operation, retries - 1, retryDelay, 
retryPredicate, scheduledExecutor),
+                                                                       
(Runnable) () -> retryOperationWithDelay(resultFuture, operation, retries - 1, 
retryDelay, retryPredicate, scheduledExecutor),
                                                                        
retryDelay.toMilliseconds(),
                                                                        
TimeUnit.MILLISECONDS);
 
@@ -282,7 +282,7 @@
                                                        
resultFuture.complete(t);
                                                } else if 
(deadline.hasTimeLeft()) {
                                                        final 
ScheduledFuture<?> scheduledFuture = scheduledExecutor.schedule(
-                                                               () -> 
retrySuccessfulOperationWithDelay(resultFuture, operation, retryDelay, 
deadline, acceptancePredicate, scheduledExecutor),
+                                                               (Runnable) () 
-> retrySuccessfulOperationWithDelay(resultFuture, operation, retryDelay, 
deadline, acceptancePredicate, scheduledExecutor),
                                                                
retryDelay.toMilliseconds(),
                                                                
TimeUnit.MILLISECONDS);
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Lambda usage in FutureUtils is ambigouos with Java 9
> ----------------------------------------------------
>
>                 Key: FLINK-10234
>                 URL: https://issues.apache.org/jira/browse/FLINK-10234
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Core
>    Affects Versions: 1.7.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>
> In {{FutureUtils}} the following code doesn't compile with java 9:
> {code}
> ... = scheduledExecutor.schedule(
>       () -> retryOperationWithDelay(resultFuture, operation, retries - 1, 
> retryDelay,
>       ...,
>       ...,
>       ...);
> {code}
> The reason is that the compiler cannot determine whether the lambda should be 
> a {{Runnable}} or a {{Callable<V>}}, resulting in incompatible bounds for the 
> return type.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to