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

java.lang.System.identityHashCode(null) != 0

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      sparc
    • OS:
      solaris_2.6
    • Verification:
      Verified

      Description



      Name: ksC84122 Date: 04/09/99


      JDK 1.2.2 java.lang.System.identityHashCode(null) != 0, however the javadoc
      explicitly states:
      "The hashcode for the null reference is zero."

      A test example which demonstrates this problem.
      ===== test47.java ========
      public class test47 {

         public static void main (String argv[]) {
             System.out.println(System.identityHashCode(null));
             return;
        }
      }

      ========= Sample run (JDK1.2.2) ==========
      #>java test47
      -50630056

      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            mmcclosksunw Michael Mccloskey (Inactive)
            Reporter:
            skosunw Sko Sko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: