XMLBeans
  1. XMLBeans
  2. XMLBEANS-405

Generating Java code for schema results in syntactically invalid java code

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: Version 2.4
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      JDK 1.5.0

      Description

      When generating java code from an XSD, one of the generated classes ends up with this bit of magic in it:

      static final null.Enum SMIME = null.SMIME;
      static final null.Enum PGPMIME = null.PGPMIME;

      static final int INT_SMIME = null.INT_SMIME;
      static final int INT_PGPMIME = null.INT_PGPMIME;

      Interestingly enough, these constants are used exactly nowhere else in the code, and deleting them fixes all of the compilation errors, but I can't help but think that something more subtle is going wrong.

      Here's the bit of XSD (it's converted from RNG, so please ignore any weird formatting) that leads to this code:

      <xs:element name="security_format">
      <xs:complexType>
      <xs:simpleContent>
      <xs:restriction base="xs:anyType">
      <xs:simpleType>
      <xs:restriction base="xs:token">
      <xs:enumeration value="smime"/>
      <xs:enumeration value="pgpmime"/>
      </xs:restriction>
      </xs:simpleType>
      <xs:attribute name="version">
      <xs:simpleType>
      <xs:restriction base="xs:string">
      <xs:pattern value="[1-9](\.[0-9](\.[0-9])?)?"/>
      </xs:restriction>
      </xs:simpleType>
      </xs:attribute>
      </xs:restriction>
      </xs:simpleContent>
      </xs:complexType>
      </xs:element>

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Rose
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development