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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 5.0
    • Component/s: 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: