Project
IntelliJ IDEA
Priority
Normal
Type
Usability Problem
Fix versions
No Fix versions
State
Fixed
Assignee
Dmitry Avdeev
Subsystem
Code Analysis. Inspection
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Taras Tielkes
    3 years ago (22 Apr 2009 22:43)
  • Updated by   Evgeniy Schepotiev
    2 years ago (27 Apr 2010 15:30)
  • Jira: IDEADEV-40061
    (history, comments)
 
IDEA-48653 Exclude Spring annotation JMX-exposed methods from "Unused symbol" inspection
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
Spring provides an easy way to annotate classes and methods in order to expose them through JMX.
Such methods are typically _only_ called through JMX, and as such don't have usages in the rest of the code base.

Please make the spring plugin implement the proper extension points in order to exclude such methods from being flagged _unused_.
At the moment this is a common source of "yellow gutter".

Relevant method-scope annotations:
  • @org.springframework.jmx.export.annotation.ManagedOperation
  • @org.springframework.jmx.export.annotation.ManagedAttribute
Comments (11)
 
History
 
Linked Issues (?)
 
Taras Tielkes
  Taras Tielkes
04 Sep 2009 00:34
2 years ago
Dmitry, any chance of having this one fixed?

Of course, if you think it's not a good idea, some discussion would be good as well.
Dmitry Avdeev
  Dmitry Avdeev
04 Sep 2009 13:43
2 years ago
Hi Taras, you can add the annotation to UnusedDeclarationInspection profile.
But I'll add a quickfix for that, and built-in support for jmx annotations, too.
Dmitry Avdeev
  Dmitry Avdeev
04 Sep 2009 13:44
2 years ago
Hmm, the quickfix is already there :)
Taras Tielkes
  Taras Tielkes
04 Sep 2009 14:16
2 years ago
Which QuickFix? I only get "Safe delete xxx", which is not what I want :-)
Dmitry Avdeev
  Dmitry Avdeev
04 Sep 2009 14:29
2 years ago
Ups! I knew the usability problem is there! The fix is available for setters only... I'll fix that.
Taras Tielkes
  Taras Tielkes
04 Sep 2009 14:47
2 years ago
How does this QuickFix work? Does it simply suggest to add any of the present method-level annotations to the list of configured "dependency injection annotations"?
Dmitry Avdeev
  Dmitry Avdeev
04 Sep 2009 15:00
2 years ago
Yes it does. Isn't it enough?
Taras Tielkes
  Taras Tielkes
04 Sep 2009 15:58
2 years ago
It's certainly workable, if the QuickFix will work for regular methods, which I assume if what you'll be fixing.

However, if there's an existing extension point for such annotations it would make sense for the spring plugin to contribute.
Also, the JMX-specific annotations are not really "dependency injection annotations". But I'm just nitpicking..
Dmitry Avdeev
  Dmitry Avdeev
04 Sep 2009 16:42
2 years ago
You are quite right. The labels & messages was the first things to be fixed :)
The extension will be created too.
Taras Tielkes
  Taras Tielkes
10 Sep 2009 04:06
2 years ago
Hi Dmitry,

By "extension", do you mean a plugin API extension point using which the spring plugin can register these annotations?
If so (I actually thought that such extension point existed already), then it could also be used for IDEA-24589.
Taras Tielkes
  Taras Tielkes
23 Sep 2009 14:39
2 years ago
IDEA-50388 is another one :-)