I did more digging and realized I completely forgot that these concurrency 
annotations are available with CLASS retention as the findbugs jsr305 jar.  
Here's an example of one of the sources:
http://www.jarvana.com/jarvana/view/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar!/javax/annotation/concurrent/GuardedBy.java?format=ok
Since it is CLASS retention, the jar isn't a runtime dependency, and there is 
no transitive compile issue with Java 5 (see the HttpClient URL below for that 
bug).  FYI, this jsr305 jar is using a creative-commons attribution license.

Chris, I read your thoughts on custom PMD rules.  I think that's a fantastic 
idea.  I'm not sure if these rules should be PMD rules or FindBugs rules, but 
we can cross that bridge when we come to it.  AFAIK, FindBugs is way more 
popular so I would favor that.

~ David

On Jul 8, 2011, at 3:17 PM, Smiley, David W. wrote:

> The annotations defined by FindBugs are marked with CLASS retention, which 
> means there shouldn't be a runtime dependency.
> 
> However the JCIP (Java Concurrency In Practice, a book) annotations, such as 
> @ThreadSafe, are unfortunately marked with RUNTIME retention.  Information 
> I've found leads me to believe that in Java 6, there is no runtime or compile 
> time dependency for 3rd party libraries using Lucene/Solr if there are 
> annotations there, but Java 5 has problems with it: 
> https://issues.apache.org/jira/browse/HTTPCLIENT-866    Just now I messaged 
> the maintainer of the ASL licensed cleanroom port of the findbugs annotations 
> to see if he'll do the same for the JCIP ones.
> 
> ~ David
> 
> On Jul 8, 2011, at 1:16 PM, Uwe Schindler wrote:
> 
>> Just a stupid question:
>> Once you add those annotations, wouldn't the JAR file not require then this
>> annotations.jar? Or are all of them not available to runtime?
>> 
>> Uwe
>> 
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: u...@thetaphi.de
>> 
>>> -----Original Message-----
>>> From: Smiley, David W. [mailto:dsmi...@mitre.org]
>>> Sent: Friday, July 08, 2011 4:30 PM
>>> To: dev@lucene.apache.org
>>> Subject: Re: FindBugs & PMD ?
>>> 
>>> Rob, there is an ASL 2.0 licensed implementation here:
>>> https://github.com/stephenc/findbugs-annotations
>>> 
>>> ~ David
>>> 
>>> On Jul 8, 2011, at 10:12 AM, Robert Muir wrote:
>>> 
>>>> On Fri, Jul 8, 2011 at 10:08 AM, Smiley, David W. <dsmi...@mitre.org>
>>> wrote:
>>>>> Developers,
>>>>> Any thoughts on using FindBugs & PMD to catch more bugs in
>>> Lucene/Solr?  Jenkins could be configured to run FindBugs & PMD analysis
>>> nightly.  It would have helped find this:
>>>>> 
>>>>>       (LUCENE-3294) Some code still compares string equality
>>>>> instead using equals
>>>>> 
>>>>> I am aware there are a high degree of false-positives but there are
>> ways
>>> of dealing with them, such as with @SuppressWarnings("PMD") and with
>>> //NOPMD   and for Findbugs, there is
>>> @edu.umd.cs.findbugs.annotations.SuppressWarnings(....)  and there's a
>>> fairly detailed configuration file for FindBugs to really control it and
>> to make
>>> exceptions.  I'd also really like to see use of FindBugs concurrency
>>> annotations @GuardedBy, @Immutable, @NotThreadSafe, @ThreadSafe.
>>>> 
>>>> I think its a good idea for nightly, but I am strongly against linking
>>>> to an LGPL library for these annotations.
>>>> I would prefer PMD instead, because of the license.
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For
>>>> additional commands, e-mail: dev-h...@lucene.apache.org
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional
>>> commands, e-mail: dev-h...@lucene.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: dev-h...@lucene.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to