IG

Dave, Can you add an inspection to identify Unused parameters? This
inspection isn't covered by the built-in "Unused symbol" as documented.

Thanks,
Jon

4 comments
Comment actions Permalink


Actually, it is. It's just that the parameter needs to be unused in all implementations of the method. It even works locally for single-implementation methods (static, private, or constructor). While finding locally unused parameters for even multi-implementation would be easy(-ish), I'm not sure of the value. You couldn't remove the parameter, after all, without changing the program semantics

0
Comment actions Permalink

You could also vote for http://www.intellij.net/tracker/idea/viewSCR?publicId=29842.

Andrei

JS> Dave, Can you add an inspection to identify Unused parameters? This
JS> inspection isn't covered by the built-in "Unused symbol" as
JS> documented.
JS>
JS> Thanks,
JS> Jon

0
Comment actions Permalink

Dave Griffith wrote:

Actually, it is. It's just that the parameter needs to be unused in all implementations of the method. It even works locally for single-implementation methods (static, private, or constructor). While finding locally unused parameters for even multi-implementation would be easy(-ish), I'm not sure of the value. You couldn't remove the parameter, after all, without changing the program semantics


For the built-in inspection, I see it working for the single
implementations you mention. However, if a method does not implement or
override and is final, it makes sense that the unused parameters should
be flagged, but that doesn't happen presently. I'd like an option to
have it mark the cases that Andrei requested.

Thanks,
Jon

0
Comment actions Permalink

Jon Steelman wrote:

However, if a method does not implement or
override and is final, it makes sense that the unused parameters should
be flagged, but that doesn't happen presently.


Did you try running Inspect Code? It is only shown there, not "on the
fly" in the editor, since it requires a global analysis rather than a
local method analysis.

0

Please sign in to leave a comment.