8150000: Javadoc omits package listing for type

Reviewed-by: jjg
This commit is contained in:
Kumar Srinivasan 2016-03-05 07:53:12 -08:00
parent daa39fa665
commit c57335f395
4 changed files with 15 additions and 8 deletions

View file

@ -196,8 +196,12 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
div.addStyle(HtmlStyle.header); div.addStyle(HtmlStyle.header);
PackageElement pkg = utils.containingPackage(typeElement); PackageElement pkg = utils.containingPackage(typeElement);
if (!pkg.isUnnamed()) { if (!pkg.isUnnamed()) {
Content pkgNameContent = new StringContent(utils.getPackageName(pkg)); Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInClass, packageLabel);
Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel);
pkgNameDiv.addContent(getSpace());
Content pkgNameContent = getPackageLink(pkg,
new StringContent(pkg.getQualifiedName().toString()));
pkgNameDiv.addContent(pkgNameContent);
div.addContent(pkgNameDiv); div.addContent(pkgNameDiv);
} }
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -84,6 +84,7 @@ public enum HtmlStyle {
overrideSpecifyLabel, overrideSpecifyLabel,
overviewSummary, overviewSummary,
packageHierarchyLabel, packageHierarchyLabel,
packageLabelInClass,
paramLabel, paramLabel,
returnLabel, returnLabel,
rightContainer, rightContainer,

View file

@ -610,8 +610,9 @@ h1.hidden {
color:#474747; color:#474747;
} }
.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, .deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, .overrideSpecifyLabel, .packageLabelInClass, .packageHierarchyLabel,
.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink { .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, .throwsLabel,
.typeNameLabel, .typeNameLink, .searchTagLink {
font-weight:bold; font-weight:bold;
} }
.deprecationComment, .emphasizedPhrase, .interfaceName { .deprecationComment, .emphasizedPhrase, .interfaceName {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 7010342 * @bug 7010342 8150000
* @summary Test for correct sub title generation. * @summary Test for correct sub title generation.
* @author Bhavesh Patel * @author Bhavesh Patel
* @library ../lib * @library ../lib
@ -50,7 +50,8 @@ public class TestSubTitle extends JavadocTester {
"<div class=\"block\">This is the description of package pkg.</div>"); "<div class=\"block\">This is the description of package pkg.</div>");
checkOutput("pkg/C.html", true, checkOutput("pkg/C.html", true,
"<div class=\"subTitle\">pkg</div>"); "<div class=\"subTitle\"><span class=\"packageLabelInClass\">" +
"Package</span>&nbsp;<a href=\"../pkg/package-summary.html\">pkg</a></div>");
checkOutput("pkg/package-summary.html", false, checkOutput("pkg/package-summary.html", false,
"<p class=\"subTitle\">\n" + "<p class=\"subTitle\">\n" +