Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5569

NullPointerException on JCache.putAll(ConcurrentHashMap)

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.2.2.Final
    • Fix Version/s: 8.0.0.CR1, 8.0.0.Final
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Call org.infinispan.jcache.embedded.JCache.putAll(Map<? extends K, ? extends V>) with a java.util.concurrent.ConcurrentHashMap<K, V>.

      The check inputMap.containsKey(null) throws a NPE as the ConcurrentHashMap does not allow null keys.

      Like Hashtable but unlike HashMap, this class does not allow null to be used as a key or value. (JavaDoc of ConcurrentHashMap)

      Show
      Call org.infinispan.jcache.embedded.JCache.putAll(Map<? extends K, ? extends V>) with a java.util.concurrent.ConcurrentHashMap<K, V> . The check inputMap.containsKey(null) throws a NPE as the ConcurrentHashMap does not allow null keys. Like Hashtable but unlike HashMap, this class does not allow null to be used as a key or value. (JavaDoc of ConcurrentHashMap)

      Description

      Class org.infinispan.jcache.embedded.JCache<K, V>

      @Override
         public void putAll(Map<? extends K, ? extends V> inputMap) {
            checkNotClosed();
            // spec required check
            if (inputMap == null || inputMap.containsKey(null) || inputMap.containsValue(null)) {
               throw new NullPointerException(
                  "inputMap is null or keys/values contain a null entry: " + inputMap);
            }
         // more code
         }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ryanemerson Ryan Emerson
                Reporter:
                michael.gysel Michael Gysel
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: