aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features152/synchronization/CombiningPCDs1.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features152/synchronization/CombiningPCDs1.java')
-rw-r--r--tests/features152/synchronization/CombiningPCDs1.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/features152/synchronization/CombiningPCDs1.java b/tests/features152/synchronization/CombiningPCDs1.java
new file mode 100644
index 000000000..153c6134b
--- /dev/null
+++ b/tests/features152/synchronization/CombiningPCDs1.java
@@ -0,0 +1,27 @@
+// lock/this
+
+public aspect CombiningPCDs1 {
+
+ before(Foo f): lock() && this(f) {
+ System.err.println("advice running at "+thisJoinPoint.getSourceLocation());
+ }
+
+ public static void main(String[] args) {
+ Foo aFoo = new Foo();
+ aFoo.staticM();
+ aFoo.nonstaticM();
+ }
+
+ static class Foo {
+ public void nonstaticM() {
+ synchronized (this) {
+ System.err.println("non-static method running");
+ }
+ }
+ public static void staticM() {
+ synchronized (String.class) {
+ System.err.println("static method running");
+ }
+ }
+ }
+} \ No newline at end of file