Josh Knowles wrote:
> In the "Change Method Signature" refactor you should have the ability to add
> a throws exception.
I guess that's a bit tricker than the method name, parameters and so on.
Those have to be the same in all implementations of the method, but
when you override a method the new implementation can be declared to
throw fewer exceptions:
class Generic {
void foo() throws MyException, OtherException { ... }
}
class Specific extends Generic {
void foo() throws MyException { ... }
}
Now I might want to add ThirdException to all of these, or maybe to a
class and all its superclasses but not to anything else. Or maybe I
want to remove MyException from all implementations.
I wonder how the Change Method Signature dialog should look in order to
provide this possibility, without forcing all implementations to throw
exactly the same exception.
Maybe it would be better to have a couple of simpler refactorings: "add
exception" / "remove exception".
Add exception -> ask for the type to be added, add it to this method and
optionally:
1) Its "supermethods" (so you don't violate inheritance rules)
2) Its "submethods"
3) All methods from the topmost "supermethod" down through
the tree
...or something. Ideas?
Although I guess this feature has a lower priority for me now than it
used to -- the option I would use the most often would be to add the
exception to a single method and whatever it overrides, which is already
handled by the new "add throws clause" intention action.
_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features