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