You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "Andreas Beeker (Jira)" <ji...@apache.org> on 2022/02/13 19:57:00 UTC

[jira] [Resolved] (XMLBEANS-306) method name conflicts when using javascource 1.5 for elements: compInfo (unbounded) and compInfoList, a method is created named getCompInfoList

     [ https://issues.apache.org/jira/browse/XMLBEANS-306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Beeker resolved XMLBEANS-306.
-------------------------------------
    Fix Version/s: Version 5.1.0
         Assignee:     (was: Cezar Cristian Andrei)
       Resolution: Works for Me

I've tested this with XmlBeans 5.0.3 - only the bean generation, but I guess the rest works also.

This is my XSD based on s2sComp.xsd:

{{<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">}}
{{    <xs:element name="root" type="root"/>}}
{{    <xs:complexType name="root">}}
{{        <xs:sequence>}}
{{            <xs:element name="dummy" type="dummy" maxOccurs="unbounded"/>}}
{{            <xs:element name="dummyList" type="dummy"/>}}
{{        </xs:sequence>}}
{{    </xs:complexType>}}
{{    <xs:simpleType name="dummy">}}
{{        <xs:restriction base="xs:string"/>}}
{{    </xs:simpleType>}}
{{</xs:schema>}}

and this is the corresponding xsdconfig:

{{<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">}}
{{    <xb:namespace uri="##local">}}
{{        <xb:package>de.kiwiwings.checkXsd</xb:package>}}
{{    </xb:namespace>}}
{{    <xb:qname name="dummyList" javaname="MyDummyList" target="accessor-element"/>}}
{{</xb:config>}}

So works for me - and I'll close the issue now.

> method name conflicts when using javascource 1.5 for elements: compInfo (unbounded) and compInfoList, a method is created named getCompInfoList
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: XMLBEANS-306
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-306
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: Version 2.2
>         Environment: Windows 2k
>            Reporter: paul mortensen
>            Priority: Major
>             Fix For: Version 5.1.0
>
>         Attachments: s2sComp.xsd
>
>
> When attempting to compile an XSD using the javascource 1.5  that contains two elements named,compInfo (unbounded) and comInfoList, a duplicate method name is created.  
> Since the compInfo element can return a list of elements the resulting java source creates a method named    "List getCompInfoList()" .  However because there is also an element name "compInfoList" another method "CompInfoList getCompInfoList()" is created.  This of course creates a conflict in the resulting file.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org