Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2973

ConcurrentReaderHashMap iterators returning null

    XMLWordPrintable

Details

    Description

      Although Concurrent[Reader]HashMap cannot contain null values,
      iterators over the entrySet() can return null if the entry is removed during iteration.

      See this example from the forums:

      Map m = new ConcurrentHashMap();
      m.put("foo", "bar");
      Iterator i = m.entrySet().iterator();
      Map.Entry me = (Map.Entry) i.next();
      m.removeKey("foo");
      me.getValue(); // returns null

      Any code doing this, needs to be checked for NPEs.

      Attachments

        There are no Sub-Tasks for this issue.

        Activity

          People

            Unassigned Unassigned
            adrian.brock Adrian Brock (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: