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

wrong DatatypeFactory mention in XMLGregorianCalendar spec

    XMLWordPrintable

Details

    • 1.3
    • generic
    • generic

    Backports

      Description



        Name: erR10175 Date: 06/09/2004



          There are two assertions in the spec (jdk15-b54) of the javax.xml.datatype package
        that contradict to each other. The first one (see the overview of the class
        XMLGregorianCalendar, right after the mapping table) states that DatatypeFactory
        methods do not perform *validity* check:
        "
        All maximum value space constraints listed for the fields in the table above are
        checked by factory methods, @{link DatatypeFactory},setter methods and parse methods
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        of this class. IllegalArgumentException is thrown when parameter's value is outside
        the maximum value constraint for the field. Validation checks, for example, whether
        days in month should be limited to 29, 30 or 31 days, that are dependent on the values
        of other fields are not checked by these methods.
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        "

        The second assertion occurs in the descriptions of several factory methods in the class
        DatatypeFactory. That assertion implies that *validation* is performed by the factory
        methods:
        "
        Throws:
            IllegalArgumentException - If any individual parameter's value is outside the
            maximum value constraint for the field as determined by the Date/Time Data Mapping
            table in XMLGregorianCalendar or if the composite values constitute an invalid
            XMLGregorianCalendar instance as determined by XMLGregorianCalendar.isValid().
        "

         It seems that the issue relates to moving creation methods to the DatatypeFactory
        from the XMLGregorianCalendar (CCC 4997741). The bug

          5040475: XMLGregorianCalendar factory and parse methods shouldn't validate instance

        contains details of the issue history.


        ======================================================================

        Attachments

          Issue Links

            Activity

              People

                rmandavasunw Ramesh Mandava (Inactive)
                reysunw Rey Rey (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: