[Clirr-devel] MethodSetCheck: changing argument count
Status: Alpha
Brought to you by:
lkuehne
From: Simon K. <si...@ec...> - 2004-06-29 06:53:29
|
Hi Lars, Re the check for "Method argument count changed". I suggest it would be better to remove the "heuristic" code in the "similarity" section which tries to pair up methods which have different numbers of parameters. If this code was removed, then old class: foo(int i); new class: foo(String s, Object o); would report * removed method "foo(int i)" * added method "foo(String s, Object o)" rather than * changed # of arguments in method foo Are these two different versions of method Foo *really* "the same method with different number of arguments"? I think the answer is "sometimes yes, sometimes no". And what do we report if the old version of Foo was overriding an inherited method, and the new version is not? By reporting a method removed + a method added, we may miss an opportunity to be "clever", but we won't ever report "method changed argument count" when the user sees the two variants as really being different methods. I think this is particularly important when there are a number of overloaded variants with the same method name. One possible compromise is to report "method changed argument count" only when new arguments have been added to the end of the list of arguments for the old method version. But frankly even this seems to introduce more complexity than needed. What do you think? Regards, Simon |