[JSR308] array-valued annotations
Eugene Kuleshov
eu at javatx.org
Sun Jan 28 17:53:12 EST 2007
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
More information about the JSR308
mailing list