JDK-8073357 : schema1.xsd has wrong content. Sequence of the enum values has been changed
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxb
  • Affected Version: 8u45
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-02-17
  • Updated: 2016-06-13
  • Resolved: 2015-04-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u51Fixed 9 b62Fixed openjdk7uFixed
Related Reports
Duplicate :  
Relates :  
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.


Comments
Aleksej, JDK-8046817 is resolved in 8u51 while this bug has affectedVersion 8u51. Is affectedVersion incorrect?
28-10-2015

SQE OK to take the low risk fix to CPU15_03
29-04-2015

Reopening this issue: The test should be updated to test the order of the Enum values.
20-04-2015

The reported issue was resolved as part of JDK-8076549 strandalone JAXWS integration process: see src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java changes.
10-04-2015

TestEnum.java should be modified to test this issue. The fix still will be delivered via JAXWS sync-up.
02-04-2015

For JDK9 bug will be resolved as a part of JAXWS sync process (JDK-8076549). For JDK8 the partial backport will be needed.
02-04-2015