Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-502

Generic parameter inconsistency on various INSTANCE fields

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: Functor
    • Labels:
      None

      Description

      In FalsePredicate the INSTANCE singleton is defined as Predicate<Object>. In other predicates such as TruePredicate it's
      defined as Predicate<?>. In both cases this prevents the declaration of:

      Predicate<Foo> predicate = FalsePredicate.INSTANCE;
      

      This will fail to compile.

      I suggest declaring the INSTANCE fields as an ungenerified Predicate, such that the above example compiles with an unchecked warning.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ebourg Emmanuel Bourg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: