Bug 234932 - [grammar] Cannot add annotation on declare parents
Summary: [grammar] Cannot add annotation on declare parents
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-30 16:19 EDT by Andrew Eisenberg CLA
Modified: 2013-06-24 11:05 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2008-05-30 16:19:26 EDT
I want to add an annotation on a declare parents declaration, but can't.  This class has a compilation error:

package p1;


import org.aspectj.lang.annotation.SuppressAjWarnings;

public aspect AddsSerializable {
	
	@SuppressAjWarnings
  declare parents : p2.ToBeSerializable implements java.io.Serializable;
}
Comment 1 Andrew Clement CLA 2008-06-10 19:03:03 EDT
needs grammar change to allow it, should check status on other constructs too.
Comment 2 Andrew Clement CLA 2008-12-03 14:10:34 EST
no grammar changes in 1.6.3
Comment 3 Eric Bodden CLA 2009-05-19 22:02:39 EDT
I have a related issue:

When adding an annotation to an advice, then this annotation is not present on the ajc$... advice method:

	@after("foo")
	@AdviceName("bar")
	after(Object o): execution(* bar()) && target(o) {
		System.err.println("bar");		
	}

Here "after" has runtime retention. When I inspect the advice method for this advice, then I only see these annotations:

@org.aspectj.lang.annotation.AdviceName(value=foo)
@org.aspectj.lang.annotation.After(argNames=o, value=(execution(* foo()) && target(o)))
Comment 4 Andrew Clement CLA 2013-06-24 11:05:25 EDT
unsetting the target field which is currently set for something already released