[ 
https://issues.apache.org/jira/browse/DERBY-4816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914127#action_12914127
 ] 

Knut Anders Hatlen commented on DERBY-4816:
-------------------------------------------

For the tools I can see the value of unwrapping these exceptions, so that the 
stack traces reported to the users are shorter and hopefully easier to 
understand. Not so sure about the tests. I think I would prefer that we just 
let the exceptions propagate unmodified up to the JUnit test runner, as that 
would keep the test code simpler. It should be easy enough to follow the 
"caused by" chain in the stack trace to find the underlying cause if the test 
fails.

> There are quite a few instances in Derby plan exporter  and test code where 
> PrivilegedActionException is thrown instead of the unwrapped exception
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4816
>                 URL: https://issues.apache.org/jira/browse/DERBY-4816
>             Project: Derby
>          Issue Type: Bug
>          Components: Test, Tools
>    Affects Versions: 10.7.0.0
>            Reporter: Kathey Marsden
>
> In working on DERBY-4812, I noticed the plan exporter tool and some tests 
> also throw PrivilegedActionException instead of the underlying exception.   
> These should be examined, but I think generally we should throw the unwrapped 
> exception.
> >grep 'throws PrivilegedActionException' `find java -name '*.java'`
> ava/testing/org/apache/derbyTesting/functionTests/tests/lang/XplainStatisticsTe
> st.java:     * @throws PrivilegedActionException
> java/testing/org/apache/derbyTesting/functionTests/util/CanonTestCase.java:
> * @throws PrivilegedActionException
> java/testing/org/apache/derbyTesting/functionTests/util/FTFileUtil.java:
> throws PrivilegedActionException
> java/testing/org/apache/derbyTesting/functionTests/util/FTFileUtil.java:
> throws PrivilegedActionException
> java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java: * 
> @th
> rows PrivilegedActionException
> java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java:    
> th
> rows PrivilegedActionException, IOException
> java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java:     * 
> @throws
> PrivilegedActionException
> java/testing/org/apache/derbyTesting/junit/BaseTestCase.java:        throws 
> Priv
> ilegedActionException
> java/testing/org/apache/derbyTesting/junit/SupportFilesSetup.java:    
> protected
> void setUp() throws PrivilegedActionException, IOException
> java/testing/org/apache/derbyTesting/junit/SupportFilesSetup.java:    throws 
> Pri
> vilegedActionException
> java/testing/org/apache/derbyTesting/junit/SupportFilesSetup.java:        
> throws
>  PrivilegedActionException, IOException
> java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java:
> throws PrivilegedActionException
> java/testing/org/apache/derbyTesting/junit/TestConfiguration.java:     * 
> @throws
>  PrivilegedActionException
> java/tools/org/apache/derby/impl/tools/planexporter/CreateXMLFile.java:     * 
> @t
> hrows PrivilegedActionException
> java/tools/org/apache/derby/impl/tools/planexporter/CreateXMLFile.java:     * 
> @t
> hrows PrivilegedActionException

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to