jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William L Thomson Jr (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-1333) Cannot compile jclouds with Guava 21+
Date Fri, 16 Feb 2018 03:55:00 GMT

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

William L Thomson Jr commented on JCLOUDS-1333:
-----------------------------------------------

I am presently working on this. I can submit a PR once done. Other than this issue the rest
of the changes are pretty minor. I also have some minor updates for lastest gson, 2.8.2. Working
with lastest guava as well, 24.0.

FYI, I am not sure about this changing in 9+. I am on 9.0.4, also tested under ea10+42, need
to update to 43 but nothing special in changes that would make this any different.

I am mostly trying to understand how this worked. Seems compose has always taken 1 argument.
I cannot find where it has ever taken 2. Trying to figure out how to combine the 2 arguments
into the single variable wanted.
https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html#compose-java.util.function.Function-
https://docs.oracle.com/javase/9/docs/api/java/util/function/Function.html#compose-java.util.function.Function-

I feel like I have been here before. The only contributions I have made to JClouds where the
last commits to this file...
https://github.com/jclouds/jclouds/commits/master/core/src/main/java/org/jclouds/rest/internal/TransformerForRequest.java

But it did build before under 1.8.
https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-java/jclouds-core

Why is it always this class that is a pain in my well you know it rhymes...

> Cannot compile jclouds with Guava 21+
> -------------------------------------
>
>                 Key: JCLOUDS-1333
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1333
>             Project: jclouds
>          Issue Type: Improvement
>          Components: jclouds-core
>    Affects Versions: 2.1.0
>            Reporter: Andrew Gaul
>            Priority: Major
>              Labels: guava
>
> jclouds has compatibility with Guava 18-22 but we cannot compile using 21+ due to some
kind of Guava vs Java 8 Function class type error:
> {noformat}
> /home/gaul/work/jclouds/core/src/main/java/org/jclouds/rest/internal/TransformerForRequest.java:102:
error: method compose in interface java.util.function.Function<T,R> cannot be applied
to given types;
>          transformer = compose(Function.class.cast(wrappingTransformer), transformer);
>                        ^
>   required: java.util.function.Function<? super V,? extends HttpRequest>
>   found:    com.google.common.base.Function,com.google.common.base.Function<HttpResponse,CAP#1>
>   reason: cannot infer type-variable(s) V
>     (actual and formal argument lists differ in length)
>   where V,T,R are type-variables:
>     V extends Object declared in method <V>compose(java.util.function.Function<?
super V,? extends T>)
>     T extends Object declared in interface java.util.function.Function
>     R extends Object declared in interface java.util.function.Function
>   where CAP#1 is a fresh type-variable:
>     CAP#1 extends Object from capture of ?
> /home/gaul/work/jclouds/core/src/main/java/org/jclouds/rest/internal/TransformerForRequest.java:189:
error: method compose in interface java.util.function.Function<T,R> cannot be applied
to given types;
>             transformer = compose(new OnlyElementOrNull(), transformer);
>                           ^
>   required: java.util.function.Function<? super V,? extends HttpRequest>
>   found:    OnlyElementOrNull,com.google.common.base.Function<HttpResponse,CAP#1>
>   reason: cannot infer type-variable(s) V
>     (actual and formal argument lists differ in length)
>   where V,T,R are type-variables:
>     V extends Object declared in method <V>compose(java.util.function.Function<?
super V,? extends T>)
>     T extends Object declared in interface java.util.function.Function
>     R extends Object declared in interface java.util.function.Function
>   where CAP#1 is a fresh type-variable:
>     CAP#1 extends Object from capture of ?
> {noformat}
> This does not affect applications from using Guava 21-22 but does impact our compatibility
testing.  Note that you need to set {{maven.compile.source}} to 1.8 to test Guava 21+.



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

Mime
View raw message