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

schema1.xsd has wrong content. Sequence of the enum values has been changed

    Details

    • Subcomponent:
    • Introduced In Build:
      b06
    • Introduced In Version:
    • Resolved In Build:
      b62

      Backports

        Description


        There is a test for this bug under
        http://hg.openjdk.java.net/jdk9/dev/jdk/rev/0f6be80ba02c.

        If you modify the supplied TestEnum.java file and add a few more enum values
        (entered below) then
        the resulting schema1.xsd has wrong content as the sequence of the enum
        values has been changed illegally.


        -----------------------------
        TestEnumType.java:

        import javax.xml.bind.annotation.XmlEnum;



        @XmlEnum(String.class)

        public enum TestEnumType {

             FIRST, ONE, TWO, THREE, FOUR, FIVE, SIX, LAST


        ---------------------------------

        run schemagen on the java file


        Resulting schema1.xsd:

        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:simpleType name="testEnumType">
            <xs:restriction base="xs:string">
              <xs:enumeration value="FIVE"/>
              <xs:enumeration value="FIRST"/>
              <xs:enumeration value="LAST"/>
              <xs:enumeration value="FOUR"/>
              <xs:enumeration value="SIX"/>
              <xs:enumeration value="TWO"/>
              <xs:enumeration value="THREE"/>
              <xs:enumeration value="ONE"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:schema>


        The contents of the schema1.xsd file is as expected if running the test with
        JDK 7.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  aefimov Aleksej Efimov
                  Reporter:
                  shadowbug Shadow Bug
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: