diff options
Diffstat (limited to 'tests/bugs150/SynchronizedInterfaceMethods.aj')
-rw-r--r-- | tests/bugs150/SynchronizedInterfaceMethods.aj | 25 |
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 |