[Java Spec Report] RE: [metadata-jsr] Annotations and initializers

"Roly Perera" <[email protected]> Sun, 9 May 2004 23:02:21 +0100
Newsgroups gmane.comp.java.spec-report
Organization Ergnosis Ltd
Message-ID <[email protected]>
I'm certainly with you on the regularity argument; I was mainly trying
to anticipate the standard response ("why would anyone want to do
that?", etc etc).

One issue is that static initializers don=92t turn into a single method -
instead the concatenation of all the static initializers of the class
turn into a method.

That doesn't rule out annotations on <clinit>, we would just need to do
some extra work in the spec.  (Maybe the regular treatment is to
concatenate the annotations, and then apply the rules that would apply
to a single method declaration - e.g. no duplicate annotations.)

Maybe Josh and/or Neal have some more immediate experience with
implementing annotations that might help clear this up.

Roly

> -----Original Message-----
> From: [email protected]=20
> [mailto:[email protected]] On Behalf Of Ted Neward
> Sent: 09 May 2004 22:46
> To: [email protected];=20
> [email protected]
> Cc: [email protected]
> Subject: RE: [metadata-jsr] Annotations and initializers
>=20
>=20
> Why wouldn't we allow this? I grant you, it doesn't perhaps=20
> make sense, but I see no reason to exclude it--pre- or=20
> post-processor utilities may wish to make use of it. (It just=20
> seems right that we should allow this simply from a=20
> consistency's point of view, since a static initializer turns=20
> into a method under the hood.)
>=20
> Ted Neward
> Author, Instructor, Presenter: Java and .NET http://www.neward.net/ted
>=20
> -----Original Message-----
> From: [email protected]=20
> [mailto:[email protected]] On Behalf Of Roly Perera
> Sent: Friday, May 07, 2004 2:29 AM
> To: [email protected]
> Cc: [email protected]
> Subject: [metadata-jsr] Annotations and initializers
>=20
> Maybe this is already covered, but in the absence of an=20
> official 1.5 grammar or integrated spec it is probably=20
> sensible for the JSR-175 to clarify that the following is illegal:
>=20
> class X {
>     @Blah static {
>     }
> }
>=20
> This is a declaration context where modifiers are allowed,=20
> but annotations are not.  I've found at least one compiler=20
> which accepts it, although javac does not.
>=20
> - Roly
>=20
>=20
> Roly Perera
> [email protected]
>=20
> +------------------------------------------------------------------+
> + Ergnosis Ltd                  www.ergnosis.com                   +
> + Third Floor                                                      +
> + 14 King Square                CTRL + ALT + PARADIGM SHIFT        +
> + Bristol BS2 8JJ, U.K.         www.ergnosis.com/employment        +
> + +44 117 924 8915 (telephone)  Java Spec Report:                  +
> + +44 870 421 1389 (fax)        www.ergnosis.com/java-spec-report  +
> +------------------------------------------------------------------+
>=20
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.590 / Virus Database: 373 - Release Date: 16/02/2004
>=20=20
>=20
> _______________________________________________
> metadata-jsr mailing list
> [email protected]=20
> http://altair.cs.oswego.edu/mailman/listinfo/metadata-> jsr
>=20
>=20
>=20
> _______________________________________________
>=20
> metadata-jsr mailing list
> [email protected]=20
> http://altair.cs.oswego.edu/mailman/listinfo/metadata-> jsr
>=20
>=20
> ---
> Incoming mail is certified Virus Free.
> Checked by=20
> AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.590 / Virus Database: 373 - Release Date: 16/02/2004
>=20=20
>=20

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.590 / Virus Database: 373 - Release Date: 16/02/2004
=20



To unsubscribe from this mailing list, send an email to:
[email protected]
=20
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/java-spec-report/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
=20