Hi.  I'm a Xalan user, not a developer.  I wanted to post here, though, to
point out an issue I've run into with it that I thought some of the developers
might want to hear about and possibly clean up.

If you take a look around line 3386 in
org.apache.xalan.transformer.TransformerImpl, you'll see the following
construct:

      catch (Exception e)
      {
        // e.printStackTrace();

        // Strange that the other catch won't catch this...
        if (null != m_transformThread)
          postExceptionFromThread(e);   // Assume we're on the main thread
        else 
          throw new RuntimeException(e.getMessage());
      }

The line in particular that's giving me grief is this:

          throw new RuntimeException(e.getMessage());


The problem I'm having is that my app which calls Xalan is resulting in an
exception being caught and handled by that try/catch block (a
NullPointerException).  But I have no way to find out what's causing it or
why, since the re-thrown runtime exception is stripping off the stack trace
from the original NPE.  Seems to me like this is a very bad way to code, and
that a better way to write this would be:

          throw new RuntimeException(e);


I hope this suggestion is helpful and not unwelcome, and that I am in fact
correct about this and am not missing something in my analysis.

If anyone has any follow-up questions or responses for me about this, please
email me directly, as I'm not a member of the list.


Thanks very much for all the great work on Xalan, everyone!

DR


==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

Reply via email to