GenericsAndPackages.java revision 2870:701e145238da
11556Srgrimes/*
21556Srgrimes * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
31556Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41556Srgrimes *
51556Srgrimes * This code is free software; you can redistribute it and/or modify it
61556Srgrimes * under the terms of the GNU General Public License version 2 only, as
71556Srgrimes * published by the Free Software Foundation.
81556Srgrimes *
91556Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT
101556Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
111556Srgrimes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
121556Srgrimes * version 2 for more details (a copy is included in the LICENSE file that
131556Srgrimes * accompanied this code).
141556Srgrimes *
151556Srgrimes * You should have received a copy of the GNU General Public License version
161556Srgrimes * 2 along with this work; if not, write to the Free Software Foundation,
171556Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
181556Srgrimes *
191556Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
201556Srgrimes * or visit www.oracle.com if you need additional information or have any
211556Srgrimes * questions.
221556Srgrimes */
231556Srgrimes
241556Srgrimes/**
251556Srgrimes * @test
261556Srgrimes * @bug     5073060 8075610
271556Srgrimes * @summary Package private members not found for intersection types
281556Srgrimes * @author  Bruce Eckel
291556Srgrimes * see      http://www.artima.com/forums/flat.jsp?forum=106&thread=136204
301556Srgrimes * @compile GenericsAndPackages.java
311556Srgrimes */
321556Srgrimes
331556Srgrimespackage code;
341556Srgrimes
3520411Ssteveinterface HasColor {
361556Srgrimes    String getColor();
371556Srgrimes}
381556Srgrimes
391556Srgrimesclass Dimension {
401556Srgrimes    int x, y, z;
4135773Scharnier}
4236002Scharnier
4335773Scharnierclass ColoredDimension<T extends Dimension & HasColor> {
441556Srgrimes    T item;
4599109Sobrien    ColoredDimension(T item) { this.item = item; }
4699109Sobrien    T getItem() { return item; }
471556Srgrimes    String f() { return item.getColor(); }
4836002Scharnier    int getX() { return item.x; }
491556Srgrimes}
501556Srgrimes