Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-225

JDK1.5 generated code fails to compile if you have both a List of XXX and XXXList elements

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Version 2.1
    • Fix Version/s: TBD
    • Component/s: Binding
    • Labels:
      None
    • Environment:
      All

      Description

      Using the -javasource 1.5 flag to scomp, the following schema (for example) will generate code which will not be able to compile because it generates 2 methods both called getPosList():

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" >
      <complexType name="LineStringType">
      <sequence>
      <choice>
      <choice minOccurs="2" maxOccurs="unbounded">
      <element ref="gml:pos"/>
      </choice>
      <element ref="gml:posList"/>
      </choice>
      </sequence>
      </complexType>

      <element name="pos" type="xsd:string" />

      <element name="posList" type="xsd:string" />

      </schema>

      Currently the user then has the following options: 1) change the schema (may not be available), 2) change the generated code (hacky), or 3) remove the -javasource flag (should not be necessary).

      Perhaps it would be possible to add an option to enable the user to override the default string "List" that gets added to the JDK 1.5 getter when there is a list type? (See SchemaTypeCodePrinter lines 1102 and 1125).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ljones Lawrence Aston Jones
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: