codegen: handle exceptions of a method
[mate.git] / tests / Exception3.java
diff --git a/tests/Exception3.java b/tests/Exception3.java
new file mode 100644 (file)
index 0000000..c9b9fed
--- /dev/null
@@ -0,0 +1,35 @@
+package tests;
+
+public class Exception3 {
+       public static void main(String []args) {
+               try {
+                       throw new NullPointerException();
+               } catch (NullPointerException _) {
+                       System.out.printf("NullPointerException\n");
+               } catch (IllegalArgumentException _) {
+                       System.out.printf("IllegalArgumentException\n");
+               }
+               try {
+                       throw new NullPointerException();
+               } catch (IllegalArgumentException _) {
+                       System.out.printf("IllegalArgumentException\n");
+               } catch (NullPointerException _) {
+                       System.out.printf("NullPointerException\n");
+               }
+               try {
+                       throw new IllegalArgumentException();
+               } catch (NullPointerException _) {
+                       System.out.printf("NullPointerException\n");
+               } catch (IllegalArgumentException _) {
+                       System.out.printf("IllegalArgumentException\n");
+               }
+               try {
+                       throw new IllegalArgumentException();
+               } catch (IllegalArgumentException _) {
+                       System.out.printf("IllegalArgumentException\n");
+               } catch (NullPointerException _) {
+                       System.out.printf("NullPointerException\n");
+               }
+               System.out.printf("hmmm\n");
+       }
+}