834N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
834N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
834N/A *
834N/A * This code is free software; you can redistribute it and/or modify it
834N/A * under the terms of the GNU General Public License version 2 only, as
834N/A * published by the Free Software Foundation.
834N/A *
834N/A * This code is distributed in the hope that it will be useful, but WITHOUT
834N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
834N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
834N/A * version 2 for more details (a copy is included in the LICENSE file that
834N/A * accompanied this code).
834N/A *
834N/A * You should have received a copy of the GNU General Public License version
834N/A * 2 along with this work; if not, write to the Free Software Foundation,
834N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
834N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
834N/A */
834N/A
834N/A/*
834N/A * @test
834N/A * @bug 6788531
834N/A * @summary Tests public method lookup problem in Statement
834N/A * @author Sergey Malenkov
834N/A */
834N/A
834N/Aimport java.beans.Statement;
834N/A
834N/Apublic class Test6788531 {
834N/A public static void main(String[] args) throws Exception {
834N/A new Statement(new Private(), "run", null).execute();
834N/A new Statement(new PrivateGeneric(), "run", new Object[] {"generic"}).execute();
834N/A }
834N/A
834N/A public static class Public {
834N/A public void run() {
834N/A throw new Error("method is overridden");
834N/A }
834N/A }
834N/A
834N/A static class Private extends Public {
834N/A public void run() {
834N/A System.out.println("default");
834N/A }
834N/A }
834N/A
834N/A public static class PublicGeneric<T> {
834N/A public void run(T object) {
834N/A throw new Error("method is overridden");
834N/A }
834N/A }
834N/A
834N/A static class PrivateGeneric extends PublicGeneric<String> {
834N/A public void run(String string) {
834N/A System.out.println(string);
834N/A }
834N/A }
834N/A}