Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Xlint:shadowNotInStructure - should I care and why?

Hello,

consider the following example aspect:

package test;
public aspect Locals {
	static void a() {
	}
	pointcut callOfA() : call(void test.Locals.a());
	after() : callOfA() {
		System.out.println("a() called at "+thisJoinPoint.getSourceLocation());
	}
	public static void main(String[] argv) {
		final class Local implements Runnable {
			public void run() {
				a(); // <-- warning here
			}
		}
		Local local = new Local();
		local.run();
		Runnable inner = new Runnable() {
			public void run() {
				a(); // <-- and here
			}
		};
		inner.run();
		Nested nested = new Nested();
		nested.run();
	}
	private static class Nested implements Runnable {
		public void run()
		{
			a();
		}
	}	
}

On the lines marked in the source AJDT compiler reports a warning:
"the shadow for this join point is not exposed in the strucuture model: method-call(void test.Locals.a()) [Xlint:shadowNotInStructure]"

running the program though displays:
a() called at Locals.aj:12
a() called at Locals.aj:19
a() called at Locals.aj:29

Which means that advice was woven as I would expect it.

My question #1 is then: what does this warning mean, and should I be concernced?

My question #2 is where do I find description of avaliable Xlint checks? (I took a quick look at AJ & AJTD docs, and Googled a bit, to no avail)

Rafal


Back to the top