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 <[email protected]> wrote: > > begin sebb quotation: > >> On 17/03/2009, Oleg Kalnichevski <[email protected]> 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: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
