diff options
Diffstat (limited to 'tests/new/FalseThrowsCE.java')
-rw-r--r-- | tests/new/FalseThrowsCE.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/new/FalseThrowsCE.java b/tests/new/FalseThrowsCE.java new file mode 100644 index 000000000..89fb3c21d --- /dev/null +++ b/tests/new/FalseThrowsCE.java @@ -0,0 +1,15 @@ +import org.aspectj.testing.Tester; + +/** + * @testTarget compilerErrors.false.exceptions Throwable treated as checked, false compiler error + */ +public class FalseThrowsCE { + public static void main(String[] args) { + try { + System.getProperty("").toString(); // potential NPE, SecurityException + } catch (Throwable e) { // (false) CE: Throwable never thrown + String s = "got " + e; + } + Tester.check(true,"ok - compiled without error"); + } +} |