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

      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.

          There are no Sub-Tasks for this issue.

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

                Created:
                Updated:
                Resolved: