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

DateFormat does not mention IllegalArgumentException for invalid style args

XMLWordPrintable

    • b24
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      Relates to JDK-4213086

      When one of the java.text.DateFormat static methods which take a date or time style parameter are called with an invalid style value (e.g. -1) they throw an IllegalArgumentException. However, none of the methods document that they throw this exception.

      Expected:
      The following methods and their overloads which take `int` style parameters should have a @throws IllegalArgumentException Javadoc tag
      - getDateInstance
      - getTimeInstance
      - getDateTimeInstance



      ---------- BEGIN SOURCE ----------
      DateFormat.getDateInstance(-1)
      DateFormat.getDateInstance(-1, Locale.ENGLISH)
      DateFormat.getTimeInstance(-1)
      DateFormat.getTimeInstance(-1, Locale.ENGLISH)
      DateFormat.getDateTimeInstance(-1, -1)
      DateFormat.getDateTimeInstance(-1, -1, Locale.ENGLISH)

      ---------- END SOURCE ----------

            jlu Justin Lu
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: