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

Generic parameter inconsistency on various INSTANCE fields

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.0
    • 4.0
    • Functor
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: