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

(spec) Integer.compareTo(null) should document that it throws NPE

XMLWordPrintable

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

      java.lang.Integer.compareTo(null) should throw NPE. It should be described in the javadoc spec.

      In fact Integer.compareTo(null) throws null. To reproduce it you may run following test:

      public class Test {
          public static void main(String[] args) {
              new Integer(3).compareTo(null);
          }
      }

      ----
      the result is:
      Exception in thread "main" java.lang.NullPointerException
      ...


      ###@###.### 2005-03-24 10:47:23 GMT

            darcy Joe Darcy
            ydanilev Yury Danilevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: