Bug 133340

Summary: [annotations] Evaluation of Annotations in if-pointcut
Product: [Tools] AspectJ Reporter: Florian Forster <florian.forster>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P5 CC: aclement
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Florian Forster CLA 2006-03-27 06:42:14 EST
The evaluation of pointcuts refering to annotations can be done statically. However the AspectJ compiler is not capable of doing so. Compiling
@TypeLevel(2)
public aspect Alpha {
	void around(): (adviceexecution()
		&& @within(TypeLevel)
		&& if(TypeLevel.value() < 2))
		|| execution (* *(..)) {
			System.out.println("Test");
		}
	}

will result in an error. However it would be desirable if the AspectJ Compiler would evaluate these pointcuts at compiletime.
Comment 1 Andrew Clement CLA 2006-03-27 07:52:15 EST
some context for this bug .. I think it has been raised based on a discussion I had at AOSD.  Annotations are entirely static so it *could* be possible to do something - however I'd not thought the testcase here was the use case, I'd assumed the use case was something more like declare warning.