Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: A switch oddity



Charles,

Modifiers on inter-type declarations refer only to usage by the aspect and
do no determine the actual Java visibility. For example a private ITD field
is actually public WRT Java but given a mangled name so that it cannot be
used by other types. The same applies to final i.e. a final ITD field can
only be set in the scope of an initializer in the aspect that declares it.
These rules are policed by the AspectJ compiler. A final ITD field could
not be declared final WRT Java because otherwise its value could not be set
in the scope of the aspect (static final fields can only be set in a static
initializer and final fields in a constructor).

The implementation of final has some unfortunate side effects as you have
discovered.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/



Back to the top