Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] set() pointcut for private fields

To add something to this:

Following the suggestion of a colleague, I tried this on a small toy example, and it worked fine. So this looks like the same problem that I had with ITDs, that would work fine on small toy examples, but on real sized applications (Tomcat) they don't work anymore. So I was wondering if with regard to load-time weaving, are there any extra requirements, like the order of JAR files on the classpath or stuff like that, which could have an influence on the weaving?

Jochen

On Nov 16, 2008, at 6:36 PM, Jochen Wuttke wrote:

Hi,

I have the following class and aspect structure:

public abstract class A {

	private List<?> list;

	public getList() {
		if ( list == null ) {
			list = m(); //m() creates a new list implementation
		}
		return list;
	}
}

public privileged aspect AA {

before(): set(* A.list) {
	//do something
	}
}

Using load time weaving the assignment to list is not getting advised. I tried different variants of the pointcut like set(* *.list), but that doesn't help. The aspect gets registered an other advice/pointcuts of the aspect do work as expected, so what am I doing wrong here?

	
Jochen

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top