You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by sebb <se...@gmail.com> on 2009/03/17 22:24:23 UTC

Adding JCIP annotations to httpclient (and NIO)

The JCIP annotation jar

http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html

is now available from Maven repos, so it might be a good idea to start
using the annotations for code that requires Java 1.5+.

Any objections if I add it as an optional dependency to HttpClient,
and start adding annotations to classes?

I don't think we need to update the NOTICE file as we are not
republishing or creating a derived work, see end of Javadoc.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Adding JCIP annotations to httpclient (and NIO)

Posted by James Abley <ja...@gmail.com>.
2009/3/17 sebb <se...@gmail.com>:
> The JCIP annotation jar
>
> http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html
>
> is now available from Maven repos, so it might be a good idea to start
> using the annotations for code that requires Java 1.5+.
>
> Any objections if I add it as an optional dependency to HttpClient,
> and start adding annotations to classes?
>
> I don't think we need to update the NOTICE file as we are not
> republishing or creating a derived work, see end of Javadoc.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

I'm for that. I've been documenting thread-safety aspects for the
Content Codings patch, but using the annotations makes sense.

Cheers,

James

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Adding JCIP annotations to httpclient (and NIO)

Posted by Mike Dillon <mi...@embody.org>.
Interesting... I didn't realize that Class.getAnnotations() just
returned empty if it can't find any of the annotation classes... I guess
I assumed that @Retention(value=RUNTIME) would make things blow up if
the class is not there.

Thanks Sam.

-md

begin Sam Berlin quotation:
> Annotations are explicitly designed to allow code to continue working
> even if the annotation is not present at runtime.  Annotations just
> describe arbitrary additional details about code, but do nothing to
> inherently change or add logic.  Of course, if there's some code that
> looks at annotations and makes decisions based on whether or not the
> annotation exists on a variable/class/method/etc, then the annotation
> needs to be around -- but then you have a pretty clear reason & need
> for keeping the annotation around.
> 
> This is partly why annotations are so frickin' cool.
> 
> Sam
> 
> On Tue, Mar 17, 2009 at 7:10 PM, Mike Dillon <mi...@embody.org> wrote:
> > begin sebb quotation:
> >> On 17/03/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> >> > sebb wrote:
> >> >
> >> > > The JCIP annotation jar
> >> > >
> >> > >
> >> > http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html
> >> > >
> >> > > is now available from Maven repos, so it might be a good idea to start
> >> > > using the annotations for code that requires Java 1.5+.
> >> > >
> >> > > Any objections if I add it as an optional dependency to HttpClient,
> >> > > and start adding annotations to classes?
> >> > >
> >> > > I don't think we need to update the NOTICE file as we are not
> >> > > republishing or creating a derived work, see end of Javadoc.
> >> > >
> >> > >
> >> >
> >> >  Sebastian
> >> >
> >> >  HttpClient would no longer compile without jcip-annotations.jar on the
> >> > class path, would it?
> >>
> >> The jar is needed for compilation, however it's not needed at run-time.
> >
> > How is it not needed at run-time if @Retention=RUNTIME?
> >
> > -md
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Adding JCIP annotations to httpclient (and NIO)

Posted by Sam Berlin <sb...@gmail.com>.
Annotations are explicitly designed to allow code to continue working
even if the annotation is not present at runtime.  Annotations just
describe arbitrary additional details about code, but do nothing to
inherently change or add logic.  Of course, if there's some code that
looks at annotations and makes decisions based on whether or not the
annotation exists on a variable/class/method/etc, then the annotation
needs to be around -- but then you have a pretty clear reason & need
for keeping the annotation around.

This is partly why annotations are so frickin' cool.

Sam

On Tue, Mar 17, 2009 at 7:10 PM, Mike Dillon <mi...@embody.org> wrote:
> begin sebb quotation:
>> On 17/03/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
>> > sebb wrote:
>> >
>> > > The JCIP annotation jar
>> > >
>> > >
>> > http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html
>> > >
>> > > is now available from Maven repos, so it might be a good idea to start
>> > > using the annotations for code that requires Java 1.5+.
>> > >
>> > > Any objections if I add it as an optional dependency to HttpClient,
>> > > and start adding annotations to classes?
>> > >
>> > > I don't think we need to update the NOTICE file as we are not
>> > > republishing or creating a derived work, see end of Javadoc.
>> > >
>> > >
>> >
>> >  Sebastian
>> >
>> >  HttpClient would no longer compile without jcip-annotations.jar on the
>> > class path, would it?
>>
>> The jar is needed for compilation, however it's not needed at run-time.
>
> How is it not needed at run-time if @Retention=RUNTIME?
>
> -md
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Adding JCIP annotations to httpclient (and NIO)

Posted by Mike Dillon <mi...@embody.org>.
begin sebb quotation:
> On 17/03/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> > sebb wrote:
> >
> > > The JCIP annotation jar
> > >
> > >
> > http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html
> > >
> > > is now available from Maven repos, so it might be a good idea to start
> > > using the annotations for code that requires Java 1.5+.
> > >
> > > Any objections if I add it as an optional dependency to HttpClient,
> > > and start adding annotations to classes?
> > >
> > > I don't think we need to update the NOTICE file as we are not
> > > republishing or creating a derived work, see end of Javadoc.
> > >
> > >
> >
> >  Sebastian
> >
> >  HttpClient would no longer compile without jcip-annotations.jar on the
> > class path, would it?
> 
> The jar is needed for compilation, however it's not needed at run-time.

How is it not needed at run-time if @Retention=RUNTIME?

-md

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Adding JCIP annotations to httpclient (and NIO)

Posted by Oleg Kalnichevski <ol...@apache.org>.
sebb wrote:
> On 17/03/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
>> sebb wrote:
>>
>>> The JCIP annotation jar
>>>
>>>
>> http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html
>>> is now available from Maven repos, so it might be a good idea to start
>>> using the annotations for code that requires Java 1.5+.
>>>
>>> Any objections if I add it as an optional dependency to HttpClient,
>>> and start adding annotations to classes?
>>>
>>> I don't think we need to update the NOTICE file as we are not
>>> republishing or creating a derived work, see end of Javadoc.
>>>
>>>
>>  Sebastian
>>
>>  HttpClient would no longer compile without jcip-annotations.jar on the
>> class path, would it?
> 
> The jar is needed for compilation, however it's not needed at run-time.
> 

I see. No objections here.

Oleg

>>  Oleg
>>
>>
>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>>> For additional commands, e-mail: dev-help@hc.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>>  For additional commands, e-mail: dev-help@hc.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Adding JCIP annotations to httpclient (and NIO)

Posted by sebb <se...@gmail.com>.
On 17/03/2009, Oleg Kalnichevski <ol...@apache.org> wrote:
> sebb wrote:
>
> > The JCIP annotation jar
> >
> >
> http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html
> >
> > is now available from Maven repos, so it might be a good idea to start
> > using the annotations for code that requires Java 1.5+.
> >
> > Any objections if I add it as an optional dependency to HttpClient,
> > and start adding annotations to classes?
> >
> > I don't think we need to update the NOTICE file as we are not
> > republishing or creating a derived work, see end of Javadoc.
> >
> >
>
>  Sebastian
>
>  HttpClient would no longer compile without jcip-annotations.jar on the
> class path, would it?

The jar is needed for compilation, however it's not needed at run-time.

>  Oleg
>
>
>
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  For additional commands, e-mail: dev-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Adding JCIP annotations to httpclient (and NIO)

Posted by Oleg Kalnichevski <ol...@apache.org>.
sebb wrote:
> The JCIP annotation jar
> 
> http://jcip.net/annotations/doc/net/jcip/annotations/package-summary.html
> 
> is now available from Maven repos, so it might be a good idea to start
> using the annotations for code that requires Java 1.5+.
> 
> Any objections if I add it as an optional dependency to HttpClient,
> and start adding annotations to classes?
> 
> I don't think we need to update the NOTICE file as we are not
> republishing or creating a derived work, see end of Javadoc.
>

Sebastian

HttpClient would no longer compile without jcip-annotations.jar on the 
class path, would it?

Oleg

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org