Adam Lally wrote:
On 1/12/07, Marshall Schor <[EMAIL PROTECTED]> wrote:
Running Findbugs, etc., will report on throws / catches that are never
used because the code in the try doesn't throw what is being caught or
propagated up.


I'm not sure what you mean exactly - did you mean "because the code in
the _method_ doesn't throw what is being declared in the method's
throws clause?"... or something else?

It might be good to clean these up.  Typically, they are not changed,
because that kind of a change in an API breaks user code.  I'm wondering
if we could clean these up and have the migration utility fix the user code?


How difficult is the change.  If my above guess was right we'd have to
remove catch blocks from user code.  This seems difficult to do
safely.

I don't think you need to remove catch blocks from user code. If the try/catch
is left in, then the user would get the warning that we're getting.

But you are correct in saying this breaks APIs - in the following way, I think: If the user subclasses an API which has a "throws xxx", the throws xxx clauses
on methods being overridden must match between the class and subclass.

So - user code method declarations which were overriding "built-in" methods
where the throws clause was changed, would need to change.

My hope was that we could use this "one-time" migration to clean this up, with
possible help from the migration tool  :-)

-Marshall

Reply via email to