[JSR308] array-valued annotations
Eugene Kuleshov
eu at javatx.org
Sun Jan 28 20:28:46 EST 2007
Ted Neward wrote:
>> Doesn't this represent a fairly conservative view of what constitutes
>> a type? I certainly consider such annotations as part of the type
>> signature.
> onservative or not, two classes whose only differentiation (including name)
> is the presence or lack thereof of an annotation, is illegal. The presence
> or absence of an annotation does not show up in the JVM-level signature, and
> therefore cannot be used to differentiate in method overloading. Ditto for
> fields. The annotation is not part of the signature, and to change that
> would be a fairly drastic change throughout the JVM, I would think.
>
It seems like the major concern about annotating array types is coming
from the type-related limitation (i.e. class-level).
On the other hand we have fields, method parameters and return types
and types of the local variables. Even they all could use same array (or
non-array) types, those types can have different annotations in each
particular case. So, annotation processor, or static code analyzer
(source or bytecode level) could react differently on those types linked
to the values for each specific case.
regards,
Eugene
More information about the JSR308
mailing list