RFR: 8223553: Fix code constructs that do not compile with the Eclipse Java Compiler

Daniel Fuchs daniel.fuchs at oracle.com
Mon May 13 09:34:02 UTC 2019


Hi Christoph,

On 13/05/2019 08:29, Langer, Christoph wrote:
> Hi Daniel,
> 
> unfortunately, your proposed solution does not work with javac. I get this in the build:

Oh darn. I should have double checked.
Can we at least reduce the scope of the @SuppressedWarnings by
introducing a private method that just has the return call?

best regards,

-- daniel


> 
> ...\mercurial\jdk\src\java.net.http\share\classes\jdk\internal\net\http\ExchangeImpl.java:103: error: method thenCompose in class CompletableFuture<T> cannot be applied to given types;
>              return c2f.handle(factory).thenCompose(identity);
>                                        ^
>    required: Function<? super CompletableFuture<? extends ExchangeImpl<U#1>>,? extends CompletionStage<U#2>>
>    found:    Function<CompletableFuture<? extends ExchangeImpl<U#1>>,CompletableFuture<? extends ExchangeImpl<U#1>>>
>    reason: cannot infer type-variable(s) U#2
>      (argument mismatch; Function<CompletableFuture<? extends ExchangeImpl<U#1>>,CompletableFuture<? extends ExchangeImpl<U#1>>> cannot be converted to Function<? super CompletableFuture<? extends ExchangeImpl<U#1>>,? extends CompletionStage<U#2>>)
>    where U#1,U#2,T are type-variables:
>      U#1 extends Object declared in method <U#1>get(Exchange<U#1>,HttpConnection)
>      U#2 extends Object declared in method <U#2>thenCompose(Function<? super T,? extends CompletionStage<U#2>>)
>      T extends Object declared in class CompletableFuture
> 1 error
> 
> So I think we need to go back to my initial proposal which works for both, IDE and javac:http://cr.openjdk.java.net/~clanger/webrevs/8223553.0/  
> 
> Thanks
> Christoph



More information about the net-dev mailing list