mcimadamore@155: /* mcimadamore@155: * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. mcimadamore@155: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@155: * mcimadamore@155: * This code is free software; you can redistribute it and/or modify it mcimadamore@155: * under the terms of the GNU General Public License version 2 only, as mcimadamore@155: * published by the Free Software Foundation. mcimadamore@155: * mcimadamore@155: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@155: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@155: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@155: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@155: * accompanied this code). mcimadamore@155: * mcimadamore@155: * You should have received a copy of the GNU General Public License version mcimadamore@155: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@155: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@155: * mcimadamore@155: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, mcimadamore@155: * CA 95054 USA or visit www.sun.com if you need additional information or mcimadamore@155: * have any questions. mcimadamore@155: */ mcimadamore@155: mcimadamore@155: /* mcimadamore@155: * @test mcimadamore@155: * @bug 6711619 mcimadamore@155: * mcimadamore@155: * @summary javac doesn't allow access to protected members in intersection types mcimadamore@155: * @author Maurizio Cimadamore mcimadamore@155: * mcimadamore@155: * @compile/fail/ref=T6711619a.out -XDrawDiagnostics T6711619a.java mcimadamore@155: */ mcimadamore@155: class T6711619a { mcimadamore@155: mcimadamore@155: static class A { mcimadamore@155: private void a() {} mcimadamore@155: private A a; mcimadamore@155: } mcimadamore@155: static class B extends A { mcimadamore@155: private B b() {} mcimadamore@155: private B b; mcimadamore@155: } mcimadamore@155: static interface I{ mcimadamore@155: void i(); mcimadamore@155: } mcimadamore@155: static interface I1{ mcimadamore@155: void i1(); mcimadamore@155: } mcimadamore@155: static class E extends B implements I, I1{ mcimadamore@155: public void i() {} mcimadamore@155: public void i1() {} mcimadamore@155: } mcimadamore@155: static class C{ mcimadamore@155: T t; mcimadamore@155: W w; mcimadamore@155: C(W w, T t) { mcimadamore@155: this.w = w; mcimadamore@155: this.t = t; mcimadamore@155: } mcimadamore@155: } mcimadamore@155: mcimadamore@155: static void testMemberMethods(C arg) { mcimadamore@155: arg.t.a(); mcimadamore@155: arg.t.b(); mcimadamore@155: } mcimadamore@155: mcimadamore@155: static void testMemberFields(C arg) { mcimadamore@155: A ta; B tb; mcimadamore@155: ta = arg.t.a; mcimadamore@155: tb = arg.t.b; mcimadamore@155: ta = arg.w.a; mcimadamore@155: tb = arg.w.b; mcimadamore@155: } mcimadamore@155: }