aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features152/synchronization/transformed/One.java
blob: 49a80c9d7f546147daa356bdf15da8990fb7aa4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public aspect One {
	public static void main(String[] args) {
		
	}
	
	before(): call(* println(..)) {}
	
	//	 ... that does something ...
	public synchronized void b() {
		System.out.println("hello");
	}
	
	// ... that includes try/catch ...
	public synchronized void c() {
		try {
			File f = new File("fred");
			FileInputStream fis = new FileInputStream(f);
		} catch (IOException ioe) {
			System.out.println("bang");
		}
	}
	
	// ... with nested synchronized blocks ...
	public synchronized void e() {
		System.out.println("hello");
		synchronized (new String()) {
			System.out.println("other");
		}
	}

}

aspect OneX {
  pointcut p(): lock();
}