jaxb
  1. jaxb
  2. JAXB-958

XJC extension creates JDefinedClass for JVM-wide class

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.4u1
    • Fix Version/s: None
    • Component/s: xjc
    • Labels:
      None

      Description

      When following customization is enabled:

      <jaxb:globalBindings generateValueClass="false">
      	<xjc:superInterface name="java.lang.Cloneable" />
      </jaxb:globalBindings>
      

      XJC generates JDefinedClass for super interface java.lang.Cloneable. However by contract JDefinedClass objects should be created for generated classes.

      Expected: java.lang.Cloneable should be a JClass created by JCodeModel.ref(Class) or JDirectClass created by JCodeModel.directClass(String).

      The confusion is generally caused by the use of JDefinedClass.hide(). This effect and should be better implemented by making a common class of JDefinedClass and JDirectClass. Then JDefinedClass is always generated class, while JDirectClass is always hidden.

      The same should be applied to super class:

      <jaxb:globalBindings>
      	<xjc:superClass name="com.mycompany.CommonBean" />
      </jaxb:globalBindings>
      

      Problematic code: BIGlobalBinding.getSuperClass(), BIGlobalBinding.getSuperInterface().

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Iaroslav Savytskyi
            Reporter:
            Dmitry Katsubo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: