7010344: Some of the html files do not have element <a> in right context.

Mon, 04 Apr 2011 10:14:23 -0700

author
bpatel
date
Mon, 04 Apr 2011 10:14:23 -0700
changeset 958
734144b6b22f
parent 957
46d720734db3
child 960
26b065bb4ee7

7010344: Some of the html files do not have element <a> in right context.
Reviewed-by: jjg

src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testHref/TestHref.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testLinkOption/TestLinkOption.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testTypeParams/TestTypeParameters.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testTypeParams/pkg/Foo4.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Sun Apr 03 17:00:50 2011 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Mon Apr 04 10:14:23 2011 -0700
     1.3 @@ -216,12 +216,15 @@
     1.4          pre.addContent(modifiers);
     1.5          LinkInfoImpl linkInfo = new LinkInfoImpl(
     1.6                  LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false);
     1.7 -        Content name = new RawHtml (annotationType.name() +
     1.8 -                getTypeParameterLinks(linkInfo));
     1.9 +        Content annotationName = new StringContent(annotationType.name());
    1.10 +        Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo));
    1.11          if (configuration().linksource) {
    1.12 -            addSrcLink(annotationType, name, pre);
    1.13 +            addSrcLink(annotationType, annotationName, pre);
    1.14 +            pre.addContent(parameterLinks);
    1.15          } else {
    1.16 -            pre.addContent(HtmlTree.STRONG(name));
    1.17 +            Content span = HtmlTree.SPAN(HtmlStyle.strong, annotationName);
    1.18 +            span.addContent(parameterLinks);
    1.19 +            pre.addContent(span);
    1.20          }
    1.21          annotationInfoTree.addContent(pre);
    1.22      }
     2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Sun Apr 03 17:00:50 2011 -0700
     2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Mon Apr 04 10:14:23 2011 -0700
     2.3 @@ -228,12 +228,15 @@
     2.4                  LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false);
     2.5          //Let's not link to ourselves in the signature.
     2.6          linkInfo.linkToSelf = false;
     2.7 -        Content name = new RawHtml (classDoc.name() +
     2.8 -                getTypeParameterLinks(linkInfo));
     2.9 +        Content className = new StringContent(classDoc.name());
    2.10 +        Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo));
    2.11          if (configuration().linksource) {
    2.12 -            addSrcLink(classDoc, name, pre);
    2.13 +            addSrcLink(classDoc, className, pre);
    2.14 +            pre.addContent(parameterLinks);
    2.15          } else {
    2.16 -            pre.addContent(HtmlTree.STRONG(name));
    2.17 +            Content span = HtmlTree.SPAN(HtmlStyle.strong, className);
    2.18 +            span.addContent(parameterLinks);
    2.19 +            pre.addContent(span);
    2.20          }
    2.21          if (!isInterface) {
    2.22              Type superclass = Util.getFirstVisibleSuperClass(classDoc,
     3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Sun Apr 03 17:00:50 2011 -0700
     3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Mon Apr 04 10:14:23 2011 -0700
     3.3 @@ -1,5 +1,5 @@
     3.4  /*
     3.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     3.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     3.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8   *
     3.9   * This code is free software; you can redistribute it and/or modify it
    3.10 @@ -69,9 +69,6 @@
    3.11          StringBuffer label = new StringBuffer(
    3.12              classLinkInfo.getClassLinkLabel(m_writer.configuration));
    3.13          classLinkInfo.displayLength += label.length();
    3.14 -        if (noLabel && classLinkInfo.excludeTypeParameterLinks) {
    3.15 -            label.append(getTypeParameterLinks(linkInfo).toString());
    3.16 -        }
    3.17          Configuration configuration = ConfigurationImpl.getInstance();
    3.18          LinkOutputImpl linkOutput = new LinkOutputImpl();
    3.19          if (classDoc.isIncluded()) {
     4.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java	Sun Apr 03 17:00:50 2011 -0700
     4.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java	Mon Apr 04 10:14:23 2011 -0700
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -408,10 +408,6 @@
    4.11  
    4.12              case CONTEXT_PACKAGE:
    4.13              case CONTEXT_CLASS_USE:
    4.14 -                excludeTypeBoundsLinks = true;
    4.15 -                excludeTypeParameterLinks = true;
    4.16 -                break;
    4.17 -
    4.18              case CONTEXT_CLASS_HEADER:
    4.19              case CONTEXT_CLASS_SIGNATURE:
    4.20                  excludeTypeParameterLinks = true;
     5.1 --- a/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java	Sun Apr 03 17:00:50 2011 -0700
     5.2 +++ b/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java	Mon Apr 04 10:14:23 2011 -0700
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -27,8 +27,7 @@
    5.11   * @summary  <DESC>
    5.12   * @author   jamieh
    5.13   * @library  ../lib/
    5.14 - * @build    JavadocTester
    5.15 - * @build    TestDeprecatedDocs
    5.16 + * @build    JavadocTester TestDeprecatedDocs
    5.17   * @run main TestDeprecatedDocs
    5.18   */
    5.19  
    5.20 @@ -77,7 +76,7 @@
    5.21          {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},
    5.22  
    5.23          {TARGET_FILE2, "<pre>@Deprecated" + NL +
    5.24 -                 "public class <strong>DeprecatedClassByAnnotation</strong>" + NL +
    5.25 +                 "public class <span class=\"strong\">DeprecatedClassByAnnotation</span>" + NL +
    5.26                   "extends java.lang.Object</pre>"},
    5.27  
    5.28          {TARGET_FILE2, "<pre>@Deprecated" + NL +
     6.1 --- a/test/com/sun/javadoc/testHref/TestHref.java	Sun Apr 03 17:00:50 2011 -0700
     6.2 +++ b/test/com/sun/javadoc/testHref/TestHref.java	Mon Apr 04 10:14:23 2011 -0700
     6.3 @@ -1,5 +1,5 @@
     6.4  /*
     6.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     6.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     6.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8   *
     6.9   * This code is free software; you can redistribute it and/or modify it
    6.10 @@ -27,8 +27,7 @@
    6.11   * @summary  Verify that spaces do not appear in hrefs and anchors.
    6.12   * @author   jamieh
    6.13   * @library  ../lib/
    6.14 - * @build    JavadocTester
    6.15 - * @build    TestHref
    6.16 + * @build    JavadocTester TestHref
    6.17   * @run main TestHref
    6.18   */
    6.19  
    6.20 @@ -81,7 +80,7 @@
    6.21  
    6.22          //Signature does not link to the page itself.
    6.23          {BUG_ID + FS + "pkg" + FS + "C4.html",
    6.24 -            "public abstract class <strong>C4&lt;E extends C4&lt;E&gt;&gt;</strong>"
    6.25 +            "public abstract class <span class=\"strong\">C4&lt;E extends C4&lt;E&gt;&gt;</span>"
    6.26          },
    6.27      };
    6.28      private static final String[][] NEGATED_TEST =
     7.1 --- a/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Sun Apr 03 17:00:50 2011 -0700
     7.2 +++ b/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Apr 04 10:14:23 2011 -0700
     7.3 @@ -1,5 +1,5 @@
     7.4  /*
     7.5 - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
     7.6 + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
     7.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.8   *
     7.9   * This code is free software; you can redistribute it and/or modify it
    7.10 @@ -29,8 +29,7 @@
    7.11   * @summary This test verifies the nesting of definition list tags.
    7.12   * @author Bhavesh Patel
    7.13   * @library ../lib/
    7.14 - * @build JavadocTester
    7.15 - * @build TestHtmlDefinitionListTag
    7.16 + * @build JavadocTester TestHtmlDefinitionListTag
    7.17   * @run main TestHtmlDefinitionListTag
    7.18   */
    7.19  
    7.20 @@ -43,7 +42,8 @@
    7.21      // Optional Element should print properly nested definition list tags
    7.22      // for default value.
    7.23      private static final String[][] TEST_ALL = {
    7.24 -        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class <strong>C1</strong>" + NL +
    7.25 +        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class " +
    7.26 +                 "<span class=\"strong\">C1</span>" + NL +
    7.27                   "extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"},
    7.28          {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL +
    7.29                   "<dt>Default:</dt>" + NL + "<dd>true</dd>" + NL +
     8.1 --- a/test/com/sun/javadoc/testLinkOption/TestLinkOption.java	Sun Apr 03 17:00:50 2011 -0700
     8.2 +++ b/test/com/sun/javadoc/testLinkOption/TestLinkOption.java	Mon Apr 04 10:14:23 2011 -0700
     8.3 @@ -1,5 +1,5 @@
     8.4  /*
     8.5 - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
     8.6 + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
     8.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8   *
     8.9   * This code is free software; you can redistribute it and/or modify it
    8.10 @@ -28,8 +28,7 @@
    8.11   * right files.
    8.12   * @author jamieh
    8.13   * @library ../lib/
    8.14 - * @build JavadocTester
    8.15 - * @build TestLinkOption
    8.16 + * @build JavadocTester TestLinkOption
    8.17   * @run main TestLinkOption
    8.18   */
    8.19  
    8.20 @@ -62,7 +61,7 @@
    8.21                                  "Object</a>&nbsp;p3)"
    8.22          },
    8.23          {BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
    8.24 -                "<pre>public abstract class <strong>StringBuilderChild</strong>" + NL +
    8.25 +                "<pre>public abstract class <span class=\"strong\">StringBuilderChild</span>" + NL +
    8.26                  "extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
    8.27                  "title=\"class or interface in java.lang\">Object</a></pre>"
    8.28          },
     9.1 --- a/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Sun Apr 03 17:00:50 2011 -0700
     9.2 +++ b/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Apr 04 10:14:23 2011 -0700
     9.3 @@ -23,14 +23,13 @@
     9.4  
     9.5  /*
     9.6   * @test
     9.7 - * @bug      4789689 4905985 4927164 4827184 4993906 5004549 7025314
     9.8 + * @bug      4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344
     9.9   * @summary  Run Javadoc on a set of source files that demonstrate new
    9.10   *           language features.  Check the output to ensure that the new
    9.11   *           language features are properly documented.
    9.12   * @author   jamieh
    9.13   * @library  ../lib/
    9.14 - * @build    JavadocTester
    9.15 - * @build    TestNewLanguageFeatures
    9.16 + * @build    JavadocTester TestNewLanguageFeatures
    9.17   * @run main TestNewLanguageFeatures
    9.18   */
    9.19  
    9.20 @@ -53,9 +52,10 @@
    9.21              //Make sure enum header is correct.
    9.22              {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"},
    9.23              //Make sure enum signature is correct.
    9.24 -            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum <strong>Coin</strong>" + NL +
    9.25 -                "extends java.lang.Enum&lt;<a href=\"../pkg/Coin.html\" " +
    9.26 -                "title=\"enum in pkg\">Coin</a>&gt;</pre>"
    9.27 +            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum " +
    9.28 +                     "<span class=\"strong\">Coin</span>" + NL +
    9.29 +                     "extends java.lang.Enum&lt;<a href=\"../pkg/Coin.html\" " +
    9.30 +                     "title=\"enum in pkg\">Coin</a>&gt;</pre>"
    9.31              },
    9.32              //Check for enum constant section
    9.33              {BUG_ID + FS + "pkg" + FS + "Coin.html", "<caption><span>Enum Constants" +
    9.34 @@ -118,8 +118,8 @@
    9.35  
    9.36              //Signature of subclass that has type parameters.
    9.37              {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
    9.38 -                "<pre>public class <strong>TypeParameterSubClass&lt;T extends " +
    9.39 -                "java.lang.String&gt;</strong>" + NL + "extends " +
    9.40 +                "<pre>public class <span class=\"strong\">TypeParameterSubClass&lt;T extends " +
    9.41 +                "java.lang.String&gt;</span>" + NL + "extends " +
    9.42                  "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" +
    9.43                  "TypeParameterSuperClass</a>&lt;T&gt;</pre>"},
    9.44  
    9.45 @@ -168,7 +168,7 @@
    9.46                  "Annotation Type AnnotationType</h2>"},
    9.47              //Make sure the signature is correct.
    9.48              {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
    9.49 -                "public @interface <strong>AnnotationType</strong>"},
    9.50 +                "public @interface <span class=\"strong\">AnnotationType</span>"},
    9.51              //Make sure member summary headings are correct.
    9.52              {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
    9.53                  "<h3>Required Element Summary</h3>"},
    9.54 @@ -198,8 +198,8 @@
    9.55                  "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
    9.56                  "=\"Class Annotation\"," + NL +
    9.57                  "                <a href=\"../pkg/AnnotationType.html#required()\">" +
    9.58 -                "required</a>=1994)" + NL + "public class <strong>" +
    9.59 -                "AnnotationTypeUsage</strong>" + NL + "extends java.lang.Object</pre>"},
    9.60 +                "required</a>=1994)" + NL + "public class <span class=\"strong\">" +
    9.61 +                "AnnotationTypeUsage</span>" + NL + "extends java.lang.Object</pre>"},
    9.62  
    9.63              //FIELD
    9.64              {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
    9.65 @@ -299,7 +299,7 @@
    9.66              {BUG_ID + FS + "pkg1" + FS + "B.html",
    9.67                  "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"},
    9.68              {BUG_ID + FS + "pkg1" + FS + "B.html",
    9.69 -                "public interface <strong>B</strong></pre>"},
    9.70 +                "public interface <span class=\"strong\">B</span></pre>"},
    9.71  
    9.72  
    9.73              //==============================================================
    9.74 @@ -320,9 +320,11 @@
    9.75                       "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
    9.76              },
    9.77              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
    9.78 -                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
    9.79 -                     "ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1" +
    9.80 -                     "&lt;T extends Foo & Foo2&gt;</a></strong></code>&nbsp;</td>"
    9.81 +                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
    9.82 +                     "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
    9.83 +                     "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
    9.84 +                     "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
    9.85 +                     "Foo2</a>&gt;</strong></code>&nbsp;</td>"
    9.86              },
    9.87              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
    9.88                       "<caption><span>Methods in <a href=\"../../pkg2/" +
    9.89 @@ -370,10 +372,11 @@
    9.90                      "</span></caption>"
    9.91             },
    9.92             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
    9.93 -                    "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
    9.94 -                    "ClassUseTest1.html\" title=\"class in pkg2\">" +
    9.95 -                    "ClassUseTest1&lt;T extends Foo & Foo2&gt;</a></strong>" +
    9.96 -                    "</code>&nbsp;</td>"
    9.97 +                    "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
    9.98 +                     "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
    9.99 +                     "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
   9.100 +                     "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
   9.101 +                     "Foo2</a>&gt;</strong></code>&nbsp;</td>"
   9.102             },
   9.103             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   9.104                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   9.105 @@ -398,10 +401,11 @@
   9.106                       "&nbsp;</span></caption>"
   9.107              },
   9.108              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   9.109 -                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
   9.110 -                     "ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2&lt;T " +
   9.111 -                     "extends ParamTest&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class " +
   9.112 -                     "in pkg2\">Foo3</a>&gt;&gt;</a></strong></code>&nbsp;</td>"
   9.113 +                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
   9.114 +                     "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
   9.115 +                     "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
   9.116 +                     "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
   9.117 +                     "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
   9.118              },
   9.119              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   9.120                       "<caption><span>Methods in <a href=\"../../pkg2/" +
   9.121 @@ -452,11 +456,11 @@
   9.122                       "Foo3</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
   9.123              },
   9.124              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   9.125 -                     "<td class=\"colLast\"><code><strong><a href=\"../../" +
   9.126 -                     "pkg2/ClassUseTest2.html\" title=\"class in pkg2\">" +
   9.127 -                     "ClassUseTest2&lt;T extends ParamTest&lt;<a href=\"../../" +
   9.128 -                     "pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</a>&gt;&gt;" +
   9.129 -                     "</a></strong></code>&nbsp;</td>"
   9.130 +                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
   9.131 +                     "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
   9.132 +                     "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
   9.133 +                     "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
   9.134 +                     "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
   9.135              },
   9.136              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   9.137                       "<caption><span>Methods in <a href=\"../../pkg2/" +
   9.138 @@ -496,10 +500,12 @@
   9.139                       "&nbsp;</span></caption>"
   9.140              },
   9.141              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   9.142 -                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
   9.143 -                     "ClassUseTest3.html\" title=\"class in pkg2\">" +
   9.144 -                     "ClassUseTest3&lt;T extends ParamTest2&lt;java.util.List" +
   9.145 -                     "&lt;? extends Foo4&gt;&gt;&gt;</a></strong></code>&nbsp;</td>"
   9.146 +                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
   9.147 +                     "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
   9.148 +                     "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
   9.149 +                     "ParamTest2</a>&lt;java.util.List&lt;? extends " +
   9.150 +                     "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
   9.151 +                     "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
   9.152              },
   9.153              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   9.154                       "<caption><span>Methods in <a href=\"../../pkg2/" +
   9.155 @@ -532,10 +538,12 @@
   9.156                       "</span></caption>"
   9.157              },
   9.158              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   9.159 -                     "<td class=\"colLast\"><code><strong><a href=\"../../" +
   9.160 -                     "pkg2/ClassUseTest3.html\" title=\"class in pkg2\">" +
   9.161 -                     "ClassUseTest3&lt;T extends ParamTest2&lt;java.util.List" +
   9.162 -                     "&lt;? extends Foo4&gt;&gt;&gt;</a></strong></code>&nbsp;</td>"
   9.163 +                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
   9.164 +                     "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
   9.165 +                     "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
   9.166 +                     "ParamTest2</a>&lt;java.util.List&lt;? extends " +
   9.167 +                     "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
   9.168 +                     "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
   9.169              },
   9.170              {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   9.171                       "<caption><span>Methods in <a href=\"../../pkg2/" +
    10.1 --- a/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java	Sun Apr 03 17:00:50 2011 -0700
    10.2 +++ b/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java	Mon Apr 04 10:14:23 2011 -0700
    10.3 @@ -1,5 +1,5 @@
    10.4  /*
    10.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    10.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
    10.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    10.8   *
    10.9   * This code is free software; you can redistribute it and/or modify it
   10.10 @@ -23,55 +23,77 @@
   10.11  
   10.12  /*
   10.13   * @test
   10.14 - * @bug      4927167 4974929
   10.15 + * @bug      4927167 4974929 7010344
   10.16   * @summary  When the type parameters are more than 10 characters in length,
   10.17   *           make sure there is a line break between type params and return type
   10.18 - *           in member summary.
   10.19 + *           in member summary. Also, test for type parameter links in package-summary and
   10.20 + *           class-use pages. The class/annotation pages should check for type
   10.21 + *           parameter links in the class/annotation signature section when -linksource is set.
   10.22   * @author   jamieh
   10.23   * @library  ../lib/
   10.24 - * @build    JavadocTester
   10.25 - * @build    TestTypeParameters
   10.26 + * @build    JavadocTester TestTypeParameters
   10.27   * @run main TestTypeParameters
   10.28   */
   10.29  
   10.30  public class TestTypeParameters extends JavadocTester {
   10.31  
   10.32      //Test information.
   10.33 -    private static final String BUG_ID = "4927167-4974929";
   10.34 +    private static final String BUG_ID = "4927167-4974929-7010344";
   10.35  
   10.36      //Javadoc arguments.
   10.37 -    private static final String[] ARGS = new String[] {
   10.38 -        "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR,
   10.39 -            "pkg"
   10.40 +    private static final String[] ARGS1 = new String[]{
   10.41 +        "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR,
   10.42 +        "pkg"
   10.43 +    };
   10.44 +    private static final String[] ARGS2 = new String[]{
   10.45 +        "-d", BUG_ID, "-linksource", "-source", "1.5", "-sourcepath", SRC_DIR,
   10.46 +        "pkg"
   10.47      };
   10.48  
   10.49      //Input for string search tests.
   10.50 -    private static final String[][] TEST =
   10.51 -    {
   10.52 +    private static final String[][] TEST1 = {
   10.53          {BUG_ID + FS + "pkg" + FS + "C.html",
   10.54              "<td class=\"colFirst\"><code>&lt;W extends java.lang.String,V extends " +
   10.55 -            "java.util.List&gt;&nbsp;<br>java.lang.Object</code></td>"},
   10.56 +            "java.util.List&gt;&nbsp;<br>java.lang.Object</code></td>"
   10.57 +        },
   10.58          {BUG_ID + FS + "pkg" + FS + "C.html",
   10.59 -            "<code>&lt;T&gt;&nbsp;java.lang.Object</code>"},
   10.60 +            "<code>&lt;T&gt;&nbsp;java.lang.Object</code>"
   10.61 +        },
   10.62          {BUG_ID + FS + "pkg" + FS + "package-summary.html",
   10.63 -            "C&lt;E extends Parent&gt;"},
   10.64 +            "C</a>&lt;E extends <a href=\"../pkg/Parent.html\" " +
   10.65 +            "title=\"class in pkg\">Parent</a>&gt;"
   10.66 +        },
   10.67 +        {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Foo4.html",
   10.68 +            "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" +
   10.69 +            "ClassUseTest3</a>&lt;T extends <a href=\"../../pkg/ParamTest2.html\" " +
   10.70 +            "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends " +
   10.71 +            "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;"
   10.72 +        },
   10.73          //Nested type parameters
   10.74          {BUG_ID + FS + "pkg" + FS + "C.html",
   10.75              "<a name=\"formatDetails(java.util.Collection, java.util.Collection)\">" + NL +
   10.76              "<!--   -->" + NL +
   10.77 -            "</a>"},
   10.78 -
   10.79 +            "</a>"
   10.80 +        },
   10.81 +    };
   10.82 +    private static final String[][] TEST2 = {
   10.83 +        {BUG_ID + FS + "pkg" + FS + "ClassUseTest3.html",
   10.84 +            "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" +
   10.85 +            "ClassUseTest3</a>&lt;T extends <a href=\"../pkg/ParamTest2.html\" " +
   10.86 +            "title=\"class in pkg\">ParamTest2</a>&lt;java.util.List&lt;? extends " +
   10.87 +            "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>&gt;&gt;&gt;"
   10.88 +        }
   10.89      };
   10.90      private static final String[][] NEGATED_TEST = NO_TEST;
   10.91  
   10.92 -
   10.93      /**
   10.94       * The entry point of the test.
   10.95       * @param args the array of command line arguments.
   10.96       */
   10.97      public static void main(String[] args) {
   10.98          TestTypeParameters tester = new TestTypeParameters();
   10.99 -        run(tester, ARGS, TEST, NEGATED_TEST);
  10.100 +        run(tester, ARGS1, TEST1, NEGATED_TEST);
  10.101 +        run(tester, ARGS2, TEST2, NEGATED_TEST);
  10.102          tester.printSummary();
  10.103      }
  10.104  
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java	Mon Apr 04 10:14:23 2011 -0700
    11.3 @@ -0,0 +1,37 @@
    11.4 +/*
    11.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    11.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.7 + *
    11.8 + * This code is free software; you can redistribute it and/or modify it
    11.9 + * under the terms of the GNU General Public License version 2 only, as
   11.10 + * published by the Free Software Foundation.
   11.11 + *
   11.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   11.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   11.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   11.15 + * version 2 for more details (a copy is included in the LICENSE file that
   11.16 + * accompanied this code).
   11.17 + *
   11.18 + * You should have received a copy of the GNU General Public License version
   11.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   11.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   11.21 + *
   11.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   11.23 + * or visit www.oracle.com if you need additional information or have any
   11.24 + * questions.
   11.25 + */
   11.26 +
   11.27 +package pkg;
   11.28 +
   11.29 +import java.util.*;
   11.30 +
   11.31 +public class ClassUseTest3 <T extends ParamTest2<List<? extends Foo4>>> {
   11.32 +
   11.33 +    public ClassUseTest3(Set<Foo4> p) {}
   11.34 +
   11.35 +    public <T extends ParamTest2<List<? extends Foo4>>> ParamTest2<List<? extends Foo4>> method(T t) {
   11.36 +        return null;
   11.37 +    }
   11.38 +
   11.39 +    public void method(Set<Foo4> p) {}
   11.40 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/test/com/sun/javadoc/testTypeParams/pkg/Foo4.java	Mon Apr 04 10:14:23 2011 -0700
    12.3 @@ -0,0 +1,26 @@
    12.4 +/*
    12.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    12.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    12.7 + *
    12.8 + * This code is free software; you can redistribute it and/or modify it
    12.9 + * under the terms of the GNU General Public License version 2 only, as
   12.10 + * published by the Free Software Foundation.
   12.11 + *
   12.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   12.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   12.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   12.15 + * version 2 for more details (a copy is included in the LICENSE file that
   12.16 + * accompanied this code).
   12.17 + *
   12.18 + * You should have received a copy of the GNU General Public License version
   12.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   12.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   12.21 + *
   12.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   12.23 + * or visit www.oracle.com if you need additional information or have any
   12.24 + * questions.
   12.25 + */
   12.26 +
   12.27 +package pkg;
   12.28 +
   12.29 +public class Foo4 {}
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java	Mon Apr 04 10:14:23 2011 -0700
    13.3 @@ -0,0 +1,27 @@
    13.4 +/*
    13.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    13.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.7 + *
    13.8 + * This code is free software; you can redistribute it and/or modify it
    13.9 + * under the terms of the GNU General Public License version 2 only, as
   13.10 + * published by the Free Software Foundation.
   13.11 + *
   13.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   13.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   13.15 + * version 2 for more details (a copy is included in the LICENSE file that
   13.16 + * accompanied this code).
   13.17 + *
   13.18 + * You should have received a copy of the GNU General Public License version
   13.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   13.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   13.21 + *
   13.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   13.23 + * or visit www.oracle.com if you need additional information or have any
   13.24 + * questions.
   13.25 + */
   13.26 +
   13.27 +package pkg;
   13.28 +
   13.29 +public class ParamTest2<E> {
   13.30 +}

mercurial