Bug 47932 - or notation in introduction member declaration is taken as a method declaration
Summary: or notation in introduction member declaration is taken as a method declaration
Status: RESOLVED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-02 17:28 EST by minou CLA
Modified: 2004-01-12 05:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description minou CLA 2003-12-02 17:28:11 EST
The following code snippet triggers the problem

private String ( FSWhatIfCdsProcessor || FSCdsVersionManagerImpl).cdsIdentity;
private String ( FSWhatIfCdsProcessor || FSCdsVersionManagerImpl).getIdentity()
{ return cdsIdentity;}

As a workaround we have to duplicate the declaration for all types in the or
expression.
Comment 1 Jim Hugunin CLA 2004-01-12 05:04:38 EST
In AspectJ-1.1 we made this change to clarify the typing of the body of an 
inter-type declaration.  This is documented in the release notes at 
http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-
home/doc/README-11.html#SINGLE_INTERCLASS_TARGET

The suggested design in 1.1 is to use a marker interface if you want to put 
the same set of code on multiple classes, i.e.

interface HasIdentity {}
declare parents: FSWhatIfCdsProcessor || FSCdsVersionManagerImpl: HasIdentity;

private String HasIdentity.cdsIdentity;
private String HasIdentity.getIdentity() { return cdsIdentity;}

We believe this change will lead to cleaner code in the long run and don't 
intend to go back to the old design.  If this doesn't work for you, please 
raise the issue on the aspectj-users discussion list.