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

Method naming when an extension method is defined, which returns a generated type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Version 2.2
    • Fix Version/s: None
    • Component/s: Tools
    • Labels:
      None
    • Environment:
      Linux, jdk1.6.0, xmlbeans-2.2.0

      Description

      When an extension method returns a type, which itself is a generated type, the methods in the original interface are renamed to *2, like this:

      KeyedReference addNewKeyedReference2();
      instead of
      KeyedReference addNewKeyedReference();

      I have an extension interface with a method like this:

      KeyedReference getKeyedReference(String name);

      In a handler class, the corresponding static method is implemented. In xsdconfig, I have this:

      <xb:extension for="dk.itst.uddi.client.types.core.CategoryBag">
      <xb:interface name="dk.itst.uddi.client.extension.CategoryBagExtension">
      <xb:staticHandler>dk.itst.uddi.client.extension.CategoryBagHandler</xb:staticHandler>
      </xb:interface>
      </xb:extension>

      I have two xsdconfig files: One for namespace mapping and one for extensions. The build goes like this:

      • Run xmlbeans with only namespace mapping file
      • Compile the extension classes and the generated xmlbeans
      • Delete generated beans (only source files)
      • Generate xmlbeans with both xsdconfig files
      • Compile everything

      Without the extension, the extended interface has a method KeyedReference addNewKeyedReference(), but after the extension is enabled, the same method is called KeyedReference addNewKeyedReference2(). The extension method works alright.
      The problem only occurs when the return type is a generated type.

        Attachments

          Activity

            People

            • Assignee:
              radup Radu Preotiuc
              Reporter:
              recht Joakim Recht
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: