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

*Utils classes should not be extensible or able to be instantiated.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 3.2
    • None
    • None
    • None

    Description

      I don't see any good reason why this CollectionUtils (and others) isn't final with a private constructor. There are no non-static methods, and any extension of them is going to have to call through to the super to avoid compiler warnings.

      e.g. MyCollectionUtils.select() will provoke the warning that "static methods should be called directly" (on CollectionUtils).

      Which would mean
      MyCollectionUtils{
      public static Collection select(){
      return CollectionUtils.select();
      }

      Which really defeats the purpose. In Java5, we have static imports now - these provide more benefit than previous extension did anyhow.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shammah Stephen Kestle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: