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

(fmt) UnknownFormatConversionException constructor does not throw NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • core-libs
    • None
    • b39
    • generic
    • generic

      The spec for java.util.UnknownFormatConversionException declares: "Unless otherwise specified, passing a null argument to any method or constructor in this class will cause a NullPointerException to be thrown."

      But the constructor
          public UnknownFormatConversionException(String s)
      does not throw an exception if it is called with null argument.

      For example, the following code:

          try {
              new java.util.UnknownFormatConversionException(null);
              System.out.println("FAILURE");
          } catch (NullPointerException npe) {
              System.out.println("OKAY");
          }

      Produces the following printout:

          FAILURE

      ###@###.### 2005-05-05 15:42:49 GMT

            iris Iris Clark
            asutchil Arkadiy Sutchilin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: