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.

TryBlockRequiredCE.java 368B

12345678910
  1. /** @testcase PUREJAVA try requires block JLS 14.19 */
  2. public class TryBlockRequiredCE {
  3. void method() {
  4. int f = 0;
  5. try f = 2; catch(Error e) {} // CE 6 { expected, catch w/o try
  6. try int i = 0; catch(Error e) {} // CE 7 { expected, catch w/o try
  7. try f++; catch(Error e) {} // CE 8 { expected, catch w/o try
  8. }
  9. }