A
Anony!
Just been playing with RefactorIT
It is unusual to have a throw statement in a finally block. I believe there
are other ways of achieving the same semantics by changing the structure of
your code.
Well it is high priority because the exception has to be caught.
have throws statements in each catch block, but this is not recommended.
Correct, but there must also be an exception handler to catch the thrown
exception, and that could be the problem your experiencing.
HTH
AAA
Found the Audit tool and ran it.
It alerted me to something that I never considered to be a problem.
It graded high priority - throwing clauses in a finally block.
Why do they see this as a problem? How bad is it?
It is unusual to have a throw statement in a finally block. I believe there
are other ways of achieving the same semantics by changing the structure of
your code.
My Joshua Bloch Bible doesn't say anything about it.
I can see that alerting the situation is good, but High Priority?
Well it is high priority because the exception has to be caught.
So how do you typically avoid throws in a finally?
have throws statements in each catch block, but this is not recommended.
And any how, if the method is declared as throws....
Then the finally block can throw it anyway.
Correct, but there must also be an exception handler to catch the thrown
exception, and that could be the problem your experiencing.
HTH
AAA