diff options
Diffstat (limited to 'tests/bugs/DeclaredExceptions.java')
-rw-r--r-- | tests/bugs/DeclaredExceptions.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/bugs/DeclaredExceptions.java b/tests/bugs/DeclaredExceptions.java new file mode 100644 index 000000000..9baec0c15 --- /dev/null +++ b/tests/bugs/DeclaredExceptions.java @@ -0,0 +1,28 @@ +import java.lang.reflect.Method; +import java.io.*; +import org.aspectj.testing.Tester; + +public class DeclaredExceptions { + public static void main(String[] args) throws Exception { + Class c = C.class; + Method m = c.getDeclaredMethod("m", new Class[0]); + Tester.checkEqual(m.getExceptionTypes().length, 1); + Tester.checkEqual(m.getExceptionTypes()[0], IOException.class); + + c = I.class; + m = c.getDeclaredMethod("m", new Class[0]); + Tester.checkEqual(m.getExceptionTypes().length, 1); + Tester.checkEqual(m.getExceptionTypes()[0], IOException.class); + } +} + +interface I {} + +class C {} + +aspect A { + public void C.m() throws IOException { + } + + public void I.m() throws IOException { } +}
\ No newline at end of file |