users@jaxb.java.net

Re: ObjectFactory.getRootElement() too large.

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 27 Jun 2003 08:20:59 -0700

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.

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