Bug 273655 - various issues with annotation binding (and value binding)
Summary: various issues with annotation binding (and value binding)
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows NT
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-24 17:26 EDT by Andrew Clement CLA
Modified: 2010-03-15 15:58 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2009-04-24 17:26:41 EDT
This code works:
---
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;


public class X {
 public static void main(String[] args) {
	new X().run();
}
 
 public void run() {
	 m();
 }
 
 @Colored public void m() {}
 
}

@Retention(RetentionPolicy.RUNTIME) @interface Colored {}

aspect Asp {
	
	void around(Colored c): execution(* X.m(..)) && @annotation(c) {
		proceed(c);
	}
}
---

But the proceed doesn't really need to take the 'c' as it doesn't modify the annotation on the join point when we proceed upon it.  Same issue with annotation value binding and proceed.

Also see this related stack trace from https://bugs.eclipse.org/bugs/show_bug.cgi?id=273628#c1


C:\temp\ajcSandbox\aspectj16_2\ajcTest30146.tmp\AnnotationAspect.java:0::0
Internal compiler error
java.lang.ArrayIndexOutOfBoundsException: 1
        at
org.aspectj.weaver.bcel.BcelWeaver.validateSingleBranchRecursion(BcelWeaver.java:808)
        at
org.aspectj.weaver.bcel.BcelWeaver.validateSingleBranchRecursion(BcelWeaver.java:791)