mcimadamore@1436: /* ksrini@2227: * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. mcimadamore@1436: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@1436: * mcimadamore@1436: * This code is free software; you can redistribute it and/or modify it mcimadamore@1436: * under the terms of the GNU General Public License version 2 only, as mcimadamore@1436: * published by the Free Software Foundation. mcimadamore@1436: * mcimadamore@1436: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@1436: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@1436: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@1436: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@1436: * accompanied this code). mcimadamore@1436: * mcimadamore@1436: * You should have received a copy of the GNU General Public License version mcimadamore@1436: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@1436: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@1436: * mcimadamore@1436: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA mcimadamore@1436: * or visit www.oracle.com if you need additional information or have any mcimadamore@1436: * questions. mcimadamore@1436: */ mcimadamore@1436: mcimadamore@1436: /* mcimadamore@1436: * @test emc@2050: * @bug 8002099 6499673 mcimadamore@1436: * @summary Add support for intersection types in cast expression darcy@1466: * @library /tools/javac/lib mcimadamore@1436: * @build JavacTestingAbstractProcessor ModelChecker mcimadamore@1511: * @compile -processor ModelChecker Model01.java mcimadamore@1436: */ mcimadamore@1436: mcimadamore@1436: import javax.lang.model.element.ElementKind; mcimadamore@1436: mcimadamore@1436: @Check mcimadamore@1436: class Test { mcimadamore@1436: mcimadamore@1436: interface A { mcimadamore@1436: @Member(ElementKind.METHOD) mcimadamore@1436: public void m1(); mcimadamore@1436: } mcimadamore@1436: mcimadamore@1436: interface B { mcimadamore@1436: @Member(ElementKind.METHOD) mcimadamore@1436: public void m2(); mcimadamore@1436: } mcimadamore@1436: mcimadamore@1436: void test(){ emc@2050: @IntersectionTypeInfo({"Test.A", "Test.B"}) mcimadamore@1436: Object o = (A & B)null; mcimadamore@1436: } mcimadamore@1436: }