Annotations

View: New views
3 Messages — Rating Filter:   Alert me  

Annotations

by Michael Gerz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

there are rumours that findbugs allows using annotations for suppressing
warnings and other things. (I saw some comments in the Changelog)

Where is this feature described? I can't find it in the manual.

Regards,

Michael


_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@...
http://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss

Re: Annotations

by Brian Cole-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well the SuppressWarnings annotation is part of J2SE 1.5

The problem is that java.lang.SuppressWarnings has @Retention(value=SOURCE),
which means it doesn't make it into the class file. Hence FindBugs can't see it.

FindBugs defines edu.umd.cs.findbugs.annotations.SuppressWarnings
which works the same way but has @Retention(RetentionPolicy.CLASS).
FindBugs will honor this annotation, and will also honor any annotiation
named SuppressWarnings (with class retention) in any other package .

This does need be documented in the manual.

-brian

On Jan 28, 2006, at 11:51 AM, Michael Gerz wrote:
Hello,

there are rumours that findbugs allows using annotations for suppressing 
warnings and other things. (I saw some comments in the Changelog)

Where is this feature described? I can't find it in the manual.

Regards,

Michael


_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@...
http://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss

Re: Annotations

by kretes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yes, that may be working, but then You have to add a findbugs.jar to classpath, which is not what everybody would love to do :)
I've submitted a enhancement to https://sourceforge.net/tracker/index.php?func=detail&aid=2675225&group_id=96405&atid=614696
maybe someday.. ;)


Brian Cole-2 wrote:
Well the SuppressWarnings annotation is part of J2SE 1.5
<http://java.sun.com/j2se/1.5/docs/api/java/lang/SuppressWarnings.html>

The problem is that java.lang.SuppressWarnings has @Retention
(value=SOURCE),
which means it doesn't make it into the class file. Hence FindBugs  
can't see it.

FindBugs defines edu.umd.cs.findbugs.annotations.SuppressWarnings
which works the same way but has @Retention(RetentionPolicy.CLASS).
FindBugs will honor this annotation, and will also honor any annotiation
named SuppressWarnings (with class retention) in any other package .

This does need be documented in the manual.

-brian

On Jan 28, 2006, at 11:51 AM, Michael Gerz wrote:
> Hello,
>
> there are rumours that findbugs allows using annotations for  
> suppressing
> warnings and other things. (I saw some comments in the Changelog)
>
> Where is this feature described? I can't find it in the manual.
>
> Regards,
>
> Michael


_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@mimsy.cs.umd.edu
http://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss