summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/TryBlockRequiredCE.java
blob: e451789747ee5ac9bf3176b5b024646a06c4b191 (plain)
1
2
3
4
5
6
7
8
9
10
/** @testcase PUREJAVA try requires block JLS 14.19 */
public class TryBlockRequiredCE {
    void method() {
        int f = 0;
        try f = 2; catch(Error e) {}       // CE 6 { expected, catch w/o try
        try int i = 0; catch(Error e) {}   // CE 7 { expected, catch w/o try
        try f++; catch(Error e) {}         // CE 8 { expected, catch w/o try
    }
}