Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1333

Cannot compile jclouds with Guava 21+

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.3.0
    • Component/s: jclouds-core
    • Labels:

      Description

      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:

      /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 ?
      

      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+.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              gaul Andrew Gaul
              Reporter:
              gaul Andrew Gaul

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h 40m
                3h 40m

                  Issue deployment