source: doc/theses/andrew_beach_MMath/code/CrossCatch.java @ cf444b6

ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since cf444b6 was ea593a3, checked in by Andrew Beach <ajbeach@…>, 3 years ago

First draft of all the exception benchmarks. There is an issue with the Cforall linking.

  • Property mode set to 100644
File size: 480 bytes
Line 
1// Enter and Leave a Try Statement with a Termination Handler
2
3class NotRaisedException extends Exception {}
4
5public class CrossCatch {
6        public static void main(String[] args) {
7                int times = 1;
8                boolean shouldThrow = false;
9                if (0 < args.length) {
10                        times = Integer.parseInt(args[0]);
11                }
12
13                for (int count = 0 ; count < times ; ++count) {
14                        try {
15                                if (shouldThrow) {
16                                        throw new NotRaisedException();
17                                }
18                        } catch (NotRaisedException e) {
19                                // ...
20                        }
21                }
22        }
23}
Note: See TracBrowser for help on using the repository browser.