summaryrefslogtreecommitdiffstats
path: root/tests/features152/synchronization/transformed/One.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features152/synchronization/transformed/One.java')
-rw-r--r--tests/features152/synchronization/transformed/One.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/features152/synchronization/transformed/One.java b/tests/features152/synchronization/transformed/One.java
new file mode 100644
index 000000000..49a80c9d7
--- /dev/null
+++ b/tests/features152/synchronization/transformed/One.java
@@ -0,0 +1,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();
+}