mcimadamore@735: /* jjg@988: * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. mcimadamore@735: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@735: * mcimadamore@735: * This code is free software; you can redistribute it and/or modify it mcimadamore@735: * under the terms of the GNU General Public License version 2 only, as mcimadamore@735: * published by the Free Software Foundation. mcimadamore@735: * mcimadamore@735: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@735: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@735: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@735: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@735: * accompanied this code). mcimadamore@735: * mcimadamore@735: * You should have received a copy of the GNU General Public License version mcimadamore@735: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@735: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@735: * mcimadamore@735: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA mcimadamore@735: * or visit www.oracle.com if you need additional information or have any mcimadamore@735: * questions. mcimadamore@735: */ mcimadamore@735: mcimadamore@735: import javax.lang.model.element.ElementKind; mcimadamore@735: mcimadamore@735: @Check mcimadamore@735: class Test { mcimadamore@735: mcimadamore@735: class A extends Exception { mcimadamore@735: @Member(ElementKind.METHOD) mcimadamore@735: public void m() {}; mcimadamore@735: @Member(ElementKind.FIELD) mcimadamore@735: public Object f; mcimadamore@735: } mcimadamore@735: mcimadamore@735: class B1 extends A {} mcimadamore@735: class B2 extends A {} mcimadamore@735: mcimadamore@735: void test(){ mcimadamore@735: try { mcimadamore@735: if (true) mcimadamore@735: throw new B1(); mcimadamore@735: else mcimadamore@735: throw new B2(); mcimadamore@735: } jjg@988: catch(@UnionTypeInfo({"Test.B1", "Test.B2"}) B1 | B2 ex) { } mcimadamore@735: } mcimadamore@735: }