1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/Exceptions.java Sat Dec 08 08:19:46 2012 +0100
1.3 @@ -0,0 +1,36 @@
1.4 +/*
1.5 + * To change this template, choose Tools | Templates
1.6 + * and open the template in the editor.
1.7 + */
1.8 +package org.apidesign.vm4brwsr;
1.9 +
1.10 +/**
1.11 + *
1.12 + * @author tom
1.13 + */
1.14 +public class Exceptions {
1.15 +
1.16 + public static int methodWithTryCatchNoThrow() {
1.17 + int res = 0;
1.18 + try {
1.19 + res = 1;
1.20 + } catch (IllegalArgumentException e) {
1.21 + res = 2;
1.22 + }
1.23 + //join point
1.24 + return res;
1.25 + }
1.26 +
1.27 + public static int methodWithTryCatchThrow() {
1.28 + int res = 0;
1.29 + try {
1.30 + res = 1;
1.31 + throw new IllegalArgumentException();
1.32 + } catch (IllegalArgumentException e) {
1.33 + res = 2;
1.34 + }
1.35 + //join point
1.36 + return res;
1.37 + }
1.38 +
1.39 +}