[
https://issues.apache.org/jira/browse/DERBY-3911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688376#action_12688376
]
Kathey Marsden commented on DERBY-3911:
---------------------------------------
In investigating DERBY-4075 I was skimming over the store changes made in 10.5
to see if that could give me ideas where the problem lies. I came across this
issue and had a question.
The current code (trunk revision 757498 ~line 181 ) in BTreeController.java
reads:
~
catch (java.lang.ClassCastException cce)
{
// because we give up the latch on the leaf before entering this
// routine, the page might change from a leaf to branch. If that
// happens this routine will get a ClassCastException, and we
// just give up trying to reclaim space.
}
finally
{
if (controlRow != null) {
if (purged_at_least_one_row) {
// Set a hint in the page that scans positioned on it
// need to reposition because rows have disappeared from
// the page.
controlRow.page.setRepositionNeeded();
}
controlRow.release();
}
}
return(purged_at_least_one_row);
}
At the controlRow.release() line my Eclipse IDE reports a warning: "finally
block does not complete normally" Now that the return is moved out of the
finally block, I don't understand why I am seeing this warning. Can anyone
explain it to me?
Thanks
Kathey
> BTreeController.reclaim_deleted_rows() may hide exceptions
> ----------------------------------------------------------
>
> Key: DERBY-3911
> URL: https://issues.apache.org/jira/browse/DERBY-3911
> Project: Derby
> Issue Type: Bug
> Components: Store
> Affects Versions: 10.5.0.0
> Reporter: Knut Anders Hatlen
> Assignee: Knut Anders Hatlen
> Priority: Minor
> Fix For: 10.5.0.0
>
> Attachments: derby-3911.diff
>
>
> BTreeController.reclaim_deleted_rows() contains this piece of code:
> catch (java.lang.ClassCastException cce)
> {
> // because we give up the latch on the leaf before entering this
> // routine, the page might change from a leaf to branch. If that
> // happens this routine will get a ClassCastException, and we
> // just give up trying to reclaim space.
> }
> finally
> {
> if (controlRow != null)
> controlRow.release();
> return(purged_at_least_one_row);
> }
> It intentionally hides ClassCastExceptions, but it also unintentionally hides
> all other exceptions because of the return statement in the finally clause.
> Some related discussions can be found in DERBY-3216 and DERBY-3905.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.