You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FalseThrowsCE.java 457B

123456789101112131415
  1. import org.aspectj.testing.Tester;
  2. /**
  3. * @testTarget compilerErrors.false.exceptions Throwable treated as checked, false compiler error
  4. */
  5. public class FalseThrowsCE {
  6. public static void main(String[] args) {
  7. try {
  8. System.getProperty("").toString(); // potential NPE, SecurityException
  9. } catch (Throwable e) { // (false) CE: Throwable never thrown
  10. String s = "got " + e;
  11. }
  12. Tester.check(true,"ok - compiled without error");
  13. }
  14. }