ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since 55ad35c 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 | |
---|
3 | class NotRaisedException extends Exception {} |
---|
4 | |
---|
5 | public 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.