Here's my official
-1
vote to any non-command-line-handling code that
includes System.exit(). At your convenience, I'd like
to see the System.exit(1) line added below (in
SAX2DOM.java, right?) removed and replaced with...
anything else, I don't care.
System.exit() is fairly evil, especially for a
processor like Xalan that may be integrated into
larger server-side systems. Unless the server code
that invoked Xalan somehow traps the System.exit call,
we'll bring the whole JVM down with us, which is
*clearly* not appropriate, no matter how bad our
particular error was.
Obvious exceptions to this rule are command line
handling classes like org.apache.xalan.xslt.Process
(since typically they're used by an interactive user
at the console who will immediately see the error) and
developer-specific debugging functions like
DTMDefaultBase.dumpDTM() (in which case the developer
who called it will figure it out). There are still a
number of System.exit() calls in some xsltc code that
I'd like to change or conditionalize as well, but
that's lower priority right now.
What do I propose we do instead in this case? I'm not
sure. If it's really a 'kaboom' kind of error, just
throw a RuntimeException and we'll figure out the
right way to handle these kinds of things later.
- Shane
---- you [EMAIL PROTECTED] wrote ----
> > if (m_sourceSystemId.size() != m_size) {
> > System.out.println("size array " + m_size
> > + " is different from
size of array "
> > +
m_sourceSystemId.size());
> > System.exit(1);
> > }
> I know this is an assert rather than exception
handling, but I really
> dislike having System.exits in the code. Do you
have a strong opinion
> about this? I would personally rather see a runtime
exception here.
>
> Thanks for the great addition!!!
>
> -scott
=====
<eof aka="mailto:[EMAIL PROTECTED]"
humor="'A Midsummer Night's Dream' - pick your quote" />
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/