Bug 201759 - Add option to consider parameter unused only when the entire class hierarchy does not use it
Summary: Add option to consider parameter unused only when the entire class hierarchy ...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-30 11:45 EDT by Daniel Aborg CLA
Modified: 2007-08-31 10:02 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Aborg CLA 2007-08-30 11:45:36 EDT
Build ID: I20070621-1340

Currently a parameter is reported as unused purely based on usage in that single method instance, which does not work very well if a superclass method does not use a parameter that a subclass method does.

The "check overriding and implementing methods" option does not seem to rectify this. There is the option to ignore parameters documented with an @param tag, but this essentially amounts to nothing more than another form of @SuppressWarnings, which is not ideal since it allows you to hide instances where there really SHOULD be a warning.

So, to summarize, it would be fantastic if there was an option to limit warnings to those instances where a parameter is unused in all subclass and superclass variants of a method. This would ensure that the warnings that are reported are always possible to act on by fixing the code.
Comment 1 Daniel Aborg CLA 2007-08-30 11:54:41 EDT
Also, using @javadoc to hide these warnings, while better than nothing, gives rise to the problem where a method stops using a parameter but it's not reported as a warning because it's documented. This is probably going to happen fairly often, so it would be desirable to instead have a warning that never gives you a false positive so it can always be acted upon.