users@jaxb.java.net

Re: Generated impl classes have very long lines

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 22 Jan 2003 10:03:19 -0800

> Obviously I can split the line but this is rather tedious when I need to
> get it down to < 8k byte chunks, and potentially error prone as the line
> is largely composed of escaped Unicode characters.
>
> Is there an alternative?

This design (of generating a large string inside a class) was supposed to
ease the deployment by not having tons of separate files.

Splitting a string into multiple lines requires the use of StringBuilder
at runtime, which will damage the performance. But seems like this would
be the only potential fix to this problem.

I guess the workaround is not to open those generated files with your
tools. I mean, all the models should be captured just by interfaces, so
you might be able to get away without accessing the actual generated
code.

And you might also want to file bugs against those tools since nothing
in Java prevents the use of very long strings.


regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com