Bug 385781 - Better warning suppression options for unused parameters in constructors and methods
Summary: Better warning suppression options for unused parameters in constructors and ...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-23 15:35 EDT by Glenview Jeff CLA
Modified: 2018-05-21 06:13 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glenview Jeff CLA 2012-07-23 15:35:49 EDT
Build Identifier: 20110916-0149

I use methods annotated with @Subscribe and and method parameters annotated with @Observes for event management with Guava's EventBus and RoboGuice's EventManager respectively.  I don't want those parameters reported as unused, so I've disabled unused parameter warnings.

What I'd like is the ability to only enable unused parameter warnings for constructors.

Better yet, if you could add an ignore list for unused parameters/methods that are annotated with a list of provided annotations.  That way you could please people like this guy:  https://bugs.eclipse.org/bugs/show_bug.cgi?id=376590

So you'd have a list of parameter annotations (like @Observes) that would tell Eclipse to ignore if unused, and an independent set of method annotations (such as @Subscribe, @Inject for constructors, etc.) that would cause Eclipse to ignore all of the fields in the annotated method.

Reproducible: Always
Comment 1 Glenview Jeff CLA 2012-08-22 12:32:45 EDT
I recently discovered UCDetector (unused code detector) for Eclipse.  

It offers powerful ignore options including a list of annotations to ignore as I requested.  If you'd like to mine it for ideas:  http://www.ucdetector.org/preferences.html

It doesn't check private methods, so it's not a full replacement for Eclipse's unused code warnings.
Comment 2 Glenview Jeff CLA 2012-08-26 09:32:12 EDT
Also, IntelliJ IDEA has recently implemented warning suppression by configurable annotations to support Guava's EventBus scenario:

http://youtrack.jetbrains.com/issue/IDEA-75640
Comment 3 bjarne Boström CLA 2015-04-21 07:20:37 EDT
This also applies to JavaFX @FXML annotations. It would be nice to have errors/warnings only about the constructor. Or the suggested annotation list.
Comment 4 Jay Arthanareeswaran CLA 2015-04-22 02:26:17 EDT
We will take this up early 4.6.
Comment 5 Jay Arthanareeswaran CLA 2016-04-05 04:33:56 EDT
No progress yet and unlikely to get time during 4.6. Moving out.
Comment 6 Manoj N Palat CLA 2018-05-21 06:13:45 EDT
Bulk move out of 4.8