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

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

The article warns that returning from finally clauses could hide exceptions 
thrown in the try block. (I agree that's a problem, and at some point I think I 
even commented on some existing methods in store doing that. I should probably 
have filed a JIRA for that. Thanks for reminding me!) But hiding those 
exceptions is exactly what we're trying to achieve with this code, so I believe 
it is safe. The reason why I felt it was clearer, was that all the logic for 
re-throwing the exception was located in a single place (the finally clause), 
but I don't think it's a big issue.

One thing that changed with the patch, is this:

  Without the patch, we re-throw the exception that caused the test failure 
regardless of what happens in the try block.

  With the patch, we only re-throw the exception that caused the test failure 
if no error condition happened in the try block or if an IOException was 
thrown. If some other kind of exception or throwable was thrown, the error in 
the try block will hide the error in the test.

> Failed tests should save the database off to the fail directory
> ---------------------------------------------------------------
>
>                 Key: DERBY-3905
>                 URL: https://issues.apache.org/jira/browse/DERBY-3905
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions: 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>            Priority: Minor
>         Attachments: derby-3905_diff.txt
>
>
> Currently failed tests save the derby.log to the fail directory for that 
> test.  It would be useful to save the database as well.

-- 
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