# HG changeset patch # User jjg # Date 1471370233 25200 # Node ID 258ad5fd9b57685051408b552bd0bbe681cf5328 # Parent 6ee9b4aa803e8ab509dd18ea2df810458832abbf 8163800: The fix for JDK-8072052 shows up other minor incorrect use of styles Reviewed-by: bpatel diff -r 6ee9b4aa803e -r 258ad5fd9b57 langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java --- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Tue Aug 16 10:35:10 2016 -0700 +++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Tue Aug 16 10:57:13 2016 -0700 @@ -651,11 +651,11 @@ if (type instanceof TypeElement) { Content link = getLink( new LinkInfoImpl(configuration, context, (TypeElement)(type))); - dd.addContent(link); + dd.addContent(HtmlTree.CODE(link)); } else { Content link = getLink( new LinkInfoImpl(configuration, context, ((TypeMirror)type))); - dd.addContent(link); + dd.addContent(HtmlTree.CODE(link)); } } return dd; diff -r 6ee9b4aa803e -r 258ad5fd9b57 langtools/test/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java Tue Aug 16 10:57:13 2016 -0700 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2016, 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 8163800 + * @summary The fix for JDK-8072052 shows up other minor incorrect use of styles + * @library ../lib + * @modules jdk.javadoc/jdk.javadoc.internal.tool + * @build JavadocTester + * @build TestClassLinks + * @run main TestClassLinks + */ + +public class TestClassLinks extends JavadocTester { + + public static void main(String... args) throws Exception { + TestClassLinks tester = new TestClassLinks(); + tester.runTests(); + } + + @Test + void test() { + + javadoc("-d", "out", + "-Xdoclint:none", + "-sourcepath", testSrc, + "-package", + "p"); + checkExit(Exit.OK); + + checkOutput("p/C1.html", true, + "C2", + "C1()"); + + checkOutput("p/C2.html", true, + "C3", + "C2()"); + + checkOutput("p/C3.html", true, + "I1, " + + "I12, " + + "I2, " + + "IT1<T>, " + + "IT2<java.lang.String>", + "C3()"); + + checkOutput("p/I1.html", true, + "C3", + "I12"); + + checkOutput("p/I2.html", true, + "C3", + "I12"); + + checkOutput("p/I12.html", true, + "C3", + "I1, I2"); + + checkOutput("p/IT1.html", true, + "C3"); + + checkOutput("p/IT2.html", true, + "code>C3"); + + } + +} diff -r 6ee9b4aa803e -r 258ad5fd9b57 langtools/test/jdk/javadoc/doclet/testClassLinks/p/C.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/jdk/javadoc/doclet/testClassLinks/p/C.java Tue Aug 16 10:57:13 2016 -0700 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016, 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. + */ + +package p; + +interface I1 { } + +interface I2 { } + +interface I12 extends I1, I2 { } + +interface IT1 { } + +interface IT2 { } + +class C1 { } + +class C2 extends C1 { } + +class C3 extends C2 implements I12, IT1, IT2 { } diff -r 6ee9b4aa803e -r 258ad5fd9b57 langtools/test/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java --- a/langtools/test/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java Tue Aug 16 10:35:10 2016 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java Tue Aug 16 10:57:13 2016 -0700 @@ -54,9 +54,9 @@ "", "", "
Direct Known Subclasses:
\n" + - "
" + - "A.VisibleInner, A.VisibleInnerExtendsInvisibleInner
"); + "
" + + "A.VisibleInner, A.VisibleInnerExtendsInvisibleInner
"); checkOutput("pkg1/A.html", false, "", diff -r 6ee9b4aa803e -r 258ad5fd9b57 langtools/test/jdk/javadoc/doclet/testInterface/TestInterface.java --- a/langtools/test/jdk/javadoc/doclet/testInterface/TestInterface.java Tue Aug 16 10:35:10 2016 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testInterface/TestInterface.java Tue Aug 16 10:57:13 2016 -0700 @@ -36,7 +36,7 @@ */ /* - * TODO: make it Inteferface ie. fix all ParameterTypes, likely should get + * TODO: make it Interface ie. fix all ParameterTypes, likely should get * fixed when Doc is replace by j.l.m, but meanwhile this test has been adjusted * take the current format this is better than @ignore because we can follow the * differences as the work progress. @@ -69,17 +69,17 @@ // Make sure known implementing class list is correct and omits type parameters. "
\n" + "
All Known Implementing Classes:
\n" - + "
Child" - + ", Parent" - + "
\n" + + "
Child" + + ", Parent" + + "
\n" + "
"); checkOutput("pkg/Child.html", true, // Make sure "All Implemented Interfaces": has substituted type parameters "
\n" + "
All Implemented Interfaces:
\n" - + "
" - + "Interface<CE>
\n" + + "
" + + "Interface<CE>
\n" + "
", //Make sure Class Tree has substituted type parameters. "
    \n" @@ -114,8 +114,8 @@ //Make sure "Direct Know Subclasses" omits type parameters "
    \n" + "
    Direct Known Subclasses:
    \n" - + "
    Child" - + "
    \n" + + "
    Child" + + "
    \n" + "
    "); checkOutput("pkg/Interface.html", false, diff -r 6ee9b4aa803e -r 258ad5fd9b57 langtools/test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java --- a/langtools/test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java Tue Aug 16 10:35:10 2016 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java Tue Aug 16 10:57:13 2016 -0700 @@ -186,22 +186,22 @@ checkOutput("pkg/TypeParameters.html", true, "
    \n" + "
    All Implemented Interfaces:
    \n" - + "
    " - + "SubInterface<E>, SuperInterface<E>
    \n" + + "
    " + + "SubInterface<E>, SuperInterface<E>
    \n" + "
    "); checkOutput("pkg/SuperInterface.html", true, "
    \n" + "
    All Known Subinterfaces:
    \n" - + "
    " - + "SubInterface<V>
    \n" + + "
    " + + "SubInterface<V>
    \n" + "
    "); checkOutput("pkg/SubInterface.html", true, "
    \n" + "
    All Superinterfaces:
    \n" - + "
    " - + "SuperInterface<V>
    \n" + + "
    " + + "SuperInterface<V>
    \n" + "
    "); //============================================================== diff -r 6ee9b4aa803e -r 258ad5fd9b57 langtools/test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java --- a/langtools/test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java Tue Aug 16 10:35:10 2016 -0700 +++ b/langtools/test/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java Tue Aug 16 10:57:13 2016 -0700 @@ -77,8 +77,8 @@ "
    public void methodInheritedFromParent(int p1)",
                     "
    \n" + "
    All Implemented Interfaces:
    \n" - + "
    " - + "PublicInterface
    \n" + + "
    " + + "PublicInterface
    \n" + "
    "); checkOutput("pkg/PublicChild.html", false, @@ -115,8 +115,8 @@ //Make sure implemented interfaces from private superclass are inherited "
    \n" + "
    All Known Implementing Classes:
    \n" - + "
    " - + "PublicChild
    \n" + + "
    " + + "PublicChild
    \n" + "
    "); checkOutput("pkg/PublicInterface.html", false, @@ -178,10 +178,10 @@ "extends", "
    \n" + "
    All Implemented Interfaces:
    \n" - + "
    " - + "PrivateInterface, " - + "" - + "PublicInterface
    \n" + + "
    " + + "PrivateInterface, " + + "" + + "PublicInterface
    \n" + "
    ", "
    public class PublicChild");
     
    @@ -202,10 +202,10 @@
                     //Make sure implemented interfaces from private superclass are inherited
                     "
    \n" + "
    All Known Implementing Classes:
    \n" - + "
    " - + "PrivateParent, " - + "PublicChild" - + "
    \n" + + "
    " + + "PrivateParent, " + + "PublicChild" + + "
    \n" + "
    "); checkOutput("pkg/PrivateInterface.html", true,