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

NullPointerException on JCache.putAll(ConcurrentHashMap)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.0.0.CR1, 8.0.0.Final
    • 7.2.2.Final
    • None
    • None
    • 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
         }
      

      Attachments

        Activity

          People

            remerson@redhat.com Ryan Emerson
            michael.gysel Michael Gysel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: