Don't wrap RuntimeExceptions
----------------------------

         Key: XALANJ-2094
         URL: http://issues.apache.org/jira/browse/XALANJ-2094
     Project: XalanJ2
        Type: Bug
    Versions: 2.6    
    Reporter: Frederic Simard


In org.apache.xalan.transformer.TransformerImpl  the  RuntimeExeption are 
wrapped which is annoying and also introduce limitations. That is why I am 
proposing to throw them instead of wrapping them.  

Example:

In the run method, the only exception is catch, which wrap the any thrown 
runtime exception.

Now it likes that:
    try
    {
 ...        
     }
    catch (Exception e)
    {
      // e.printStackTrace();
      if (null != m_transformThread)
        postExceptionFromThread(e);
      else 
        throw new RuntimeException(e.getMessage());         // Assume we're on 
the main thread.
    }

Should be replaced by something like this:

    try
    {

 ...
        
     }
    catch (RuntimeException e)
    {

      // e.printStackTrace();
      if (null != m_transformThread)
        postExceptionFromThread(e);
      else 
        throw e;
    }
    catch (Exception e)
    {

      // e.printStackTrace();
      if (null != m_transformThread)
        postExceptionFromThread(e);
      else 
        throw new RuntimeException(e.getMessage());         // Assume we're on 
the main thread.
    }




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to