----- Original Message -----
From: "Kohsuke Kawaguchi" <Kohsuke.Kawaguchi_at_Sun.COM>
To: <JAXB-INTEREST_at_JAVA.SUN.COM>
Sent: Friday, June 27, 2003 10:20 AM
Subject: Re: ObjectFactory.getRootElement() too large.
> Martin Bosak <bosakm_java_at_FMCTC.COM> wrote:
> > When compiling a really huge schema, the generated method
> > getRootElement() in the ObjectFactory class exceeds 65535 bytes.
> >
> > The schema I was generating is the IFX version 1.4.0 (available from
> > www.ifxforum.org).
>
> Good point. I guess we could also use more efficient look-up mechanism.
>
>
> > Also, won't the hardcoded references to the implementation .class files
> > result in them being loaded by the JVM when ObjectFactory is loaded?
> > This will result in a long startup time (this was the reason the static
> > initialization block was changed to use the .class names as Strings).
>
> While the spec of VM allows such eager class loading, at least Sun's
> recent JVMs don't load classes unless that line of the code is executed.
> In case of the static initializer, it was always executed, so that's why
> we changed that to String. But the getRootElement method hits the
> XXXX.class line only when the element name matches.
Ahh, my mistake. I didn't actually test this. I was just looking at the
code and just saw all those
XXXX.class references.
Thanks.
>
> You can add "-verbose:class" to find out how it's going with your JVM.
>
>
>
>
> regards,
> --
> Kohsuke Kawaguchi 408-276-7063 (x17063)
> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>