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

ConcurrentHashMap.putIfAbsent documentation is ambiguous

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 7
    • core-libs

      FULL PRODUCT VERSION :
      jdk 1.7

      ADDITIONAL OS VERSION INFORMATION :
      Windows Vista

      A DESCRIPTION OF THE PROBLEM :
      The Documentation for putIfAbsent in ConcurrentHashMap says:

      /**
           * {@inheritDoc}
           *
           * @return the previous value associated with the specified key,
           * or <tt>null</tt> if there was no mapping for the key
           * @throws NullPointerException if the specified key or value is null
           */


      This is ambiguous. Either the system throws a NullPointerException or returns null if key(value) is null.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: