javaee / jaxb-v2

Other
210 stars 100 forks source link

When an element have same name that his element ancestor, jvc generate bad java classes, with a parent and a son with the same name. #1021

Open glassfishrobot opened 10 years ago

glassfishrobot commented 10 years ago

If you have en element with the same name that his parent, jvc run without problems but generate bad java classes. If you tray to binding the name, then jvc generate a run time error like:

D:\PCBCK\Java\jaxb\jaxb-ri-2.2.7\samples\aod>xjc -nv -verbose messages.xsd -b bindingset.xml Exception in thread "main" java.lang.IllegalArgumentException: Illegal class inheritance loop. Outer class TargetSpeedElement may not subclass from inner class: <> at com.sun.codemodel.internal.JDefinedClass._extends(JDefinedClass.java:257) at com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy$1._extends(ImplStructureStrategy.java:104) at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.(BeanGenerator.java:197) at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:151) at com.sun.tools.internal.xjc.model.Model.generateCode(Model.java:275) at com.sun.tools.internal.xjc.Driver.run(Driver.java:342) at com.sun.tools.internal.xjc.Driver.run(Driver.java:184) at com.sun.tools.internal.xjc.Driver._main(Driver.java:107) at com.sun.tools.internal.xjc.Driver.access$000(Driver.java:64) at com.sun.tools.internal.xjc.Driver$1.run(Driver.java:87)

Environment

Windows 7 64,

Affected Versions

[2.2.7]

glassfishrobot commented 10 years ago

Reported by jpsanchez

glassfishrobot commented 10 years ago

Was assigned to yaroska

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAXB-1021