mcimadamore@156: /* ohair@554: * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. mcimadamore@156: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mcimadamore@156: * mcimadamore@156: * This code is free software; you can redistribute it and/or modify it mcimadamore@156: * under the terms of the GNU General Public License version 2 only, as mcimadamore@156: * published by the Free Software Foundation. mcimadamore@156: * mcimadamore@156: * This code is distributed in the hope that it will be useful, but WITHOUT mcimadamore@156: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mcimadamore@156: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mcimadamore@156: * version 2 for more details (a copy is included in the LICENSE file that mcimadamore@156: * accompanied this code). mcimadamore@156: * mcimadamore@156: * You should have received a copy of the GNU General Public License version mcimadamore@156: * 2 along with this work; if not, write to the Free Software Foundation, mcimadamore@156: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mcimadamore@156: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * questions. mcimadamore@156: */ mcimadamore@156: mcimadamore@156: /* mcimadamore@156: * @test mcimadamore@156: * @bug 6487370 mcimadamore@156: * @author Maurizio Cimadamore mcimadamore@156: * @summary javac incorrectly gives ambiguity warning with override-equivalent abstract inherited methods mcimadamore@156: */ mcimadamore@156: mcimadamore@156: public class T6487370 { mcimadamore@156: mcimadamore@156: interface I1 { mcimadamore@156: String m(Number n); mcimadamore@156: } mcimadamore@156: mcimadamore@156: interface I2 { mcimadamore@156: Object m(Number n); mcimadamore@156: } mcimadamore@156: mcimadamore@156: static abstract class X implements I1, I2 { mcimadamore@156: String test() { mcimadamore@156: return m(0.0f); mcimadamore@156: } mcimadamore@156: } mcimadamore@156: mcimadamore@156: static class W extends X { mcimadamore@156: public String m(Number n) { mcimadamore@156: return "Hello!"; mcimadamore@156: } mcimadamore@156: } mcimadamore@156: mcimadamore@156: public static void main(String args[]) { mcimadamore@156: System.out.println(new W().test()); mcimadamore@156: } mcimadamore@156: }