[JSR308] array-valued annotations

Ted Neward ted at tedneward.com
Sun Jan 28 20:18:53 EST 2007


>   Unfortunately not all annotations are presented in the bytecode (i.e.
> annotations on local variable types are not). Hopefully JSR 308 will
> address that limitation.
>
We didn't support capturing annotations in anything but source scope because
there is simply no place to put them. Believe me, we debated long and hard
about this. I even suggested that debug information (where local variable
names are stored, and thus a perfectly valid place to store local variable
annotation data) could be made omnipresent, and was promptly shot down by
every single member of the EG. Unless this JSR has the ability to mandate a
new JVM-level attribute that the JVM implementers will recognize and offer
up via a Reflective API that doesn't yet exist, I think you're going to have
to punt on this one.

Ted Neward
Java, .NET, XML Services
Consulting, Teaching, Speaking, Writing
http://www.tedneward.com
 

> -----Original Message-----
> From: jsr308-bounces at lists.csail.mit.edu [mailto:jsr308-
> bounces at lists.csail.mit.edu] On Behalf Of Eugene Kuleshov
> Sent: Sunday, January 28, 2007 2:53 PM
> To: jsr308 at lists.csail.mit.edu
> Subject: Re: [JSR308] array-valued annotations
> 
> Joe Darcy wrote:
> >>  Joe, can you please elaborate why is that would be incompatible?
> >> Array-level annotation will be a new construct that won't be present
> >> in the old code.
> > Yes, but if existing code, like the core JDK libraries, is retrofitted
> > to use these new features, than old code and new code will interact
> > and a source incompatibility could be introduced.
> >
> > Even if such retrofitting is not done (and not intended), the
> > complications of having fundamentally different de facto typing rules
> > for arrays types with certain kinds of annotations and array types
> > without those annotations is undesirable (even if it is necessary).
> > During JDK 5 development, the rules for combining arrays and generics
> > evolved, but they are still a source of complexity and confusion.
> > Adding news rules for annotations could exacerbate the situation.
>   Still don't see why annotations will be issue there. Annotation
> facility should be orthogonal to type system, even so it is linked to
> the types of specific instances (fields, methods, params, local
> variables, etc).
> >>  However new code and new annotation processors (not only the source
> >> level ones like in JSR 269) could use these new constructs.
> > FYI, both apt and JSR 269 annotation processors can operate on class
> > files too.
>   Unfortunately not all annotations are presented in the bytecode (i.e.
> annotations on local variable types are not). Hopefully JSR 308 will
> address that limitation.
> 
>   regards,
>   Eugene
> 
> 
> 
> _______________________________________________
> JSR308 mailing list
> JSR308 at lists.csail.mit.edu
> https://lists.csail.mit.edu/mailman/listinfo/jsr308
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.17.12/655 - Release Date: 1/28/2007
> 1:12 PM
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.12/655 - Release Date: 1/28/2007
1:12 PM
 




More information about the JSR308 mailing list