From ca12deb43edfb4a855ee2ca1f804836da1fb5336 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Thu, 7 Jul 2005 14:34:53 +0000 Subject: re PR java/21045 (Anonymous inner class constructor's exceptions can't be caught or thrown) 2005-07-07 Bryce McKinlay PR java/21045 * parse.y (add_exception_to_throws): New function. (purge_unchecked_exceptions): Removed. (get_constructor_super): Renamed from verify_constructor_super. Now returns the super constructor after verification. (java_complete_expand_method): Don't use purge_unchecked_exceptions or save/restore the exception list. (check_thrown_exceptions): Add uncaught exceptions in anonymous class initializers and constructors to the throws clause of the method. 2005-07-07 Bryce McKinlay * testsuite/libjava.compile/PR21045.java: New test. * testsuite/libjava.jacks/jacks.xfail: Remove 15.9.5.1-exception-1, 15.9.5.1-exception-3, 8.3.2-abrupt-6, 8.3.2-abrupt-7. From-SVN: r101713 --- libjava/testsuite/libjava.compile/PR21045.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 libjava/testsuite/libjava.compile/PR21045.java (limited to 'libjava/testsuite/libjava.compile/PR21045.java') diff --git a/libjava/testsuite/libjava.compile/PR21045.java b/libjava/testsuite/libjava.compile/PR21045.java new file mode 100644 index 0000000..3d34ee1 --- /dev/null +++ b/libjava/testsuite/libjava.compile/PR21045.java @@ -0,0 +1,11 @@ +public class PR21045 +{ + class InnerBase { + InnerBase() throws Exception, NullPointerException {} + } + void method() { + try { + InnerBase obj = new InnerBase() {}; + } catch (Exception e) {} + } +} -- cgit v1.1