# HG changeset patch
# User bpatel
# Date 1301937263 25200
# Node ID 63f3c4d2d992f93d9adf0532a1208fa05fe4b519
# Parent 53409a3a93f8b1c8be630c4cd37f205e1da03f12
7010344: Some of the html files do not have element in right context.
Reviewed-by: jjg
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Mon Apr 04 10:14:23 2011 -0700
@@ -216,12 +216,15 @@
pre.addContent(modifiers);
LinkInfoImpl linkInfo = new LinkInfoImpl(
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false);
- Content name = new RawHtml (annotationType.name() +
- getTypeParameterLinks(linkInfo));
+ Content annotationName = new StringContent(annotationType.name());
+ Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo));
if (configuration().linksource) {
- addSrcLink(annotationType, name, pre);
+ addSrcLink(annotationType, annotationName, pre);
+ pre.addContent(parameterLinks);
} else {
- pre.addContent(HtmlTree.STRONG(name));
+ Content span = HtmlTree.SPAN(HtmlStyle.strong, annotationName);
+ span.addContent(parameterLinks);
+ pre.addContent(span);
}
annotationInfoTree.addContent(pre);
}
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Mon Apr 04 10:14:23 2011 -0700
@@ -228,12 +228,15 @@
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false);
//Let's not link to ourselves in the signature.
linkInfo.linkToSelf = false;
- Content name = new RawHtml (classDoc.name() +
- getTypeParameterLinks(linkInfo));
+ Content className = new StringContent(classDoc.name());
+ Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo));
if (configuration().linksource) {
- addSrcLink(classDoc, name, pre);
+ addSrcLink(classDoc, className, pre);
+ pre.addContent(parameterLinks);
} else {
- pre.addContent(HtmlTree.STRONG(name));
+ Content span = HtmlTree.SPAN(HtmlStyle.strong, className);
+ span.addContent(parameterLinks);
+ pre.addContent(span);
}
if (!isInterface) {
Type superclass = Util.getFirstVisibleSuperClass(classDoc,
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Mon Apr 04 10:14:23 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
@@ -69,9 +69,6 @@
StringBuffer label = new StringBuffer(
classLinkInfo.getClassLinkLabel(m_writer.configuration));
classLinkInfo.displayLength += label.length();
- if (noLabel && classLinkInfo.excludeTypeParameterLinks) {
- label.append(getTypeParameterLinks(linkInfo).toString());
- }
Configuration configuration = ConfigurationImpl.getInstance();
LinkOutputImpl linkOutput = new LinkOutputImpl();
if (classDoc.isIncluded()) {
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Mon Apr 04 10:14:23 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
@@ -408,10 +408,6 @@
case CONTEXT_PACKAGE:
case CONTEXT_CLASS_USE:
- excludeTypeBoundsLinks = true;
- excludeTypeParameterLinks = true;
- break;
-
case CONTEXT_CLASS_HEADER:
case CONTEXT_CLASS_SIGNATURE:
excludeTypeParameterLinks = true;
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
--- a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Mon Apr 04 10:14:23 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
@@ -27,8 +27,7 @@
* @summary
* @author jamieh
* @library ../lib/
- * @build JavadocTester
- * @build TestDeprecatedDocs
+ * @build JavadocTester TestDeprecatedDocs
* @run main TestDeprecatedDocs
*/
@@ -77,7 +76,7 @@
{TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},
{TARGET_FILE2, "@Deprecated" + NL +
- "public class DeprecatedClassByAnnotation" + NL +
+ "public class DeprecatedClassByAnnotation" + NL +
"extends java.lang.Object
"},
{TARGET_FILE2, "@Deprecated" + NL +
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testHref/TestHref.java
--- a/langtools/test/com/sun/javadoc/testHref/TestHref.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java Mon Apr 04 10:14:23 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
@@ -27,8 +27,7 @@
* @summary Verify that spaces do not appear in hrefs and anchors.
* @author jamieh
* @library ../lib/
- * @build JavadocTester
- * @build TestHref
+ * @build JavadocTester TestHref
* @run main TestHref
*/
@@ -81,7 +80,7 @@
//Signature does not link to the page itself.
{BUG_ID + FS + "pkg" + FS + "C4.html",
- "public abstract class C4<E extends C4<E>>"
+ "public abstract class C4<E extends C4<E>>"
},
};
private static final String[][] NEGATED_TEST =
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
--- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Mon Apr 04 10:14:23 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
@@ -29,8 +29,7 @@
* @summary This test verifies the nesting of definition list tags.
* @author Bhavesh Patel
* @library ../lib/
- * @build JavadocTester
- * @build TestHtmlDefinitionListTag
+ * @build JavadocTester TestHtmlDefinitionListTag
* @run main TestHtmlDefinitionListTag
*/
@@ -43,7 +42,8 @@
// Optional Element should print properly nested definition list tags
// for default value.
private static final String[][] TEST_ALL = {
- {BUG_ID + FS + "pkg1" + FS + "C1.html", "public class C1" + NL +
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "public class " +
+ "C1" + NL +
"extends java.lang.Object" + NL + "implements java.io.Serializable
"},
{BUG_ID + FS + "pkg1" + FS + "C4.html", "
" + NL +
"- Default:
" + NL + "- true
" + NL +
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java
--- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Mon Apr 04 10:14:23 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2011, 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
@@ -28,8 +28,7 @@
* right files.
* @author jamieh
* @library ../lib/
- * @build JavadocTester
- * @build TestLinkOption
+ * @build JavadocTester TestLinkOption
* @run main TestLinkOption
*/
@@ -62,7 +61,7 @@
"Object
p3)"
},
{BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
- "
public abstract class StringBuilderChild" + NL +
+ "public abstract class StringBuilderChild" + NL +
"extends Object
"
},
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Mon Apr 04 10:14:23 2011 -0700
@@ -23,14 +23,13 @@
/*
* @test
- * @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314
+ * @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344
* @summary Run Javadoc on a set of source files that demonstrate new
* language features. Check the output to ensure that the new
* language features are properly documented.
* @author jamieh
* @library ../lib/
- * @build JavadocTester
- * @build TestNewLanguageFeatures
+ * @build JavadocTester TestNewLanguageFeatures
* @run main TestNewLanguageFeatures
*/
@@ -53,9 +52,10 @@
//Make sure enum header is correct.
{BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin"},
//Make sure enum signature is correct.
- {BUG_ID + FS + "pkg" + FS + "Coin.html", "public enum Coin" + NL +
- "extends java.lang.Enum<Coin>
"
+ {BUG_ID + FS + "pkg" + FS + "Coin.html", "public enum " +
+ "Coin" + NL +
+ "extends java.lang.Enum<Coin>
"
},
//Check for enum constant section
{BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Constants" +
@@ -118,8 +118,8 @@
//Signature of subclass that has type parameters.
{BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
- "public class TypeParameterSubClass<T extends " +
- "java.lang.String>" + NL + "extends " +
+ "public class TypeParameterSubClass<T extends " +
+ "java.lang.String>" + NL + "extends " +
"" +
"TypeParameterSuperClass<T>
"},
@@ -168,7 +168,7 @@
"Annotation Type AnnotationType"},
//Make sure the signature is correct.
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
- "public @interface AnnotationType"},
+ "public @interface AnnotationType"},
//Make sure member summary headings are correct.
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
"Required Element Summary
"},
@@ -198,8 +198,8 @@
"optional" +
"=\"Class Annotation\"," + NL +
" " +
- "required=1994)" + NL + "public class " +
- "AnnotationTypeUsage" + NL + "extends java.lang.Object
"},
+ "required=1994)" + NL + "public class " +
+ "AnnotationTypeUsage" + NL + "extends java.lang.Object
"},
//FIELD
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
@@ -299,7 +299,7 @@
{BUG_ID + FS + "pkg1" + FS + "B.html",
"@A"},
{BUG_ID + FS + "pkg1" + FS + "B.html",
- "public interface B
"},
+ "public interface B"},
//==============================================================
@@ -320,9 +320,11 @@
"Foo "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
- "ClassUseTest1" +
- "<T extends Foo & Foo2> | "
+ "ClassUseTest1<T extends " +
+ "Foo" +
+ " & " +
+ "Foo2> | "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
"Methods in "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
- "" +
- "ClassUseTest1<T extends Foo & Foo2>" +
- " | "
+ "ClassUseTest1<T extends " +
+ "Foo" +
+ " & " +
+ "Foo2> | "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
"Methods in "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
- "ClassUseTest2<T " +
- "extends ParamTest<Foo3>> | "
+ "ClassUseTest2<T extends " +
+ "" +
+ "ParamTest<" +
+ "Foo3>> | "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
"Methods in "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
- "" +
- "ClassUseTest2<T extends ParamTest<Foo3>>" +
- " | "
+ "ClassUseTest2<T extends " +
+ "" +
+ "ParamTest<" +
+ "Foo3>> | "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
"Methods in "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
- "" +
- "ClassUseTest3<T extends ParamTest2<java.util.List" +
- "<? extends Foo4>>> | "
+ "ClassUseTest3<T extends " +
+ "" +
+ "ParamTest2<java.util.List<? extends " +
+ "" +
+ "Foo4>>> | "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
"Methods in "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
- "" +
- "ClassUseTest3<T extends ParamTest2<java.util.List" +
- "<? extends Foo4>>> | "
+ "ClassUseTest3<T extends " +
+ "" +
+ "ParamTest2<java.util.List<? extends " +
+ "" +
+ "Foo4>>> | "
},
{BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
"Methods in <W extends java.lang.String,V extends " +
- "java.util.List>
java.lang.Object
"},
+ "java.util.List>
java.lang.Object"
+ },
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<T> java.lang.Object
"},
+ "<T> java.lang.Object
"
+ },
{BUG_ID + FS + "pkg" + FS + "package-summary.html",
- "C<E extends Parent>"},
+ "C<E extends Parent>"
+ },
+ {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Foo4.html",
+ "" +
+ "ClassUseTest3<T extends ParamTest2<java.util.List<? extends " +
+ "Foo4>>>"
+ },
//Nested type parameters
{BUG_ID + FS + "pkg" + FS + "C.html",
"" + NL +
"" + NL +
- ""},
-
+ ""
+ },
+ };
+ private static final String[][] TEST2 = {
+ {BUG_ID + FS + "pkg" + FS + "ClassUseTest3.html",
+ "public class " +
+ "ClassUseTest3<T extends ParamTest2<java.util.List<? extends " +
+ "Foo4>>>"
+ }
};
private static final String[][] NEGATED_TEST = NO_TEST;
-
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestTypeParameters tester = new TestTypeParameters();
- run(tester, ARGS, TEST, NEGATED_TEST);
+ run(tester, ARGS1, TEST1, NEGATED_TEST);
+ run(tester, ARGS2, TEST2, NEGATED_TEST);
tester.printSummary();
}
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java Mon Apr 04 10:14:23 2011 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2011, 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 pkg;
+
+import java.util.*;
+
+public class ClassUseTest3 >> {
+
+ public ClassUseTest3(Set p) {}
+
+ public >> ParamTest2> method(T t) {
+ return null;
+ }
+
+ public void method(Set p) {}
+}
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testTypeParams/pkg/Foo4.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeParams/pkg/Foo4.java Mon Apr 04 10:14:23 2011 -0700
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2011, 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 pkg;
+
+public class Foo4 {}
diff -r 53409a3a93f8 -r 63f3c4d2d992 langtools/test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java Mon Apr 04 10:14:23 2011 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2011, 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 pkg;
+
+public class ParamTest2 {
+}