Navigation Menu

Skip to content

Commit

Permalink
8239816: Make handling of module / package / types consistent
Browse files Browse the repository at this point in the history
Reviewed-by: hannesw
  • Loading branch information
jonathan-gibbons committed May 18, 2020
1 parent b265163 commit 039cb65
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 45 deletions.
Expand Up @@ -840,17 +840,11 @@ public void addModuleDescription(Content moduleContentTree) {
addDeprecationInfo(tree);
tree.add(MarkerComments.START_OF_MODULE_DESCRIPTION);
addInlineComment(mdle, tree);
addTagsInfo(mdle, tree);
moduleContentTree.add(tree);
}
}

@Override
public void addModuleTags(Content moduleContentTree) {
Content tree = HtmlTree.SECTION(HtmlStyle.moduleTags);
addTagsInfo(mdle, tree);
moduleContentTree.add(tree);
}

@Override
public void addModuleContent(Content moduleContentTree) {
bodyContents.addMainContent(moduleContentTree);
Expand Down
Expand Up @@ -231,14 +231,6 @@ public enum HtmlStyle {
*/
moduleDescription,

/**
* The class of the {@code dl} element used to present the block tags in the documentation
* comment for a module element.
* Additional (derived) information, such as implementation or inheritance details, may
* also appear in this element.
*/
moduleTags,

/**
* The class of the element used to present the documentation comment for package element.
* The content of the block tags will be in a nested element with class {@link #notes}.
Expand Down
Expand Up @@ -76,15 +76,6 @@ public interface ModuleSummaryWriter {
*/
void addModuleDescription(Content moduleContentTree);

/**
* Adds the tag information from the "module-info.java" file to the documentation
* tree.
*
* @param moduleContentTree the content tree to which the module tags will
* be added
*/
void addModuleTags(Content moduleContentTree);

/**
* Adds the summary of modules to the list of summaries.
*
Expand Down
Expand Up @@ -122,7 +122,6 @@ protected void buildContent() throws DocletException {
Content moduleContentTree = moduleWriter.getContentHeader();

buildModuleDescription(moduleContentTree);
buildModuleTags(moduleContentTree);
buildSummary(moduleContentTree);

moduleWriter.addModuleContent(moduleContentTree);
Expand Down Expand Up @@ -183,15 +182,4 @@ protected void buildModuleDescription(Content moduleContentTree) {
moduleWriter.addModuleDescription(moduleContentTree);
}
}

/**
* Build the tags of the summary.
*
* @param moduleContentTree the tree to which the module tags will be added
*/
protected void buildModuleTags(Content moduleContentTree) {
if (!options.noComment()) {
moduleWriter.addModuleTags(moduleContentTree);
}
}
}
25 changes: 16 additions & 9 deletions test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
Expand Up @@ -27,7 +27,7 @@
* 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
* 8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
* 8164407 8192007 8182765 8196200 8196201 8196202 8196202 8205593 8202462
* 8184205 8219060 8223378 8234746 8239804
* 8184205 8219060 8223378 8234746 8239804 8239816
* @summary Test modules support in javadoc.
* @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
Expand Down Expand Up @@ -633,8 +633,12 @@ void checkModuleTags() {
lang.String)"><code>testMethod(String)</code></a>.""",
"""
Package Link: <a href="testpkgmdltags/package-summary.html"><code>testpkgmdltags</code></a>.""",
"<dt>Since:</dt>\n"
+ "<dd>JDK 9</dd>",
"""
</div>
<dl class="notes">""",
"""
<dt>Since:</dt>
<dd>JDK 9</dd>""",
"""
<dt>See Also:</dt>
<dd>"Test see tag",\s
Expand All @@ -646,10 +650,12 @@ void checkModuleTags() {
"""
<dt>Module Tag:</dt>
<dd>Just a simple module tag.</dd>""",
"<dt>Version:</dt>\n"
+ "<dd>1.0</dd>",
"<dt>Author:</dt>\n"
+ "<dd>Alice</dd>");
"""
<dt>Version:</dt>
<dd>1.0</dd>""",
"""
<dt>Author:</dt>
<dd>Alice</dd>""");
checkOutput("moduletags/testpkgmdltags/TestClassInModuleTags.html", false,
"""
<dt>Module Tag:</dt>
Expand Down Expand Up @@ -1222,8 +1228,9 @@ void checkModuleDeprecation(boolean found) {
<div class="deprecation-comment">This module is deprecated using just the javadoc tag.</div>
""");
checkOutput("moduletags/module-summary.html", found,
"<p>@Deprecated\n"
+ "</p>",
"""
<p>@Deprecated
</p>""",
"""
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span></div>""");
}
Expand Down

0 comments on commit 039cb65

Please sign in to comment.