| 20 | } |
| 21 | |
| 22 | public class ExtraFeatures { |
| 23 | public static void f() throws MyException2 { |
| 24 | System.out.println( |
| 25 | "Throwing MyException2 from f()"); |
| 26 | throw new MyException2(); |
| 27 | } |
| 28 | public static void g() throws MyException2 { |
| 29 | System.out.println( |
| 30 | "Throwing MyException2 from g()"); |
| 31 | throw new MyException2("Originated in g()"); |
| 32 | } |
| 33 | public static void h() throws MyException2 { |
| 34 | System.out.println( |
| 35 | "Throwing MyException2 from h()"); |
| 36 | throw new MyException2("Originated in h()", 47); |
| 37 | } |
| 38 | public static void main(String[] args) { |
| 39 | try { |
| 40 | f(); |
| 41 | } catch(MyException2 e) { |
| 42 | e.printStackTrace(System.out); |
| 43 | } |
| 44 | try { |
| 45 | g(); |
| 46 | } catch(MyException2 e) { |
| 47 | e.printStackTrace(System.out); |
| 48 | } |
| 49 | try { |
| 50 | h(); |
| 51 | } catch(MyException2 e) { |
| 52 | e.printStackTrace(System.out); |
| 53 | System.out.println("e.val() = " + e.val()); |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | /* Output: |
| 58 | Throwing MyException2 from f() |
| 59 | MyException2: Detail Message: 0 null |
nothing calls this directly
no outgoing calls
no test coverage detected