java.util.Date.parse(String) and java.util.Date(String) don't declare thrown IllegalArgumentException

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: 20, 21
    • Component/s: core-libs

      I've noticed that method 'long java.util.Date.parse(String)' doesn't
      have a reference to an IllegalArgumentException in its javadoc.
      https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/util/Date.html#parse(java.lang.String)
      But this exception is thrown in implementation - https://github.com/openjdk/jdk/blob/fbc036e7454720b589d99a8cae30369a10471528/src/java.base/share/classes/java/util/Date.java#L612

      While this method is deprecated, it's still part of public API and should be properly documented.
      Also it's still is used within JDK code itself. (see JDK-4097762).

      Additionally, for consistency, the java.util.Date(String) constructor should also have a reference.

            Assignee:
            Justin Lu
            Reporter:
            Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: