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

ConcurrentSkipListMap.remove(null,null) will not throw NullPointerException

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b73
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      ConcurrentSkipListMap.remove(null,null) will not throw NullPointerException but the spec says Throws NullPointerException if specified key is NULL

      <testcase>
      import java.util.concurrent.ConcurrentSkipListMap;
      public class Test02 {
          public static void main(String[] args) {
              ConcurrentSkipListMap<Integer,Boolean> map =
                           new ConcurrentSkipListMap<Integer,Boolean>();
              try{
                  map.remove(null,null);
                  System.out.println("NullPointerException is not thrown");
              } catch(NullPointerException npe) {
                  System.out.println("Yes ... NullPointerException");
              }
          }
      }
      </testcase>
      output of the above testcase :
      NullPointerException is not thrown

      Tried in Solaris S10:
      <java-version>
      java version "1.6.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta-b59g)
      Java HotSpot(TM) Client VM (build 1.6.0-beta-b59g, mixed mode)
      </java-version>

        Attachments

          Activity

            People

            Assignee:
            martin Martin Buchholz
            Reporter:
            savadhansunw Seetharama Avadhanam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: