jjg@1455: /* jjg@1455: * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. jjg@1455: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@1455: * jjg@1455: * This code is free software; you can redistribute it and/or modify it jjg@1455: * under the terms of the GNU General Public License version 2 only, as jjg@1455: * published by the Free Software Foundation. jjg@1455: * jjg@1455: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@1455: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@1455: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@1455: * version 2 for more details (a copy is included in the LICENSE file that jjg@1455: * accompanied this code). jjg@1455: * jjg@1455: * You should have received a copy of the GNU General Public License version jjg@1455: * 2 along with this work; if not, write to the Free Software Foundation, jjg@1455: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@1455: * jjg@1455: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jjg@1455: * or visit www.oracle.com if you need additional information or have any jjg@1455: * questions. jjg@1455: */ jjg@1455: jjg@1455: /* jjg@1455: * @test jjg@1465: * @bug 8004832 jjg@1465: * @summary Add new doclint package jjg@1455: * @build DocLintTester jjg@1455: * @run main DocLintTester -Xmsgs:all OverridesTest.java jjg@1455: */ jjg@1455: jjg@1455: /* jjg@1455: * This is a test that missing comments on methods may be inherited jjg@1455: * from overridden methods. As such, there should be no errors due jjg@1455: * to missing comments (or any other types of error) in this test. jjg@1455: */ jjg@1455: jjg@1455: /** An interface. */ jjg@1455: interface I1 { jjg@1455: /** jjg@1455: * A method jjg@1455: * @param p a param jjg@1455: * @throws Exception an exception jjg@1455: * @return an int jjg@1455: */ jjg@1455: int m(int p) throws Exception; jjg@1455: } jjg@1455: jjg@1455: /** An extending interface. */ jjg@1455: interface I2 extends I1 { } jjg@1455: jjg@1455: /** An abstract class. */ jjg@1455: abstract class C1 { jjg@1455: /** jjg@1455: * A method jjg@1455: * @param p a param jjg@1455: * @throws Exception an exception jjg@1455: * @return an int jjg@1455: */ jjg@1455: int m(int p) throws Exception; jjg@1455: } jjg@1455: jjg@1455: /** An implementing class. */ jjg@1455: class C2 implements I1 { jjg@1455: int m(int p) throws Exception { return p; } jjg@1455: } jjg@1455: jjg@1455: /** An extending class. */ jjg@1455: class C3 extends C1 { jjg@1455: int m(int p) throws Exception { return p; } jjg@1455: } jjg@1455: jjg@1455: /** An extending and implementing class. */ jjg@1455: class C4 extends C1 implements I1 { jjg@1455: int m(int p) throws Exception { return p; } jjg@1455: } jjg@1455: jjg@1455: /** An implementing class using inheritdoc. */ jjg@1455: class C5 implements I1 { jjg@1455: /** {@inheritDoc} */ jjg@1455: int m(int p) throws Exception { return p; } jjg@1455: } jjg@1455: jjg@1455: /** An implementing class with incomplete documentation. */ jjg@1455: class C6 implements I1 { jjg@1455: /** Overriding method */ jjg@1455: int m(int p) throws Exception { return p; } jjg@1455: } jjg@1455: jjg@1455: /** A class implementing an inherited interface. */ jjg@1455: class C7 implements I2 { jjg@1455: int m(int p) throws Exception { return p; } jjg@1455: }