Hi Florian, Thanks for reporting it, I'll take a look at it and get back to you when I have a fix.
Arnaud > -----Original Message----- > From: Kirchhoff, Florian [mailto:[EMAIL PROTECTED]] > Sent: Saturday, May 04, 2002 8:00 PM > To: [EMAIL PROTECTED] > Subject: [castor-dev] Infinite loop in SourceGenerator when self-referencing > complexType extended. > > Hi. > > I know a similar problem had been posted previously > (http://www.mail-archive.com/[email protected]/msg03392.html), but this > one is > a bit trickier. > > It occurs when a complexType A referes to itself and a complexType B extends > complexType A. > > I have the following schema: > > <?xml version = "1.0" encoding = "UTF-8"?> > <schema xmlns="http://www.w3.org/2001/XMLSchema" > targetNamespace = "http://www.qw.com/XMLSchema" > xmlns:qw="http://www.qw.com/XMLSchema"> > > <complexType name = "GeographicAreaT"> > <sequence> > <element name = "LocationName" type = "string" minOccurs = "0"/> > <element name = "LocationId" type = "string" minOccurs = "0"/> > <element name = "GeographicArea" type = "qw:GeographicAreaT"/> > </sequence> > </complexType> > > <complexType name = "AddressT"> > <complexContent> > <extension base = "qw:GeographicAreaT"> > <sequence> > <element name = "CountryCode" type = "string" minOccurs = > "0"> > </element> > <element name = "PostalCode" type = "string" minOccurs = "0"> > </element> > </sequence> > </extension> > </complexContent> > </complexType> > </schema> > > when I run SourceGenerator (with the latest CVS snapshot and default > settings) it enters an infinite loop and finally fails with a StackOverflow > error: > > Exception in thread "main" java.lang.StackOverflowError > at org.exolab.javasource.JMethod.getParameterClassNames(JMethod.java:361) > at org.exolab.javasource.JClass.addMethod(JClass.java:322) > at > org.exolab.castor.builder.SourceFactory.createValidateMethods(SourceFact ory. > java:1230) > at > org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.j ava: > 324) > at > org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator. java > :781) > at > org.exolab.castor.builder.SourceGenerator.processContentModel(SourceGene rato > r.java:916) > at > org.exolab.castor.builder.SourceGenerator.processContentModel(SourceGene rato > r.java:919) > at > org.exolab.castor.builder.SourceGenerator.processComplexType(SourceGener ator > .java:844) > at > org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator. java > :786) > at > org.exolab.castor.builder.SourceGenerator.processContentModel(SourceGene rato > r.java:916) > at > org.exolab.castor.builder.SourceGenerator.processContentModel(SourceGene rato > r.java:919) > at > org.exolab.castor.builder.SourceGenerator.processComplexType(SourceGener ator > .java:844) > > Castor generates GeographicArea and GeographicAreaT if I remove AddressT > from the schema so it the extension that causes the problem. > > I believe this is a bug, could someone do an independant. > > Can someone familiar with the code look into this? > > Thanks. > > Florian > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
