[ checkstyle-Feature Requests-3026467 ] MagicNumber check shouldn't complain about annotations

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ checkstyle-Feature Requests-3026467 ] MagicNumber check shouldn't complain about annotations

SourceForge.net
Feature Requests item #3026467, was opened at 2010-07-07 10:33
Message generated for change (Comment added) made by oburn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397081&aid=3026467&group_id=29721

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Check
Group: None
>Status: Closed
Priority: 5
Private: No
Submitted By: Jean-Noel Rouvignac ()
Assigned to: Nobody/Anonymous (nobody)
Summary: MagicNumber check shouldn't complain about annotations

Initial Comment:
Hello,

The MagicNumber rule is a bit too aggressive in my case.
I have some code that looks like this, for which the MagicNumber check complains:
@AnnotationUsedToDefineConstants(elementValue = 770)
public class MyClass {
}

Then I have another code that extracts the 770 value at runtime. So in effect, this annotation defines the constants for me an associates them to the class.

IMHO, the MagicNumber check should not raise a violation here.
What are your thoughts about it?

----------------------------------------------------------------------

>Comment By: Oliver Burn (oburn)
Date: 2012-04-21 19:02

Message:
MagicNumber supports the property ignoreAnnotation which addresses this
issue. See http://checkstyle.sourceforge.net/config_coding.html#MagicNumber

----------------------------------------------------------------------

Comment By: Riggs ()
Date: 2011-11-16 01:01

Message:
I can verify that this now works (Eclipse Plugin with Checkstyle 5.5):
Setting the ignoreAnnotation to true in the MagicNumber-Rule fixes this.

----------------------------------------------------------------------

Comment By: Riggs ()
Date: 2011-07-06 23:35

Message:
I totally agree.
Is there a chance that a fix for this gets into an upcoming release?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397081&aid=3026467&group_id=29721

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Checkstyle-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-devel
Loading...