Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6784045

Incorrect exception in CompositeDataSupport(CompositeType, Map) for null key in Map

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b75
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      The constructor CompositeDataSupport(CompositeType, Map) ends up calling a private method makeMap(Map<String,?> items) which does this:

              if (items.containsKey(null) || items.containsKey(""))
                  throw new IllegalArgumentException("Null or empty item name");

      If items is a Map that does not support null keys then items.containsKey(null) is allowed to throw NullPointerException, which will mask the IllegalArgumentException. TreeMap is such a Map.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              emcmanus Eamonn McManus
              Reporter:
              emcmanus Eamonn McManus
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: