Bug 168982 - Produce an error on generic concrete @Aspect aspect
Summary: Produce an error on generic concrete @Aspect aspect
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.6.1   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-23 14:17 EST by Ramnivas Laddad CLA
Modified: 2008-06-11 18:30 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ramnivas Laddad CLA 2006-12-23 14:17:33 EST
Compiler should produce an error when it encounters a concrete @AspectJ aspect that is also parameterized. This way @AspectJ aspects will have the same behavior as their code-style counterpart (which correctly do produce an error).

Currently, generic concrete aspects such as the following are silently ignored (i.e. advice in them don't apply).

package tracing;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class TracingAspect2<T> {
	@Pointcut("execution(* *(..))")
	public void traced() {}
	
	@Before("traced()")
	public void log(JoinPoint thisJoinPoint) {
		System.out.println("Entering ");
	}
}
Comment 1 Andrew Clement CLA 2007-10-26 05:05:50 EDT
Do this if it doesn't cost too much to calculate
Comment 2 Andrew Clement CLA 2008-06-11 18:30:29 EDT
fixed - message comes out 'late' (as in during weaving rather than compiling) so we can catch those using javac and trying to sneak it in that way ;)

This is the 35th bug I've addressed in two days, 1.6.1 is looking great.