[ 
https://jira.codehaus.org/browse/JIBX-393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=296314#comment-296314
 ] 

Sergio Ortiz commented on JIBX-393:
-----------------------------------

Just it case it helps in the resolution:

{code:title=ClassBuilder.java}
163    public void setSuperclass(String name) {
164        if (m_class instanceof TypeDeclaration) {
165            ((TypeDeclaration)m_class).setSuperclassType(createType(name));
166        } else {
167            throw new IllegalStateException("Internal error - can't set 
superclass on an enum or other special type");
168        }
169    }
{code}

Shouldn't it just return if the class is not one of the valid types instead of 
throwing an exception? It would allow to continue with all the other decorators 
and eventually with all the other classes. In my case, I'm getting the error 
when trying to execute it for an enum type, since I'm running 
ExtensionCollaborator for a full schema. And it's a pain having to go one by 
one...


Thanks,
Sergio
                
> Unable to set superclass on imported schema that contains restricted enum
> -------------------------------------------------------------------------
>
>                 Key: JIBX-393
>                 URL: https://jira.codehaus.org/browse/JIBX-393
>             Project: JiBX
>          Issue Type: Bug
>          Components: CodeGen
>    Affects Versions: JiBX 1.2.2
>         Environment: Windows XP
> Sun JDK 1.6.0_10
>            Reporter: Gary Jacobs
>         Attachments: EnumOne.xsd, EnumTwo.xsd, pacs.xsd
>
>
> When running CodeGen against the attached schemas I get the following error:
> Exception in thread "main" java.lang.IllegalStateException: Internal error - 
> can't set superclass on an enum or other special type
>         at 
> org.jibx.schema.codegen.ClassBuilder.setSuperclass(ClassBuilder.java:167)
>         at 
> org.jibx.schema.codegen.ClassHolder.finishClass(ClassHolder.java:718)
>         at 
> org.jibx.schema.codegen.EnumerationClassHolder.generate(EnumerationClassHolder.java:166)
>         at 
> org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:210)
>         at 
> org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:227)
>         at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1535)
>         at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:1989)
> The command line I'm using is:
> java -cp .\;D:\Apache\JibxOriginal\jibx\lib\jibx-tools.jar 
> org.jibx.schema.codegen.CodeGen -t ./JiBX -p com.jibxstub.request   
> EnumOne.xsd

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
jibx-devs mailing list
jibx-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to