Aggregates#lookup method uses wrong generic type parameter for Variable

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.9.0
    • Affects Version/s: None
    • Component/s: API, Builders
    • None
    • None
    • Minor Change
    • None
    • None
    • None
    • None
    • None
    • None

      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)
      

            Assignee:
            Jeffrey Yemin
            Reporter:
            Jeffrey Yemin
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: