8211901: javadoc generates broken links on deprecated items page
Reviewed-by: jjg
This commit is contained in:
parent
05f0d11553
commit
4e1c510215
@ -1485,7 +1485,7 @@ public class Utils {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getBlockTags(m).isEmpty())
|
||||
if (!getBlockTags(m).isEmpty() || isDeprecated(m))
|
||||
return false;
|
||||
|
||||
List<? extends DocTree> fullBody = getFullBody(m);
|
||||
|
@ -248,7 +248,7 @@ public class VisibleMemberTable {
|
||||
* @param e the method to check
|
||||
* @return the overridden method or null
|
||||
*/
|
||||
public ExecutableElement getsimplyOverriddenMethod(ExecutableElement e) {
|
||||
public ExecutableElement getSimplyOverriddenMethod(ExecutableElement e) {
|
||||
ensureInitialized();
|
||||
|
||||
OverridingMethodInfo found = overriddenMethodTable.get(e);
|
||||
@ -869,7 +869,7 @@ public class VisibleMemberTable {
|
||||
public List<ExecutableElement> getImplementedMethods(ExecutableElement method) {
|
||||
ImplementedMethods imf = getImplementedMethodsFinder(method);
|
||||
return imf.getImplementedMethods().stream()
|
||||
.filter(m -> getsimplyOverriddenMethod(m) == null)
|
||||
.filter(m -> getSimplyOverriddenMethod(m) == null)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8211901
|
||||
* @summary javadoc generates broken links on deprecated items page
|
||||
* @library ../lib
|
||||
* @modules jdk.javadoc/jdk.javadoc.internal.tool
|
||||
* @build JavadocTester
|
||||
* @run main TestOverriddenDeprecatedMethods
|
||||
*/
|
||||
|
||||
public class TestOverriddenDeprecatedMethods extends JavadocTester {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
TestOverriddenDeprecatedMethods tester = new TestOverriddenDeprecatedMethods();
|
||||
tester.runTests();
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
javadoc("-d", "out-deprecated",
|
||||
"-sourcepath", testSrc,
|
||||
"--override-methods","summary",
|
||||
"pkg1");
|
||||
|
||||
checkExit(Exit.OK);
|
||||
|
||||
checkOrder("pkg1/SubClass.html",
|
||||
"Method Summary",
|
||||
"Methods declared in class pkg1.<a href=\"BaseClass.html\" title=\"class in pkg1\">"
|
||||
+ "BaseClass</a>",
|
||||
"<a href=\"BaseClass.html#func3()\">func3</a>");
|
||||
|
||||
checkOrder("pkg1/SubClass.html",
|
||||
"Method Detail",
|
||||
"@Deprecated\npublic void func1()",
|
||||
"<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated.</span></div>",
|
||||
"@Deprecated\npublic void func2()",
|
||||
"<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated.</span></div>",
|
||||
"<div class=\"block\">deprecated with comments</div>");
|
||||
}
|
||||
}
|
@ -50,4 +50,22 @@ public class BaseClass {
|
||||
*/
|
||||
public void overridenMethodWithDocsToCopy() {}
|
||||
|
||||
/**
|
||||
* @deprecated func1 deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public void func1() {}
|
||||
|
||||
/**
|
||||
* @deprecated func2 deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public void func2() {}
|
||||
|
||||
/**
|
||||
* @deprecated func3 deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public void func3() {}
|
||||
|
||||
}
|
||||
|
@ -48,4 +48,22 @@ public class SubClass extends BaseClass {
|
||||
public void privateMethod() {}
|
||||
|
||||
public void overridenMethodWithDocsToCopy() {}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Deprecated
|
||||
public void func1() {}
|
||||
|
||||
/**
|
||||
* deprecated with comments
|
||||
*/
|
||||
@Deprecated
|
||||
public void func2() {}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void func3() {}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user