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

TabularDataSupport.putAll(Map) does not throw KeyAlreadyExistsException in some case

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 6
    • 5.0
    • core-svc
    • None

       TabularDataSupport.putAll(Map) is able to throw KeyAlreadyExistsException in two cases :

      [...]
      KeyAlreadyExistsException - if the index for a value in t, calculated according to this TabularData instance's TabularType definition already maps to an existing value in this instance, or two values in t have the same index.
      [...]

      What I did is :

      [1]
      TabulaDataSupport tds = new TabulaDataSupport(tabType);
      tds.put(compData);
      HashMap map = new HashMap();
      map.put("ignored", compData);
      tds.putAll(map); ==> I get KeyAlreadyExistsException :-)

      [2]
      TabulaDataSupport tds = new TabulaDataSupport(tabType);
      HashMap map = new HashMap();
      map.put("ignored-1", compData);
      map.put("ignored-2", compData);
      tds.putAll(map); ==> I do not get KeyAlreadyExistsException :-(
      ###@###.### 2005-2-11 07:28:23 GMT

            lmalvent Luis-Miguel Alventosa (Inactive)
            yjoan Yves Joan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: