Skip to content

Duplicate 'create...' methods are generated in ObjectFactory #39

@vadimevf

Description

@vadimevf

Hi!

Processing of the following schema fragment produces duplicate createDemoXewBugActionItem() method in the ObjectFactory class:

<xs:element name="DemoXewBug">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="Action">
        <xs:complexType>
          <xs:choice>
            <xs:element name="UpdateSomeItems">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Item" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:all>
                        <xs:element name="Key" type="xs:string"/>
                        <xs:element name="Value" type="xs:string"/>
                      </xs:all>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
            <xs:element name="UpdateOtherItems">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Item" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:all>
                        <xs:element name="Key" type="xs:string"/>
                        <xs:element name="Value" type="xs:string"/>
                      </xs:all>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>

I think that happens because XmlElementWrapperPlugin.renameFactoryMethod does not check for existence of the new method prior to renaming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions