50N/A/*
1472N/A * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
50N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
50N/A *
50N/A * This code is free software; you can redistribute it and/or modify it
50N/A * under the terms of the GNU General Public License version 2 only, as
50N/A * published by the Free Software Foundation.
50N/A *
50N/A * This code is distributed in the hope that it will be useful, but WITHOUT
50N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
50N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
50N/A * version 2 for more details (a copy is included in the LICENSE file that
50N/A * accompanied this code).
50N/A *
50N/A * You should have received a copy of the GNU General Public License version
50N/A * 2 along with this work; if not, write to the Free Software Foundation,
50N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
50N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
50N/A */
50N/A
50N/A/*
50N/A * @test
50N/A * @bug 4634891
50N/A * @summary Determine if overriden methods are properly documented when
50N/A * -protected (default) visibility flag is used.
50N/A * @author jamieh
50N/A * @library ../lib/
50N/A * @build JavadocTester
50N/A * @build TestOverridenPrivateMethodsWithPrivateFlag
50N/A * @run main TestOverridenPrivateMethodsWithPrivateFlag
50N/A */
50N/A
50N/Apublic class TestOverridenPrivateMethodsWithPrivateFlag extends JavadocTester {
50N/A
50N/A private static final String BUG_ID = "4634891";
50N/A
50N/A private static final String[][] TEST = {
50N/A //The public method should be overriden
50N/A {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
50N/A "<dt><strong>Overrides:</strong></dt>" + NL +
50N/A "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
50N/A
50N/A //The package private method should be overriden since the base and sub class are in the same
50N/A //package.
50N/A {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
50N/A "<dt><strong>Overrides:</strong></dt>" + NL +
50N/A "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
50N/A
50N/A //The public method in different package should be overriden
50N/A {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
50N/A "<dt><strong>Overrides:</strong></dt>" + NL +
50N/A "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
50N/A };
50N/A
50N/A private static final String[][] NEGATED_TEST = {
50N/A
50N/A //The private method in should not be overriden
50N/A {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
50N/A "<dt><strong>Overrides:</strong></dt>" + NL +
50N/A "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
50N/A
50N/A //The private method in different package should not be overriden
50N/A {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
50N/A "<dt><strong>Overrides:</strong></dt>" + NL +
50N/A "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
50N/A
50N/A //The package private method should not be overriden since the base and sub class are in
50N/A //different packages.
50N/A {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
50N/A "<dt><strong>Overrides:</strong></dt>" + NL +
50N/A "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
50N/A
50N/A
50N/A };
50N/A
50N/A private static final String[] ARGS =
50N/A new String[] {
50N/A "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "pkg1", "pkg2"};
50N/A
50N/A /**
50N/A * The entry point of the test.
50N/A * @param args the array of command line arguments.
50N/A */
50N/A public static void main(String[] args) {
50N/A TestOverridenPrivateMethodsWithPrivateFlag tester = new TestOverridenPrivateMethodsWithPrivateFlag();
50N/A run(tester, ARGS, TEST, NEGATED_TEST);
50N/A tester.printSummary();
50N/A }
50N/A
50N/A /**
* {@inheritDoc}
*/
public String getBugId() {
return BUG_ID;
}
/**
* {@inheritDoc}
*/
public String getBugName() {
return getClass().getName();
}
}