aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/SynchronizedInterfaceMethods.aj
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-09-02 14:38:11 +0000
committeracolyer <acolyer>2005-09-02 14:38:11 +0000
commitb17ff4ed2d55ec24f1f1a6f3fe70ffd91ac18e62 (patch)
tree1a81ea166acb33fd033592a43e0ed503509116eb /tests/bugs150/SynchronizedInterfaceMethods.aj
parente29ca524955b2112bbf63e740ca71516c13fbb4c (diff)
downloadaspectj-b17ff4ed2d55ec24f1f1a6f3fe70ffd91ac18e62.tar.gz
aspectj-b17ff4ed2d55ec24f1f1a6f3fe70ffd91ac18e62.zip
second part of test and fix for pr102212 - synchronized itdm on interfaces generate synchronized members for implementing classes, but not for the interface itself.
Diffstat (limited to 'tests/bugs150/SynchronizedInterfaceMethods.aj')
-rw-r--r--tests/bugs150/SynchronizedInterfaceMethods.aj25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/bugs150/SynchronizedInterfaceMethods.aj b/tests/bugs150/SynchronizedInterfaceMethods.aj
new file mode 100644
index 000000000..9611f3434
--- /dev/null
+++ b/tests/bugs150/SynchronizedInterfaceMethods.aj
@@ -0,0 +1,25 @@
+import java.lang.reflect.*;
+
+public class SynchronizedInterfaceMethods {
+
+ public static void main(String[] args) throws NoSuchMethodException {
+ Class myClass = SynchronizedInterfaceMethods.class;
+ Method m = myClass.getMethod("foo");
+ if (!Modifier.isSynchronized(m.getModifiers())) throw new RuntimeException("Expecting method on class to be synchronized");
+ Class iClass = I.class;
+ Method im = iClass.getMethod("foo");
+ if (Modifier.isSynchronized(im.getModifiers())) throw new RuntimeException("Interface method must NOT be synchronized");
+ }
+
+
+}
+
+interface I {}
+
+
+aspect A {
+
+ public synchronized void I.foo() {}
+
+ declare parents : SynchronizedInterfaceMethods implements I;
+} \ No newline at end of file