mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-07 00:48:38 +00:00
Merge
This commit is contained in:
commit
3cc8c36887
@ -0,0 +1,195 @@
|
||||
/*
|
||||
* 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. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* 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 build.tools.listjdkinternals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.lang.module.ModuleDescriptor;
|
||||
import java.lang.module.ModuleFinder;
|
||||
import java.lang.module.ModuleReference;
|
||||
import java.net.URI;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Run this tool to generate the JDK internal APIs in the previous releases
|
||||
* including platform-specific internal APIs.
|
||||
*/
|
||||
public class ListJDKInternals {
|
||||
// Filter non-interesting JAR files
|
||||
private final static List<String> excludes = Arrays.asList(
|
||||
"deploy.jar",
|
||||
"javaws.jar",
|
||||
"plugin.jar",
|
||||
"cldrdata.jar",
|
||||
"localedata.jar"
|
||||
);
|
||||
private static void usage() {
|
||||
System.out.println("ListJDKInternals [-o <outfile>] <javaHome> [<javaHome>]*");
|
||||
}
|
||||
|
||||
private static final Set<String> EXPORTED_PACKAGES = new HashSet<>();
|
||||
|
||||
public static void main(String... args) throws IOException {
|
||||
List<Path> paths = new ArrayList<>();
|
||||
Path outFile = null;
|
||||
int i=0;
|
||||
while (i < args.length) {
|
||||
String arg = args[i++];
|
||||
if (arg.equals("-o")) {
|
||||
outFile = Paths.get(args[i++]);
|
||||
} else {
|
||||
Path p = Paths.get(arg);
|
||||
if (Files.notExists(p))
|
||||
throw new IllegalArgumentException(p + " not exist");
|
||||
paths.add(p);
|
||||
}
|
||||
}
|
||||
if (paths.isEmpty()) {
|
||||
usage();
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
// Get the exported APIs from the current JDK releases
|
||||
Path javaHome = Paths.get(System.getProperty("java.home"));
|
||||
ModuleFinder.ofSystem().findAll()
|
||||
.stream()
|
||||
.map(ModuleReference::descriptor)
|
||||
.filter(md -> !md.name().equals("jdk.unsupported"))
|
||||
.map(ModuleDescriptor::exports)
|
||||
.flatMap(Set::stream)
|
||||
.filter(exp -> !exp.isQualified())
|
||||
.map(ModuleDescriptor.Exports::source)
|
||||
.forEach(EXPORTED_PACKAGES::add);
|
||||
|
||||
ListJDKInternals listJDKInternals = new ListJDKInternals(paths);
|
||||
if (outFile != null) {
|
||||
try (OutputStream out = Files.newOutputStream(outFile);
|
||||
PrintStream pw = new PrintStream(out)) {
|
||||
listJDKInternals.write(pw);
|
||||
}
|
||||
} else {
|
||||
listJDKInternals.write(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
private final Set<String> packages = new HashSet<>();
|
||||
ListJDKInternals(List<Path> dirs) throws IOException {
|
||||
for (Path p : dirs) {
|
||||
packages.addAll(list(p));
|
||||
}
|
||||
}
|
||||
|
||||
private void write(PrintStream pw) {
|
||||
pw.println("# This file is auto-generated by ListJDKInternals tool on " +
|
||||
LocalDateTime.now().toString());
|
||||
packages.stream().sorted()
|
||||
.forEach(pw::println);
|
||||
}
|
||||
|
||||
private Set<String> list(Path javaHome) throws IOException {
|
||||
Path jrt = javaHome.resolve("lib").resolve("modules");
|
||||
Path jre = javaHome.resolve("jre");
|
||||
|
||||
if (Files.exists(jrt)) {
|
||||
return listModularRuntime(javaHome);
|
||||
} else if (Files.exists(jre.resolve("lib").resolve("rt.jar"))) {
|
||||
return listLegacyRuntime(javaHome);
|
||||
}
|
||||
throw new IllegalArgumentException("invalid " + javaHome);
|
||||
}
|
||||
|
||||
private Set<String> listModularRuntime(Path javaHome) throws IOException {
|
||||
Map<String, String> env = new HashMap<>();
|
||||
env.put("java.home", javaHome.toString());
|
||||
FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), env);
|
||||
Path root = fs.getPath("packages");
|
||||
return Files.walk(root, 1)
|
||||
.map(Path::getFileName)
|
||||
.map(Path::toString)
|
||||
.filter(pn -> !EXPORTED_PACKAGES.contains(pn))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
private Set<String> listLegacyRuntime(Path javaHome) throws IOException {
|
||||
List<Path> dirs = new ArrayList<>();
|
||||
Path jre = javaHome.resolve("jre");
|
||||
Path lib = javaHome.resolve("lib");
|
||||
|
||||
dirs.add(jre.resolve("lib"));
|
||||
dirs.add(jre.resolve("lib").resolve("ext"));
|
||||
dirs.add(lib.resolve("tools.jar"));
|
||||
dirs.add(lib.resolve("jconsole.jar"));
|
||||
Set<String> packages = new HashSet<>();
|
||||
for (Path d : dirs) {
|
||||
Files.find(d, 1, (Path p, BasicFileAttributes attr)
|
||||
-> p.getFileName().toString().endsWith(".jar") &&
|
||||
!excludes.contains(p.getFileName().toString()))
|
||||
.map(ListJDKInternals::walkJarFile)
|
||||
.flatMap(Set::stream)
|
||||
.filter(pn -> !EXPORTED_PACKAGES.contains(pn))
|
||||
.forEach(packages::add);
|
||||
}
|
||||
return packages;
|
||||
}
|
||||
|
||||
static Set<String> walkJarFile(Path jarfile) {
|
||||
try (JarFile jf = new JarFile(jarfile.toFile())) {
|
||||
return jf.stream()
|
||||
.map(JarEntry::getName)
|
||||
.filter(n -> n.endsWith(".class"))
|
||||
.map(ListJDKInternals::toPackage)
|
||||
.collect(Collectors.toSet());
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static String toPackage(String name) {
|
||||
int i = name.lastIndexOf('/');
|
||||
if (i < 0) {
|
||||
System.err.format("Warning: unnamed package %s%n", name);
|
||||
}
|
||||
return i >= 0 ? name.substring(0, i).replace("/", ".") : "";
|
||||
}
|
||||
}
|
||||
@ -457,17 +457,6 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add gap between navigation bar elements.
|
||||
*
|
||||
* @param liNav the content tree to which the gap will be added
|
||||
*/
|
||||
protected void addNavGap(Content liNav) {
|
||||
liNav.addContent(getSpace());
|
||||
liNav.addContent("|");
|
||||
liNav.addContent(getSpace());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
@ -763,17 +763,6 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add gap between navigation bar elements.
|
||||
*
|
||||
* @param liNav the content tree to which the gap will be added
|
||||
*/
|
||||
protected void addNavGap(Content liNav) {
|
||||
liNav.addContent(getSpace());
|
||||
liNav.addContent("|");
|
||||
liNav.addContent(getSpace());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the TypeElement being documented.
|
||||
*
|
||||
|
||||
@ -907,6 +907,17 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
return li;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add gap between navigation bar elements.
|
||||
*
|
||||
* @param liNav the content tree to which the gap will be added
|
||||
*/
|
||||
protected void addNavGap(Content liNav) {
|
||||
liNav.addContent(getSpace());
|
||||
liNav.addContent("|");
|
||||
liNav.addContent(getSpace());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary table header.
|
||||
*
|
||||
|
||||
@ -26,23 +26,28 @@
|
||||
package jdk.javadoc.internal.doclets.formats.html;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.lang.model.element.ModuleElement;
|
||||
import javax.lang.model.element.ModuleElement.DirectiveKind;
|
||||
import javax.lang.model.element.PackageElement;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
|
||||
import com.sun.source.doctree.DocTree;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
|
||||
import jdk.javadoc.internal.doclets.toolkit.Content;
|
||||
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
||||
import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
|
||||
|
||||
/**
|
||||
* Class to generate file for each module contents in the right-hand
|
||||
@ -74,17 +79,25 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
*/
|
||||
protected ModuleElement mdle;
|
||||
|
||||
private final Map<ModuleElement.DirectiveKind, List<ModuleElement.Directive>> directiveMap
|
||||
= new EnumMap<>(ModuleElement.DirectiveKind.class);
|
||||
|
||||
/**
|
||||
* The HTML tree for main tag.
|
||||
*/
|
||||
protected HtmlTree mainTree = HtmlTree.MAIN();
|
||||
|
||||
/**
|
||||
* The HTML tree for section tag.
|
||||
*/
|
||||
protected HtmlTree sectionTree = HtmlTree.SECTION();
|
||||
|
||||
/**
|
||||
* Constructor to construct ModuleWriter object and to generate
|
||||
* "moduleName-summary.html" file.
|
||||
*
|
||||
* @param configuration the configuration of the doclet.
|
||||
* @param module Module under consideration.
|
||||
* @param mdle Module under consideration.
|
||||
* @param prevModule Previous module in the sorted array.
|
||||
* @param nextModule Next module in the sorted array.
|
||||
*/
|
||||
@ -95,10 +108,13 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
this.prevModule = prevModule;
|
||||
this.nextModule = nextModule;
|
||||
this.mdle = mdle;
|
||||
generateDirectiveMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Get the module header.
|
||||
*
|
||||
* @param heading the heading for the section
|
||||
*/
|
||||
public Content getModuleHeader(String heading) {
|
||||
HtmlTree bodyTree = getBody(true, getWindowTitle(mdle.getQualifiedName().toString()));
|
||||
@ -127,7 +143,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Get the content header.
|
||||
*/
|
||||
public Content getContentHeader() {
|
||||
HtmlTree div = new HtmlTree(HtmlTag.DIV);
|
||||
@ -136,7 +152,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Get the summary section header.
|
||||
*/
|
||||
public Content getSummaryHeader() {
|
||||
HtmlTree li = new HtmlTree(HtmlTag.LI);
|
||||
@ -145,26 +161,325 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Get the summary tree.
|
||||
*
|
||||
* @param summaryContentTree the content tree to be added to the summary tree.
|
||||
*/
|
||||
public Content getSummaryTree(Content summaryContentTree) {
|
||||
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree);
|
||||
return ul;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the directive map for the directives on the module.
|
||||
*/
|
||||
public void generateDirectiveMap() {
|
||||
for (ModuleElement.Directive d : mdle.getDirectives()) {
|
||||
if (directiveMap.containsKey(d.getKind())) {
|
||||
List<ModuleElement.Directive> dir = directiveMap.get(d.getKind());
|
||||
dir.add(d);
|
||||
directiveMap.put(d.getKind(), dir);
|
||||
} else {
|
||||
List<ModuleElement.Directive> dir = new ArrayList<>();
|
||||
dir.add(d);
|
||||
directiveMap.put(d.getKind(), dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the summary header.
|
||||
*
|
||||
* @param startMarker the marker comment
|
||||
* @param markerAnchor the marker anchor for the section
|
||||
* @param heading the heading for the section
|
||||
* @param htmltree the content tree to which the information is added
|
||||
*/
|
||||
public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading, Content htmltree) {
|
||||
htmltree.addContent(startMarker);
|
||||
htmltree.addContent(getMarkerAnchor(markerAnchor));
|
||||
htmltree.addContent(HtmlTree.HEADING(HtmlTag.H3, heading));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the summary for the module.
|
||||
*
|
||||
* @param text the table caption
|
||||
* @param tableSummary the summary for the table
|
||||
* @param htmltree the content tree to which the table will be added
|
||||
* @param tableStyle the table style
|
||||
* @param tableHeader the table header
|
||||
* @param dirs the list of module directives
|
||||
*/
|
||||
public void addSummary(String text, String tableSummary, Content htmltree, HtmlStyle tableStyle,
|
||||
List<String> tableHeader, List<ModuleElement.Directive> dirs) {
|
||||
Content table = (configuration.isOutputHtml5())
|
||||
? HtmlTree.TABLE(tableStyle, getTableCaption(new RawHtml(text)))
|
||||
: HtmlTree.TABLE(tableStyle, tableSummary, getTableCaption(new RawHtml(text)));
|
||||
table.addContent(getSummaryTableHeader(tableHeader, "col"));
|
||||
Content tbody = new HtmlTree(HtmlTag.TBODY);
|
||||
addList(dirs, tbody);
|
||||
table.addContent(tbody);
|
||||
htmltree.addContent(table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the list of directives for the module.
|
||||
*
|
||||
* @param dirs the list of module directives
|
||||
* @params tbody the content tree to which the list is added
|
||||
*/
|
||||
public void addList(List<ModuleElement.Directive> dirs, Content tbody) {
|
||||
boolean altColor = true;
|
||||
for (ModuleElement.Directive direct : dirs) {
|
||||
DirectiveKind kind = direct.getKind();
|
||||
switch (kind) {
|
||||
case REQUIRES:
|
||||
addRequiresList((ModuleElement.RequiresDirective) direct, tbody, altColor);
|
||||
break;
|
||||
case EXPORTS:
|
||||
addExportedPackagesList((ModuleElement.ExportsDirective) direct, tbody, altColor);
|
||||
break;
|
||||
case USES:
|
||||
addUsesList((ModuleElement.UsesDirective) direct, tbody, altColor);
|
||||
break;
|
||||
case PROVIDES:
|
||||
addProvidesList((ModuleElement.ProvidesDirective) direct, tbody, altColor);
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("unknown directive kind: " + kind);
|
||||
}
|
||||
altColor = !altColor;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void addPackagesSummary(Set<PackageElement> packages, String text,
|
||||
String tableSummary, Content summaryContentTree) {
|
||||
Content table = (configuration.isOutputHtml5())
|
||||
? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
|
||||
: HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
|
||||
table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
|
||||
Content tbody = new HtmlTree(HtmlTag.TBODY);
|
||||
addPackagesList(packages, tbody);
|
||||
table.addContent(tbody);
|
||||
summaryContentTree.addContent(table);
|
||||
public void addModulesSummary(Content summaryContentTree) {
|
||||
List<ModuleElement.Directive> dirs = directiveMap.get(DirectiveKind.REQUIRES);
|
||||
if (dirs != null && !dirs.isEmpty()) {
|
||||
HtmlTree li = new HtmlTree(HtmlTag.LI);
|
||||
li.addStyle(HtmlStyle.blockList);
|
||||
addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES,
|
||||
getResource("doclet.navModules"), li);
|
||||
String text = configuration.getText("doclet.Requires_Summary");
|
||||
String tableSummary = configuration.getText("doclet.Member_Table_Summary",
|
||||
configuration.getText("doclet.Requires_Summary"),
|
||||
configuration.getText("doclet.modules"));
|
||||
addRequiresSummary(text, tableSummary, dirs, li);
|
||||
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
|
||||
summaryContentTree.addContent(ul);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the requires summary for the module.
|
||||
*
|
||||
* @param text the table caption
|
||||
* @param tableSummary the summary for the table
|
||||
* @param dirs the list of module directives
|
||||
* @param htmltree the content tree to which the table will be added
|
||||
*/
|
||||
public void addRequiresSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
|
||||
Content htmltree) {
|
||||
addSummary(text, tableSummary, htmltree, HtmlStyle.requiresSummary, requiresTableHeader, dirs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the requires directive list for the module.
|
||||
*
|
||||
* @param direct the requires directive
|
||||
* @param tbody the content tree to which the directive will be added
|
||||
* @param altColor true if altColor style should be used or false if rowColor style should be used
|
||||
*/
|
||||
public void addRequiresList(ModuleElement.RequiresDirective direct, Content tbody, boolean altColor) {
|
||||
ModuleElement m = direct.getDependency();
|
||||
Content moduleLinkContent = getModuleLink(m, new StringContent(m.getQualifiedName().toString()));
|
||||
Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, moduleLinkContent);
|
||||
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
|
||||
tdSummary.addStyle(HtmlStyle.colLast);
|
||||
addSummaryComment(m, tdSummary);
|
||||
HtmlTree tr = HtmlTree.TR(tdPackage);
|
||||
tr.addContent(tdSummary);
|
||||
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
|
||||
tbody.addContent(tr);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void addPackagesSummary(Content summaryContentTree) {
|
||||
List<ModuleElement.Directive> dirs = directiveMap.get(DirectiveKind.EXPORTS);
|
||||
if (dirs != null && !dirs.isEmpty()) {
|
||||
HtmlTree li = new HtmlTree(HtmlTag.LI);
|
||||
li.addStyle(HtmlStyle.blockList);
|
||||
addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
|
||||
getResource("doclet.navPackages"), li);
|
||||
String text = configuration.getText("doclet.Exported_Packages_Summary");
|
||||
String tableSummary = configuration.getText("doclet.Member_Table_Summary",
|
||||
configuration.getText("doclet.Exported_Packages_Summary"),
|
||||
configuration.getText("doclet.packages"));
|
||||
addExportedPackagesSummary(text, tableSummary, dirs, li);
|
||||
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
|
||||
summaryContentTree.addContent(ul);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the exported packages summary for the module.
|
||||
*
|
||||
* @param text the table caption
|
||||
* @param tableSummary the summary for the table
|
||||
* @param dirs the list of module directives
|
||||
* @param htmltree the content tree to which the table will be added
|
||||
*/
|
||||
public void addExportedPackagesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
|
||||
Content htmltree) {
|
||||
addSummary(text, tableSummary, htmltree, HtmlStyle.packagesSummary, exportedPackagesTableHeader, dirs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the exported packages list for the module.
|
||||
*
|
||||
* @param direct the requires directive
|
||||
* @param tbody the content tree to which the directive will be added
|
||||
* @param altColor true if altColor style should be used or false if rowColor style should be used
|
||||
*/
|
||||
public void addExportedPackagesList(ModuleElement.ExportsDirective direct, Content tbody, boolean altColor) {
|
||||
PackageElement pkg = direct.getPackage();
|
||||
Content pkgLinkContent = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg)));
|
||||
Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, pkgLinkContent);
|
||||
HtmlTree tdModules = new HtmlTree(HtmlTag.TD);
|
||||
tdModules.addStyle(HtmlStyle.colSecond);
|
||||
List<? extends ModuleElement> targetModules = direct.getTargetModules();
|
||||
if (targetModules != null) {
|
||||
List<? extends ModuleElement> mElements = direct.getTargetModules();
|
||||
for (int i = 0; i < mElements.size(); i++) {
|
||||
if (i > 0) {
|
||||
tdModules.addContent(new HtmlTree(HtmlTag.BR));
|
||||
}
|
||||
ModuleElement m = mElements.get(i);
|
||||
tdModules.addContent(new StringContent(m.getQualifiedName().toString()));
|
||||
}
|
||||
} else {
|
||||
tdModules.addContent(configuration.getText("doclet.All_Modules"));
|
||||
}
|
||||
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
|
||||
tdSummary.addStyle(HtmlStyle.colLast);
|
||||
addSummaryComment(pkg, tdSummary);
|
||||
HtmlTree tr = HtmlTree.TR(tdPackage);
|
||||
tr.addContent(tdModules);
|
||||
tr.addContent(tdSummary);
|
||||
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
|
||||
tbody.addContent(tr);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void addServicesSummary(Content summaryContentTree) {
|
||||
List<ModuleElement.Directive> usesDirs = directiveMap.get(DirectiveKind.USES);
|
||||
List<ModuleElement.Directive> providesDirs = directiveMap.get(DirectiveKind.PROVIDES);
|
||||
if ((usesDirs != null && !usesDirs.isEmpty()) || (providesDirs != null && !providesDirs.isEmpty())) {
|
||||
HtmlTree li = new HtmlTree(HtmlTag.LI);
|
||||
li.addStyle(HtmlStyle.blockList);
|
||||
addSummaryHeader(HtmlConstants.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
|
||||
getResource("doclet.navServices"), li);
|
||||
String text;
|
||||
String tableSummary;
|
||||
if (usesDirs != null && !usesDirs.isEmpty()) {
|
||||
text = configuration.getText("doclet.Uses_Summary");
|
||||
tableSummary = configuration.getText("doclet.Member_Table_Summary",
|
||||
configuration.getText("doclet.Uses_Summary"),
|
||||
configuration.getText("doclet.types"));
|
||||
addUsesSummary(text, tableSummary, usesDirs, li);
|
||||
}
|
||||
if (providesDirs != null && !providesDirs.isEmpty()) {
|
||||
text = configuration.getText("doclet.Provides_Summary");
|
||||
tableSummary = configuration.getText("doclet.Member_Table_Summary",
|
||||
configuration.getText("doclet.Provides_Summary"),
|
||||
configuration.getText("doclet.types"));
|
||||
addProvidesSummary(text, tableSummary, providesDirs, li);
|
||||
}
|
||||
HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
|
||||
summaryContentTree.addContent(ul);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the uses summary for the module.
|
||||
*
|
||||
* @param text the table caption
|
||||
* @param tableSummary the summary for the table
|
||||
* @param dirs the list of module directives
|
||||
* @param htmltree the content tree to which the table will be added
|
||||
*/
|
||||
public void addUsesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
|
||||
Content htmltree) {
|
||||
addSummary(text, tableSummary, htmltree, HtmlStyle.usesSummary, usesTableHeader, dirs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the uses list for the module.
|
||||
*
|
||||
* @param direct the requires directive
|
||||
* @param tbody the content tree to which the directive will be added
|
||||
* @param altColor true if altColor style should be used or false if rowColor style should be used
|
||||
*/
|
||||
public void addUsesList(ModuleElement.UsesDirective direct, Content tbody, boolean altColor) {
|
||||
TypeElement type = direct.getService();
|
||||
Content typeLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, type));
|
||||
Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, typeLinkContent);
|
||||
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
|
||||
tdSummary.addStyle(HtmlStyle.colLast);
|
||||
addSummaryComment(type, tdSummary);
|
||||
HtmlTree tr = HtmlTree.TR(tdPackage);
|
||||
tr.addContent(tdSummary);
|
||||
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
|
||||
tbody.addContent(tr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the provides summary for the module.
|
||||
*
|
||||
* @param text the table caption
|
||||
* @param tableSummary the summary for the table
|
||||
* @param dirs the list of module directives
|
||||
* @param htmltree the content tree to which the table will be added
|
||||
*/
|
||||
public void addProvidesSummary(String text, String tableSummary, List<ModuleElement.Directive> dirs,
|
||||
Content htmltree) {
|
||||
addSummary(text, tableSummary, htmltree, HtmlStyle.providesSummary, providesTableHeader, dirs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the exported packages list for the module.
|
||||
*
|
||||
* @param direct the requires directive
|
||||
* @param tbody the content tree to which the directive will be added
|
||||
* @param altColor true if altColor style should be used or false if rowColor style should be used
|
||||
*/
|
||||
public void addProvidesList(ModuleElement.ProvidesDirective direct, Content tbody, boolean altColor) {
|
||||
TypeElement impl = direct.getImplementation();
|
||||
TypeElement srv = direct.getService();
|
||||
Content implLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, impl));
|
||||
Content srvLinkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.PACKAGE, srv));
|
||||
HtmlTree tdType = HtmlTree.TD(HtmlStyle.colFirst, srvLinkContent);
|
||||
tdType.addContent(new HtmlTree(HtmlTag.BR));
|
||||
tdType.addContent("(");
|
||||
HtmlTree implSpan = HtmlTree.SPAN(HtmlStyle.implementationLabel, getResource("doclet.Implementation"));
|
||||
tdType.addContent(implSpan);
|
||||
tdType.addContent(getSpace());
|
||||
tdType.addContent(implLinkContent);
|
||||
tdType.addContent(")");
|
||||
HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
|
||||
tdDesc.addStyle(HtmlStyle.colLast);
|
||||
addSummaryComment(srv, tdDesc);
|
||||
HtmlTree tr = HtmlTree.TR(tdType);
|
||||
tr.addContent(tdDesc);
|
||||
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
|
||||
tbody.addContent(tr);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -196,31 +511,58 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds list of packages in the package summary table. Generate link to each package.
|
||||
* Add summary details to the navigation bar.
|
||||
*
|
||||
* @param packages Packages to which link is to be generated
|
||||
* @param tbody the documentation tree to which the list will be added
|
||||
* @param subDiv the content tree to which the summary detail links will be added
|
||||
*/
|
||||
protected void addPackagesList(Set<PackageElement> packages, Content tbody) {
|
||||
boolean altColor = true;
|
||||
for (PackageElement pkg : packages) {
|
||||
if (pkg != null && !pkg.isUnnamed()) {
|
||||
if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) {
|
||||
Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg));
|
||||
Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent);
|
||||
HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
|
||||
tdSummary.addStyle(HtmlStyle.colLast);
|
||||
addSummaryComment(pkg, tdSummary);
|
||||
HtmlTree tr = HtmlTree.TR(tdPackage);
|
||||
tr.addContent(tdSummary);
|
||||
tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
|
||||
tbody.addContent(tr);
|
||||
}
|
||||
}
|
||||
altColor = !altColor;
|
||||
protected void addSummaryDetailLinks(Content subDiv) {
|
||||
try {
|
||||
Content div = HtmlTree.DIV(getNavSummaryLinks());
|
||||
subDiv.addContent(div);
|
||||
} catch (Exception e) {
|
||||
throw new DocletAbortException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary links for navigation bar.
|
||||
*
|
||||
* @return the content tree for the navigation summary links
|
||||
*/
|
||||
protected Content getNavSummaryLinks() throws Exception {
|
||||
Content li = HtmlTree.LI(moduleSubNavLabel);
|
||||
li.addContent(getSpace());
|
||||
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
|
||||
Content liNav = new HtmlTree(HtmlTag.LI);
|
||||
liNav.addContent(!utils.getBody(mdle).isEmpty() && !configuration.nocomment
|
||||
? getHyperLink(SectionName.MODULE_DESCRIPTION, getResource("doclet.navModuleDescription"))
|
||||
: getResource("doclet.navModuleDescription"));
|
||||
addNavGap(liNav);
|
||||
liNav.addContent(showDirectives(DirectiveKind.REQUIRES)
|
||||
? getHyperLink(SectionName.MODULES, getResource("doclet.navModules"))
|
||||
: getResource("doclet.navModules"));
|
||||
addNavGap(liNav);
|
||||
liNav.addContent(showDirectives(DirectiveKind.EXPORTS)
|
||||
? getHyperLink(SectionName.PACKAGES, getResource("doclet.navPackages"))
|
||||
: getResource("doclet.navPackages"));
|
||||
addNavGap(liNav);
|
||||
liNav.addContent((showDirectives(DirectiveKind.USES) || showDirectives(DirectiveKind.PROVIDES))
|
||||
? getHyperLink(SectionName.SERVICES, getResource("doclet.navServices"))
|
||||
: getResource("doclet.navServices"));
|
||||
ulNav.addContent(liNav);
|
||||
return ulNav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the directive should be displayed.
|
||||
*
|
||||
* @param dirKind the kind of directive for the module
|
||||
* @return true if the directive should be displayed
|
||||
*/
|
||||
private boolean showDirectives(DirectiveKind dirKind) {
|
||||
return directiveMap.get(dirKind) != null && !directiveMap.get(dirKind).isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
@ -54,6 +54,9 @@ public enum SectionName {
|
||||
METHODS_INHERITANCE("methods.inherited.from.class."),
|
||||
METHOD_SUMMARY("method.summary"),
|
||||
MODULE_DESCRIPTION("module.description"),
|
||||
MODULES("modules.summary"),
|
||||
PACKAGES("packages.summary"),
|
||||
SERVICES("services.summary"),
|
||||
NAVBAR_BOTTOM("navbar.bottom"),
|
||||
NAVBAR_BOTTOM_FIRSTROW("navbar.bottom.firstrow"),
|
||||
NAVBAR_TOP("navbar.top"),
|
||||
|
||||
@ -69,6 +69,24 @@ public class HtmlConstants {
|
||||
public static final Content START_OF_MODULE_DESCRIPTION =
|
||||
new Comment("============ MODULE DESCRIPTION ===========");
|
||||
|
||||
/**
|
||||
* Marker to identify start of modules summary.
|
||||
*/
|
||||
public static final Content START_OF_MODULES_SUMMARY =
|
||||
new Comment("============ MODULES SUMMARY ===========");
|
||||
|
||||
/**
|
||||
* Marker to identify start of packages summary.
|
||||
*/
|
||||
public static final Content START_OF_PACKAGES_SUMMARY =
|
||||
new Comment("============ PACKAGES SUMMARY ===========");
|
||||
|
||||
/**
|
||||
* Marker to identify start of services summary.
|
||||
*/
|
||||
public static final Content START_OF_SERVICES_SUMMARY =
|
||||
new Comment("============ SERVICES SUMMARY ===========");
|
||||
|
||||
/**
|
||||
* Marker to identify start of class data.
|
||||
*/
|
||||
|
||||
@ -49,6 +49,7 @@ public enum HtmlStyle {
|
||||
colFirst,
|
||||
colLast,
|
||||
colOne,
|
||||
colSecond,
|
||||
constantsSummary,
|
||||
constantValuesContainer,
|
||||
contentContainer,
|
||||
@ -65,6 +66,7 @@ public enum HtmlStyle {
|
||||
header,
|
||||
horizontal,
|
||||
footer,
|
||||
implementationLabel,
|
||||
indexContainer,
|
||||
indexNav,
|
||||
inheritance,
|
||||
@ -87,7 +89,10 @@ public enum HtmlStyle {
|
||||
overviewSummary,
|
||||
packageHierarchyLabel,
|
||||
packageLabelInClass,
|
||||
packagesSummary,
|
||||
paramLabel,
|
||||
providesSummary,
|
||||
requiresSummary,
|
||||
returnLabel,
|
||||
rightContainer,
|
||||
rightIframe,
|
||||
@ -111,5 +116,6 @@ public enum HtmlStyle {
|
||||
typeNameLabel,
|
||||
typeNameLink,
|
||||
typeSummary,
|
||||
useSummary
|
||||
useSummary,
|
||||
usesSummary
|
||||
}
|
||||
|
||||
@ -76,6 +76,26 @@ public class HtmlWriter {
|
||||
*/
|
||||
protected final List<String> packageTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying modules and description..
|
||||
*/
|
||||
protected final List<String> requiresTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying packages and description..
|
||||
*/
|
||||
protected final List<String> exportedPackagesTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying types and description..
|
||||
*/
|
||||
protected final List<String> usesTableHeader;
|
||||
|
||||
/**
|
||||
* Header for tables displaying types and description..
|
||||
*/
|
||||
protected final List<String> providesTableHeader;
|
||||
|
||||
/**
|
||||
* Summary for use tables displaying class and package use.
|
||||
*/
|
||||
@ -108,6 +128,8 @@ public class HtmlWriter {
|
||||
|
||||
public final Content detailLabel;
|
||||
|
||||
public final Content moduleSubNavLabel;
|
||||
|
||||
public final Content framesLabel;
|
||||
|
||||
public final Content noframesLabel;
|
||||
@ -192,6 +214,19 @@ public class HtmlWriter {
|
||||
packageTableHeader = new ArrayList<>();
|
||||
packageTableHeader.add(configuration.getText("doclet.Package"));
|
||||
packageTableHeader.add(configuration.getText("doclet.Description"));
|
||||
requiresTableHeader = new ArrayList<>();
|
||||
requiresTableHeader.add(configuration.getText("doclet.Module"));
|
||||
requiresTableHeader.add(configuration.getText("doclet.Description"));
|
||||
exportedPackagesTableHeader = new ArrayList<>();
|
||||
exportedPackagesTableHeader.add(configuration.getText("doclet.Package"));
|
||||
exportedPackagesTableHeader.add(configuration.getText("doclet.Module"));
|
||||
exportedPackagesTableHeader.add(configuration.getText("doclet.Description"));
|
||||
usesTableHeader = new ArrayList<>();
|
||||
usesTableHeader.add(configuration.getText("doclet.Type"));
|
||||
usesTableHeader.add(configuration.getText("doclet.Description"));
|
||||
providesTableHeader = new ArrayList<>();
|
||||
providesTableHeader.add(configuration.getText("doclet.Type"));
|
||||
providesTableHeader.add(configuration.getText("doclet.Description"));
|
||||
useTableSummary = configuration.getText("doclet.Use_Table_Summary",
|
||||
configuration.getText("doclet.packages"));
|
||||
modifierTypeHeader = configuration.getText("doclet.0_and_1",
|
||||
@ -208,6 +243,7 @@ public class HtmlWriter {
|
||||
nextclassLabel = getNonBreakResource("doclet.Next_Class");
|
||||
summaryLabel = getResource("doclet.Summary");
|
||||
detailLabel = getResource("doclet.Detail");
|
||||
moduleSubNavLabel = getResource("doclet.Module_Sub_Nav");
|
||||
framesLabel = getResource("doclet.Frames");
|
||||
noframesLabel = getNonBreakResource("doclet.No_Frames");
|
||||
treeLabel = getResource("doclet.Tree");
|
||||
|
||||
@ -31,6 +31,11 @@ doclet.Href_Type_Param_Title=type parameter in {0}
|
||||
doclet.Href_Class_Or_Interface_Title=class or interface in {0}
|
||||
doclet.Summary=Summary:
|
||||
doclet.Detail=Detail:
|
||||
doclet.Module_Sub_Nav=Module:
|
||||
doclet.navModuleDescription=Description
|
||||
doclet.navModules=Modules
|
||||
doclet.navPackages=Packages
|
||||
doclet.navServices=Services
|
||||
doclet.navNested=Nested
|
||||
doclet.navAnnotationTypeOptionalMember=Optional
|
||||
doclet.navAnnotationTypeRequiredMember=Required
|
||||
|
||||
@ -91,15 +91,25 @@ public interface ModuleSummaryWriter {
|
||||
public abstract void addModuleTags(Content moduleContentTree);
|
||||
|
||||
/**
|
||||
* Adds the table of packages to the documentation tree.
|
||||
* Adds the modules summary to the documentation tree.
|
||||
*
|
||||
* @param packages the set of packages that should be added.
|
||||
* @param label the label for this table.
|
||||
* @param tableSummary the summary string for the table
|
||||
* @param summaryContentTree the content tree to which the summary will be added
|
||||
*/
|
||||
public abstract void addPackagesSummary(Set<PackageElement> packages, String label,
|
||||
String tableSummary, Content summaryContentTree);
|
||||
public abstract void addModulesSummary(Content summaryContentTree);
|
||||
|
||||
/**
|
||||
* Adds the packages summary to the documentation tree.
|
||||
*
|
||||
* @param summaryContentTree the content tree to which the summary will be added
|
||||
*/
|
||||
public abstract void addPackagesSummary(Content summaryContentTree);
|
||||
|
||||
/**
|
||||
* Adds the services summary to the documentation tree.
|
||||
*
|
||||
* @param summaryContentTree the content tree to which the summary will be added
|
||||
*/
|
||||
public abstract void addServicesSummary(Content summaryContentTree);
|
||||
|
||||
/**
|
||||
* Adds the module content tree to the documentation tree.
|
||||
|
||||
@ -167,23 +167,34 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the module package summary.
|
||||
* Build the modules summary.
|
||||
*
|
||||
* @param node the XML element that specifies which components to document
|
||||
* @param summaryContentTree the content tree to which the summaries will
|
||||
* be added
|
||||
*/
|
||||
public void buildPackageSummary(XMLNode node, Content summaryContentTree) {
|
||||
Set<PackageElement> packages = configuration.modulePackages.get(mdle);
|
||||
if (!packages.isEmpty()) {
|
||||
String packageTableSummary
|
||||
= configuration.getText("doclet.Member_Table_Summary",
|
||||
configuration.getText("doclet.Package_Summary"),
|
||||
configuration.getText("doclet.packages"));
|
||||
moduleWriter.addPackagesSummary(
|
||||
packages, configuration.getText("doclet.Package_Summary"),
|
||||
packageTableSummary, summaryContentTree);
|
||||
public void buildModulesSummary(XMLNode node, Content summaryContentTree) {
|
||||
moduleWriter.addModulesSummary(summaryContentTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the package summary.
|
||||
*
|
||||
* @param node the XML element that specifies which components to document
|
||||
* @param summaryContentTree the content tree to which the summaries will be added
|
||||
*/
|
||||
public void buildPackagesSummary(XMLNode node, Content summaryContentTree) {
|
||||
moduleWriter.addPackagesSummary(summaryContentTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the services summary.
|
||||
*
|
||||
* @param node the XML element that specifies which components to document
|
||||
* @param summaryContentTree the content tree to which the summaries will be added
|
||||
*/
|
||||
public void buildServicesSummary(XMLNode node, Content summaryContentTree) {
|
||||
moduleWriter.addServicesSummary(summaryContentTree);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -33,7 +33,9 @@
|
||||
<ModuleDescription/>
|
||||
<ModuleTags/>
|
||||
<Summary>
|
||||
<PackageSummary/>
|
||||
<ModulesSummary/>
|
||||
<PackagesSummary/>
|
||||
<ServicesSummary/>
|
||||
</Summary>
|
||||
</Content>
|
||||
</ModuleDoc>
|
||||
|
||||
@ -69,6 +69,10 @@ doclet.noInheritedDoc=@inheritDoc used but {0} does not override or implement an
|
||||
doclet.tag_misuse=Tag {0} cannot be used in {1} documentation. It can only be used in the following types of documentation: {2}.
|
||||
doclet.javafx_tag_misuse=Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters.
|
||||
doclet.Package_Summary=Package Summary
|
||||
doclet.Requires_Summary=Requires
|
||||
doclet.Exported_Packages_Summary=Exported Packages
|
||||
doclet.Uses_Summary=Uses
|
||||
doclet.Provides_Summary=Provides
|
||||
doclet.Module_Summary=Module Summary
|
||||
doclet.Interface_Summary=Interface Summary
|
||||
doclet.Annotation_Types_Summary=Annotation Types Summary
|
||||
@ -93,6 +97,7 @@ doclet.Classes=Classes
|
||||
doclet.Packages=Packages
|
||||
doclet.packages=packages
|
||||
doclet.modules=modules
|
||||
doclet.types=types
|
||||
doclet.All_Classes=All Classes
|
||||
doclet.All_Superinterfaces=All Superinterfaces:
|
||||
doclet.All_Implemented_Interfaces=All Implemented Interfaces:
|
||||
@ -170,6 +175,7 @@ doclet.subclasses=subclasses
|
||||
doclet.subinterfaces=subinterfaces
|
||||
doclet.Modifier=Modifier
|
||||
doclet.Type=Type
|
||||
doclet.Implementation=Implementation:
|
||||
doclet.Types=Types
|
||||
doclet.Members=Members
|
||||
doclet.SearchTags=SearchTags
|
||||
|
||||
@ -412,18 +412,20 @@ table tr td dl, table tr td dl dt, table tr td dl dd {
|
||||
/*
|
||||
Table styles
|
||||
*/
|
||||
.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary {
|
||||
.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary,
|
||||
.requiresSummary, .packagesSummary, .providesSummary, .usesSummary {
|
||||
width:100%;
|
||||
border-spacing:0;
|
||||
border-left:1px solid #EEE;
|
||||
border-right:1px solid #EEE;
|
||||
border-bottom:1px solid #EEE;
|
||||
}
|
||||
.overviewSummary, .memberSummary {
|
||||
.overviewSummary, .memberSummary, .requiresSummary, .packagesSummary, .providesSummary, .usesSummary {
|
||||
padding:0px;
|
||||
}
|
||||
.overviewSummary caption, .memberSummary caption, .typeSummary caption,
|
||||
.useSummary caption, .constantsSummary caption, .deprecatedSummary caption {
|
||||
.useSummary caption, .constantsSummary caption, .deprecatedSummary caption,
|
||||
.requiresSummary caption, .packagesSummary caption, .providesSummary caption, .usesSummary caption {
|
||||
position:relative;
|
||||
text-align:left;
|
||||
background-repeat:no-repeat;
|
||||
@ -439,16 +441,26 @@ Table styles
|
||||
}
|
||||
.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link,
|
||||
.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link,
|
||||
.requiresSummary caption a:link, .packagesSummary caption a:link, providesSummary caption a:link,
|
||||
.usesSummary caption a:link,
|
||||
.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover,
|
||||
.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover,
|
||||
.requiresSummary caption a:hover, .packagesSummary caption a:hover, providesSummary caption a:hover,
|
||||
.usesSummary caption a:hover,
|
||||
.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active,
|
||||
.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active,
|
||||
.requiresSummary caption a:active, .packagesSummary caption a:active, providesSummary caption a:active,
|
||||
.usesSummary caption a:active,
|
||||
.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited,
|
||||
.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited {
|
||||
.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited
|
||||
.requiresSummary caption a:visited, .packagesSummary caption a:visited, providesSummary caption a:visited,
|
||||
.usesSummary caption a:visited {
|
||||
color:#FFFFFF;
|
||||
}
|
||||
.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,
|
||||
.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {
|
||||
.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span,
|
||||
.requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span,
|
||||
.usesSummary caption span {
|
||||
white-space:nowrap;
|
||||
padding-top:5px;
|
||||
padding-left:12px;
|
||||
@ -491,7 +503,8 @@ Table styles
|
||||
display:inline;
|
||||
}
|
||||
.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd,
|
||||
.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd {
|
||||
.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd,
|
||||
.requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd {
|
||||
display:none;
|
||||
width:5px;
|
||||
position:relative;
|
||||
@ -516,18 +529,19 @@ Table styles
|
||||
|
||||
}
|
||||
.overviewSummary td, .memberSummary td, .typeSummary td,
|
||||
.useSummary td, .constantsSummary td, .deprecatedSummary td {
|
||||
.useSummary td, .constantsSummary td, .deprecatedSummary td,
|
||||
.requiresSummary td, .packagesSummary td, .providesSummary td, .usesSummary td {
|
||||
text-align:left;
|
||||
padding:0px 0px 12px 10px;
|
||||
}
|
||||
th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
|
||||
td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
|
||||
th.colOne, th.colFirst, th.colSecond, th.colLast, .useSummary th, .constantsSummary th, .packagesSummary th,
|
||||
td.colOne, td.colFirst, td.colSecond, td.colLast, .useSummary td, .constantsSummary td {
|
||||
vertical-align:top;
|
||||
padding-right:0px;
|
||||
padding-top:8px;
|
||||
padding-bottom:3px;
|
||||
}
|
||||
th.colFirst, th.colLast, th.colOne, .constantsSummary th {
|
||||
th.colFirst, th.colSecond, th.colLast, th.colOne, .constantsSummary th, .packagesSummary th {
|
||||
background:#dee3e9;
|
||||
text-align:left;
|
||||
padding:8px 3px 3px 7px;
|
||||
@ -539,10 +553,19 @@ td.colFirst, th.colFirst {
|
||||
td.colLast, th.colLast {
|
||||
font-size:13px;
|
||||
}
|
||||
td.colOne, th.colOne {
|
||||
td.colOne, th.colOne, .constantsSummary th, .packagesSummary th {
|
||||
font-size:13px;
|
||||
}
|
||||
.providesSummary th.colFirst, .providesSummary th.colLast, .providesSummary td.colFirst,
|
||||
.providesSummary td.colLast {
|
||||
white-space:normal;
|
||||
width:50%;
|
||||
font-size:13px;
|
||||
}
|
||||
.overviewSummary td.colFirst, .overviewSummary th.colFirst,
|
||||
.requiresSummary td.colFirst, .requiresSummary th.colFirst,
|
||||
.packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th,
|
||||
.usesSummary td.colFirst, .usesSummary th.colFirst,
|
||||
.useSummary td.colFirst, .useSummary th.colFirst,
|
||||
.overviewSummary td.colOne, .overviewSummary th.colOne,
|
||||
.memberSummary td.colFirst, .memberSummary th.colFirst,
|
||||
@ -551,7 +574,7 @@ td.colOne, th.colOne {
|
||||
width:25%;
|
||||
vertical-align:top;
|
||||
}
|
||||
td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
|
||||
td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colSecond a:link, td.colSecond a:active, td.colSecond a:visited, td.colSecond a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
|
||||
font-weight:bold;
|
||||
}
|
||||
.tableSubHeadingColor {
|
||||
@ -611,7 +634,7 @@ h1.hidden {
|
||||
margin:3px 10px 2px 0px;
|
||||
color:#474747;
|
||||
}
|
||||
.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
|
||||
.deprecatedLabel, .descfrmTypeLabel, .implementationLabel, .memberNameLabel, .memberNameLink,
|
||||
.moduleLabelInClass, .overrideSpecifyLabel, .packageLabelInClass,
|
||||
.packageHierarchyLabel, .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel,
|
||||
.throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink {
|
||||
|
||||
@ -25,20 +25,19 @@
|
||||
|
||||
package com.sun.tools.jdeps;
|
||||
|
||||
import static com.sun.tools.jdeps.JdepsConfiguration.*;
|
||||
|
||||
import com.sun.tools.classfile.Dependency.Location;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@ -369,35 +368,29 @@ public class Analyzer {
|
||||
}
|
||||
}
|
||||
|
||||
static final JdkInternals REMOVED_JDK_INTERNALS = new JdkInternals();
|
||||
static final Jdk8Internals REMOVED_JDK_INTERNALS = new Jdk8Internals();
|
||||
|
||||
static class JdkInternals extends Module {
|
||||
private final String BUNDLE = "com.sun.tools.jdeps.resources.jdkinternals";
|
||||
|
||||
private final Set<String> jdkinternals;
|
||||
private final Set<String> jdkUnsupportedClasses;
|
||||
private JdkInternals() {
|
||||
static class Jdk8Internals extends Module {
|
||||
private final String JDK8_INTERNALS = "/com/sun/tools/jdeps/resources/jdk8_internals.txt";
|
||||
private final Set<String> jdk8Internals;
|
||||
private Jdk8Internals() {
|
||||
super("JDK removed internal API");
|
||||
|
||||
try {
|
||||
ResourceBundle rb = ResourceBundle.getBundle(BUNDLE);
|
||||
this.jdkinternals = rb.keySet();
|
||||
} catch (MissingResourceException e) {
|
||||
throw new InternalError("Cannot find jdkinternals resource bundle");
|
||||
try (InputStream in = JdepsTask.class.getResourceAsStream(JDK8_INTERNALS);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
|
||||
this.jdk8Internals = reader.lines()
|
||||
.filter(ln -> !ln.startsWith("#"))
|
||||
.collect(Collectors.toSet());
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
|
||||
this.jdkUnsupportedClasses = getUnsupportedClasses();
|
||||
}
|
||||
|
||||
public boolean contains(Location location) {
|
||||
if (jdkUnsupportedClasses.contains(location.getName() + ".class")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String cn = location.getClassName();
|
||||
int i = cn.lastIndexOf('.');
|
||||
String pn = i > 0 ? cn.substring(0, i) : "";
|
||||
return jdkinternals.contains(cn) || jdkinternals.contains(pn);
|
||||
|
||||
return jdk8Internals.contains(pn);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -414,25 +407,5 @@ public class Analyzer {
|
||||
public boolean isExported(String pn) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private Set<String> getUnsupportedClasses() {
|
||||
// jdk.unsupported may not be observable
|
||||
Optional<Module> om = Profile.FULL_JRE.findModule(JDK_UNSUPPORTED);
|
||||
if (om.isPresent()) {
|
||||
return om.get().reader().entries();
|
||||
}
|
||||
|
||||
// find from local run-time image
|
||||
SystemModuleFinder system = new SystemModuleFinder();
|
||||
if (system.find(JDK_UNSUPPORTED).isPresent()) {
|
||||
try {
|
||||
return system.getClassReader(JDK_UNSUPPORTED).entries();
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return Collections.emptySet();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,7 @@ sun.security.util.SecurityConstants=Use appropriate java.security.Permission sub
|
||||
sun.security.x509.X500Name=Use javax.security.auth.x500.X500Principal @since 1.4
|
||||
sun.tools.jar=Use java.util.jar or jar tool @since 1.2
|
||||
# Internal APIs removed in JDK 9
|
||||
com.apple.eawt=Use java.awt.desktop and JEP 272 @since 9
|
||||
com.apple.eawt=Use java.awt.Desktop and JEP 272 @since 9
|
||||
com.apple.concurrent=Removed. See https://bugs.openjdk.java.net/browse/JDK-8148187
|
||||
com.sun.image.codec.jpeg=Use javax.imageio @since 1.4
|
||||
sun.awt.image.codec=Use javax.imageio @since 1.4
|
||||
|
||||
@ -27,9 +27,6 @@
|
||||
#
|
||||
# javadoc
|
||||
|
||||
com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java 8006735 generic-all output type annotations in javadoc
|
||||
com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java 8013406 generic-all Test cases fail in javadoc test TestSmoke.java
|
||||
|
||||
jdk/javadoc/tool/6176978/T6176978.java 8152049 generic-all no longer applicable, should delete
|
||||
jdk/javadoc/tool/InlineTagsWithBraces.java 8152050 generic-all API, re-evaluate @bold, @maybe causes doclint to throw up.
|
||||
jdk/javadoc/tool/LangVers.java 8152051 generic-all API, re-evaluate, unsure of this test.
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib
|
||||
* @modules jdk.javadoc
|
||||
* @ignore 8006735 output type annotations in javadoc
|
||||
* @build JavadocTester
|
||||
* @run main TestTypeAnnotations
|
||||
*/
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
* @author Mahmood Ali <mali>
|
||||
* @library ../../lib
|
||||
* @modules jdk.javadoc
|
||||
* @ignore
|
||||
* @build JavadocTester
|
||||
* @run main TestSmoke
|
||||
*/
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8154119 8154262 8156077 8157987
|
||||
* @bug 8154119 8154262 8156077 8157987 8154261
|
||||
* @summary Test modules support in javadoc.
|
||||
* @author bpatel
|
||||
* @library ../lib
|
||||
@ -110,6 +110,17 @@ public class TestModules extends JavadocTester {
|
||||
testModuleTags();
|
||||
}
|
||||
|
||||
@Test
|
||||
void test7() {
|
||||
javadoc("-d", "out-moduleSummary", "-use",
|
||||
"-modulesourcepath", testSrc,
|
||||
"-addmods", "module1,module2",
|
||||
"testpkgmdl1", "testpkgmdl2", "testpkg2mdl2");
|
||||
checkExit(Exit.OK);
|
||||
testModuleSummary();
|
||||
testNegatedModuleSummary();
|
||||
}
|
||||
|
||||
@Test
|
||||
void test8() {
|
||||
javadoc("-d", "out-html5-nomodule", "-html5", "-use",
|
||||
@ -139,12 +150,16 @@ public class TestModules extends JavadocTester {
|
||||
"<div class=\"contentContainer\">\n"
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">");
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<!-- ============ MODULES SUMMARY =========== -->");
|
||||
checkOutput("module2-summary.html", found,
|
||||
"<div class=\"contentContainer\">\n"
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">");
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<!-- ============ MODULES SUMMARY =========== -->");
|
||||
}
|
||||
|
||||
void testHtml5Description(boolean found) {
|
||||
@ -171,12 +186,16 @@ public class TestModules extends JavadocTester {
|
||||
"<div class=\"contentContainer\">\n"
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<table class=\"overviewSummary\">");
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<!-- ============ MODULES SUMMARY =========== -->");
|
||||
checkOutput("module2-summary.html", found,
|
||||
"<div class=\"contentContainer\">\n"
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<table class=\"overviewSummary\">");
|
||||
+ "<ul class=\"blockList\">\n"
|
||||
+ "<li class=\"blockList\">\n"
|
||||
+ "<!-- ============ MODULES SUMMARY =========== -->");
|
||||
}
|
||||
|
||||
void testModuleLink() {
|
||||
@ -313,4 +332,114 @@ public class TestModules extends JavadocTester {
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
}
|
||||
|
||||
void testModuleSummary() {
|
||||
checkOutput("module1-summary.html", true,
|
||||
"<ul class=\"subNavList\">\n"
|
||||
+ "<li>Module: </li>\n"
|
||||
+ "<li><a href=\"#module.description\">Description</a> | <a "
|
||||
+ "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">"
|
||||
+ "Packages</a> | Services</li>\n"
|
||||
+ "</ul>");
|
||||
checkOutput("module1-summary.html", true,
|
||||
"<!-- ============ MODULES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"modules.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("module1-summary.html", true,
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<td class=\"colFirst\"><a href=\"testpkgmdl1/package-summary.html\">testpkgmdl1</a></td>\n"
|
||||
+ "<td class=\"colSecond\">All Modules</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module1-summary.html", true,
|
||||
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"packages.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("module1-summary.html", true,
|
||||
"<tr class=\"rowColor\">\n"
|
||||
+ "<td class=\"colFirst\"><a href=\"module2-summary.html\">module2</a></td>\n"
|
||||
+ "<td class=\"colLast\">\n"
|
||||
+ "<div class=\"block\">This is a test description for the module2 module.</div>\n"
|
||||
+ "</td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<li><a href=\"#module.description\">Description</a> | <a "
|
||||
+ "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">"
|
||||
+ "Packages</a> | <a href=\"#services.summary\">Services</a></li>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<!-- ============ MODULES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"modules.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<tr class=\"rowColor\">\n"
|
||||
+ "<td class=\"colFirst\">testpkg2mdl2</td>\n"
|
||||
+ "<td class=\"colSecond\">module1</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<!-- ============ PACKAGES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"packages.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<td class=\"colFirst\"><a href=\"java.base-summary.html\">java.base</a></td>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<!-- ============ SERVICES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"services.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<td class=\"colFirst\"><a href=\"testpkgmdl2/TestClassInModule2.html\" "
|
||||
+ "title=\"class in testpkgmdl2\">TestClassInModule2</a></td>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<tr class=\"altColor\">\n"
|
||||
+ "<td class=\"colFirst\">testpkg2mdl2.TestInterfaceInModule2<br>(<span "
|
||||
+ "class=\"implementationLabel\">Implementation:</span> <a "
|
||||
+ "href=\"testpkgmdl2/TestClassInModule2.html\" title=\"class in testpkgmdl2\">"
|
||||
+ "TestClassInModule2</a>)</td>\n"
|
||||
+ "<td class=\"colLast\"> </td>\n"
|
||||
+ "</tr");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<caption><span>Exported Packages</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
|
||||
+ "<th scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<caption><span>Requires</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<caption><span>Uses</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
checkOutput("module2-summary.html", true,
|
||||
"<caption><span>Provides</span><span class=\"tabEnd\"> </span></caption>\n"
|
||||
+ "<tr>\n"
|
||||
+ "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
|
||||
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n"
|
||||
+ "</tr>");
|
||||
}
|
||||
|
||||
void testNegatedModuleSummary() {
|
||||
checkOutput("module1-summary.html", false,
|
||||
"<!-- ============ SERVICES SUMMARY =========== -->\n"
|
||||
+ "<a name=\"services.summary\">\n"
|
||||
+ "<!-- -->\n"
|
||||
+ "</a>");
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,4 +28,10 @@
|
||||
*/
|
||||
module module2 {
|
||||
exports testpkgmdl2;
|
||||
|
||||
exports testpkg2mdl2 to module1;
|
||||
|
||||
uses testpkgmdl2.TestClassInModule2;
|
||||
|
||||
provides testpkg2mdl2.TestInterfaceInModule2 with testpkgmdl2.TestClassInModule2;
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* 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 testpkg2mdl2;
|
||||
|
||||
public interface TestInterfaceInModule2 {
|
||||
void testMethod();
|
||||
}
|
||||
@ -24,5 +24,8 @@
|
||||
*/
|
||||
package testpkgmdl2;
|
||||
|
||||
public class TestClassInModule2 {
|
||||
import testpkg2mdl2.TestInterfaceInModule2;
|
||||
|
||||
public class TestClassInModule2 implements TestInterfaceInModule2 {
|
||||
void testMethod() {}
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461
|
||||
* @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261
|
||||
* @summary Run tests on doclet stylesheet.
|
||||
* @author jamieh
|
||||
* @library ../lib
|
||||
@ -81,7 +81,8 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ " list-style-type:disc;\n"
|
||||
+ "}",
|
||||
".overviewSummary caption, .memberSummary caption, .typeSummary caption,\n"
|
||||
+ ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption {\n"
|
||||
+ ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption,\n"
|
||||
+ ".requiresSummary caption, .packagesSummary caption, .providesSummary caption, .usesSummary caption {\n"
|
||||
+ " position:relative;\n"
|
||||
+ " text-align:left;\n"
|
||||
+ " background-repeat:no-repeat;\n"
|
||||
@ -96,7 +97,9 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ " white-space:pre;\n"
|
||||
+ "}",
|
||||
".overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,\n"
|
||||
+ ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {\n"
|
||||
+ ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span,\n"
|
||||
+ ".requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span,\n"
|
||||
+ ".usesSummary caption span {\n"
|
||||
+ " white-space:nowrap;\n"
|
||||
+ " padding-top:5px;\n"
|
||||
+ " padding-left:12px;\n"
|
||||
@ -132,6 +135,9 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ "}",
|
||||
// Test the formatting styles for proper content display in use and constant values pages.
|
||||
".overviewSummary td.colFirst, .overviewSummary th.colFirst,\n"
|
||||
+ ".requiresSummary td.colFirst, .requiresSummary th.colFirst,\n"
|
||||
+ ".packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th,\n"
|
||||
+ ".usesSummary td.colFirst, .usesSummary th.colFirst,\n"
|
||||
+ ".useSummary td.colFirst, .useSummary th.colFirst,\n"
|
||||
+ ".overviewSummary td.colOne, .overviewSummary th.colOne,\n"
|
||||
+ ".memberSummary td.colFirst, .memberSummary th.colFirst,\n"
|
||||
@ -141,7 +147,8 @@ public class TestStylesheet extends JavadocTester {
|
||||
+ " vertical-align:top;\n"
|
||||
+ "}",
|
||||
".overviewSummary td, .memberSummary td, .typeSummary td,\n"
|
||||
+ ".useSummary td, .constantsSummary td, .deprecatedSummary td {\n"
|
||||
+ ".useSummary td, .constantsSummary td, .deprecatedSummary td,\n"
|
||||
+ ".requiresSummary td, .packagesSummary td, .providesSummary td, .usesSummary td {\n"
|
||||
+ " text-align:left;\n"
|
||||
+ " padding:0px 0px 12px 10px;\n"
|
||||
+ "}",
|
||||
|
||||
@ -71,7 +71,7 @@ public class RemovedJDKInternals {
|
||||
assertTrue(CompilerUtils.compile(codecSrc, codecDest));
|
||||
|
||||
// patch jdk.unsupported and set -cp to codec types
|
||||
assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src"),
|
||||
assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "p"),
|
||||
CLASSES_DIR,
|
||||
"-Xpatch:jdk.unsupported=" + patchDir,
|
||||
"-cp", codecDest.toString()));
|
||||
|
||||
@ -59,14 +59,17 @@ public class ShowReplacement {
|
||||
public void compileAll() throws Exception {
|
||||
CompilerUtils.cleanDir(CLASSES_DIR);
|
||||
|
||||
assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "p"),
|
||||
Path tmp = Paths.get("tmp");
|
||||
assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "apple"), tmp));
|
||||
assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "q"),
|
||||
CLASSES_DIR,
|
||||
"-cp", tmp.toString(),
|
||||
"-XaddExports:java.base/sun.security.util=ALL-UNNAMED"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void withReplacement() {
|
||||
Path file = Paths.get("p", "WithRepl.class");
|
||||
Path file = Paths.get("q", "WithRepl.class");
|
||||
String[] output = JdepsUtil.jdeps("-jdkinternals", CLASSES_DIR.resolve(file).toString());
|
||||
int i = 0;
|
||||
while (!output[i].contains("Suggested Replacement")) {
|
||||
@ -90,9 +93,29 @@ public class ShowReplacement {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A JDK internal class has been removed while its package still exists.
|
||||
*/
|
||||
@Test
|
||||
public void noReplacement() {
|
||||
Path file = Paths.get("p", "NoRepl.class");
|
||||
Path file = Paths.get("q", "NoRepl.class");
|
||||
String[] output = JdepsUtil.jdeps("-jdkinternals", CLASSES_DIR.resolve(file).toString());
|
||||
int i = 0;
|
||||
// expect no replacement
|
||||
while (i < output.length && !output[i].contains("Suggested Replacement")) {
|
||||
i++;
|
||||
}
|
||||
|
||||
// no replacement
|
||||
assertEquals(output.length-i, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* A JDK internal package has been removed.
|
||||
*/
|
||||
@Test
|
||||
public void removedPackage() {
|
||||
Path file = Paths.get("q", "RemovedPackage.class");
|
||||
String[] output = JdepsUtil.jdeps("-jdkinternals", CLASSES_DIR.resolve(file).toString());
|
||||
int i = 0;
|
||||
// expect no replacement
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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 apple.applescript;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
|
||||
public interface AppleScriptEngine extends ScriptEngine {
|
||||
}
|
||||
@ -21,7 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package p;
|
||||
package q;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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 q;
|
||||
|
||||
import apple.applescript.AppleScriptEngine;
|
||||
|
||||
public class RemovedPackage {
|
||||
AppleScriptEngine scriptEngine;
|
||||
}
|
||||
@ -21,7 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package p;
|
||||
package q;
|
||||
|
||||
import sun.security.util.HostnameChecker;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user