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

Inconsistent Javadoc comment and code for toProperties(final Map<K, V>) in org.apache.commons.collections.MapUtils

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0, 4.x
    • 4.0-alpha1, 4.0
    • Collection
    • Platform Indepedent

    Description

      The Javadoc comment below states that the parameter map "..., may not be null":
      /**
      ..

      • @param map the map to convert to a Properties object, may not be null
      • @return the properties object
        */
        public static <K, V> Properties toProperties(final Map<K, V> map)
        Unknown macro: { Properties answer = new Properties(); if (map != null) { ... } return answer; }

        However, the method return normally without throwing any exception when called with null.

      Suggested Fixes:
      1. Change "@param map the map to convert to a Properties object, may not be null" to "@param map the map to convert to a Properties object, may be null"
      or
      2. Remove "may not be null" from @param.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shinhwei SHIN HWEI TAN
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2m
                2m
                Remaining:
                Remaining Estimate - 2m
                2m
                Logged:
                Time Spent - Not Specified
                Not Specified