/* * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ abstract class C { private static class NE { } private static class E extends Exception { public String s; } private static class E1 extends E { } private static class E2 extends E { } private static class E3 extends E { } private static class E4 extends E { } private static class RE extends RuntimeException { } private interface I { void i(); } private static class IE1 extends E implements I { public void i() { } } private static class IE2 extends E implements I { public void i() { } } private static class F { F(X x) { } } abstract void f() throws E1, E2; abstract void g() throws IE1, IE2; void m() { try { f(); } catch (E1 | E2 e) { } try { f(); } catch (E2 | E1 e) { e.printStackTrace(); System.out.println(e.s); } try { f(); } catch (E2 | E1 e) { } catch (E e) { } catch (RE e) { } try { g(); } catch (IE1 | IE2 e) { E ee = e; I ii = e; e.i(); } try { g(); } catch (IE1 | IE2 e) { F f = new F<>(e); } try { g(); } catch (IE1 | IE2 e) { new F>(e); } try { } catch (RE | NE e) { } try { } catch (RE | NE e[]) { } try { f(); } catch (E | T e[]) { } catch(E e) { } try { f(); } catch (E | T e) { } try { f(); } catch (E1 | E ignore) { } try { f(); } catch (E | E1 ignore) { } try { f(); } catch (E | E ignore) { } try { f(); } catch (E1 | E2 | E3 e) { } try { f(); } catch (E3 | E4 | RE e) { } catch (E e) { } try { f(); } catch (E3 | E4 | RE e) { } try { f(); } catch (E e) { } catch (E1 | E3 e) { } try { f(); } catch (E1 | E2 e) { } catch (E2 e) { } try { f(); } catch (E1 | E2 e) { E2 ee = e; } try { f(); } catch (E1 | E2 e) { e = new E1(); } try { f(); } catch (E1 | E2 e) { e = new E(); } try { g(); } catch (IE1 | IE2 e) { Class clazz1 = e.getClass(); Class clazz2 = e.getClass(); Class clazz3 = e.getClass(); } try { f(); } catch (int | E e) { } } } class D { static class E extends Exception { } static interface I { void i(); } static class E1 extends E implements I { public void i() { } } static class E2 extends E implements I { public void i() { } } void m(boolean f) { try { if (f) throw new E1(); else throw new E2(); } catch (E1|E2 e) { System.out.println(e); } } } class AssignFinal { private final String value; public AssignFinal() { try { value = create(); } catch (ClassNotFoundException | IllegalAccessException e) { value = ""; } } public String getValue() { return value; } public static native T create() throws ClassNotFoundException, IllegalAccessException; }