Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2936

Aggregates#lookup method uses wrong generic type parameter for Variable

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.9.0
    • None
    • API, Builders
    • None
    • Minor Change

    Description

      The current signature for one of the overloads of Aggregates#lookup is:

      public static Bson lookup(final String from,
                                              @Nullable final List<Variable<?>> let, 
                                              final List<? extends Bson> pipeline,
                                              final String as)
      

      But the "let" parameter type is incorrect. Using a wildcard for the generic type of Variable effectively means that you can only pass a null list for this parameter.

      The method should instead be defined as

      public static <TExpression> 
                          Bson lookup(final String from,
                                              @Nullable final List<Variable<TExpression>> let, 
                                              final List<? extends Bson> pipeline,
                                              final String as)
      

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: