您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }