aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features152/synchronization/ParsingAndMatching3.java
blob: 7a6fee6c2abc2954c85ef4b3a8e797d922c76b52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// lock and non-static context

public aspect ParsingAndMatching3 {

	before(): lock() {
		System.err.println("Advice running at "+thisJoinPoint.getSourceLocation());
	}
	
	public static void main(String[] args) {
		new Foo().nonstaticM();
	}
	
	static class Foo {
		public void nonstaticM() {
			synchronized (String.class) {
				System.err.println("non-static method running");
			}
		}
	}
}