8258002: Update "type" terminology in generated docs

Reviewed-by: hannesw
This commit is contained in:
Jonathan Gibbons 2020-12-18 18:34:25 +00:00
parent 45bd3b9ec0
commit c04c7e1f10
45 changed files with 511 additions and 240 deletions

View file

@ -27,13 +27,9 @@ package jdk.javadoc.internal.doclets.formats.html;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.lang.model.element.Element; import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement; import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeMirror;
@ -46,7 +42,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.TagName; import jdk.javadoc.internal.doclets.formats.html.markup.TagName;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Links; import jdk.javadoc.internal.doclets.formats.html.markup.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.formats.html.markup.Table; import jdk.javadoc.internal.doclets.formats.html.markup.Table;
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader; import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.Content;
@ -54,15 +49,8 @@ import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
import jdk.javadoc.internal.doclets.toolkit.MemberWriter; import jdk.javadoc.internal.doclets.toolkit.MemberWriter;
import jdk.javadoc.internal.doclets.toolkit.Resources; import jdk.javadoc.internal.doclets.toolkit.Resources;
import jdk.javadoc.internal.doclets.toolkit.taglets.DeprecatedTaglet; import jdk.javadoc.internal.doclets.toolkit.taglets.DeprecatedTaglet;
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
import jdk.javadoc.internal.doclets.toolkit.util.Utils; import jdk.javadoc.internal.doclets.toolkit.util.Utils;
import static javax.lang.model.element.Modifier.ABSTRACT;
import static javax.lang.model.element.Modifier.NATIVE;
import static javax.lang.model.element.Modifier.PUBLIC;
import static javax.lang.model.element.Modifier.STRICTFP;
import static javax.lang.model.element.Modifier.SYNCHRONIZED;
/** /**
* The base class for member writers. * The base class for member writers.
* *
@ -89,7 +77,7 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter, Membe
this.writer = writer; this.writer = writer;
this.typeElement = typeElement; this.typeElement = typeElement;
this.utils = configuration.utils; this.utils = configuration.utils;
this.contents = configuration.contents; this.contents = configuration.getContents();
this.resources = configuration.docResources; this.resources = configuration.docResources;
this.links = writer.links; this.links = writer.links;
} }

View file

@ -116,12 +116,12 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
.setId("all-classes-table") .setId("all-classes-table")
.setDefaultTab(resources.getText("doclet.All_Classes")) .setDefaultTab(resources.getText("doclet.All_Classes"))
.addTab(resources.interfaceSummary, utils::isInterface) .addTab(contents.interfaceSummary, utils::isInterface)
.addTab(resources.classSummary, e -> utils.isOrdinaryClass((TypeElement)e)) .addTab(contents.classSummary, e -> utils.isOrdinaryClass((TypeElement)e))
.addTab(resources.enumSummary, utils::isEnum) .addTab(contents.enumSummary, utils::isEnum)
.addTab(resources.exceptionSummary, e -> utils.isException((TypeElement)e)) .addTab(contents.exceptionSummary, e -> utils.isException((TypeElement)e))
.addTab(resources.errorSummary, e -> utils.isError((TypeElement)e)) .addTab(contents.errorSummary, e -> utils.isError((TypeElement)e))
.addTab(resources.annotationTypeSummary, utils::isAnnotationType); .addTab(contents.annotationTypeSummary, utils::isAnnotationType);
for (Character unicode : indexBuilder.getFirstCharacters()) { for (Character unicode : indexBuilder.getFirstCharacters()) {
for (IndexItem indexItem : indexBuilder.getItems(unicode)) { for (IndexItem indexItem : indexBuilder.getItems(unicode)) {
TypeElement typeElement = (TypeElement) indexItem.getElement(); TypeElement typeElement = (TypeElement) indexItem.getElement();

View file

@ -96,7 +96,7 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
*/ */
protected void addPackages(Content content) { protected void addPackages(Content content) {
Table table = new Table(HtmlStyle.summaryTable) Table table = new Table(HtmlStyle.summaryTable)
.setCaption(new StringContent(resources.packageSummary)) .setCaption(new StringContent(contents.packageSummary))
.setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel)) .setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel))
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
for (PackageElement pkg : configuration.packages) { for (PackageElement pkg : configuration.packages) {

View file

@ -66,8 +66,9 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.add( memberSummaryTree.add(selectComment(
MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY); MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY,
MarkerComments.START_OF_ANNOTATION_INTERFACE_OPTIONAL_MEMBER_SUMMARY));
Content memberTree = new ContentBuilder(); Content memberTree = new ContentBuilder();
writer.addSummaryHeader(this, memberTree); writer.addSummaryHeader(this, memberTree);
return memberTree; return memberTree;

View file

@ -25,11 +25,13 @@
package jdk.javadoc.internal.doclets.formats.html; package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element; import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeMirror;
import jdk.javadoc.internal.doclets.formats.html.markup.Comment;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -66,8 +68,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
@Override @Override
public Content getMemberSummaryHeader(TypeElement typeElement, public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) { Content memberSummaryTree) {
memberSummaryTree.add( memberSummaryTree.add(selectComment(
MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY); MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY,
MarkerComments.START_OF_ANNOTATION_INTERFACE_REQUIRED_MEMBER_SUMMARY));
Content memberTree = new ContentBuilder(); Content memberTree = new ContentBuilder();
writer.addSummaryHeader(this, memberTree); writer.addSummaryHeader(this, memberTree);
return memberTree; return memberTree;
@ -86,7 +89,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
@Override @Override
public void addAnnotationDetailsMarker(Content memberDetails) { public void addAnnotationDetailsMarker(Content memberDetails) {
memberDetails.add(MarkerComments.START_OF_ANNOTATION_TYPE_DETAILS); memberDetails.add(selectComment(
MarkerComments.START_OF_ANNOTATION_TYPE_DETAILS,
MarkerComments.START_OF_ANNOTATION_INTERFACE_DETAILS));
} }
@Override @Override
@ -201,6 +206,12 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name); return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name);
} }
protected Comment selectComment(Comment c1, Comment c2) {
HtmlConfiguration configuration = writer.configuration;
SourceVersion sv = configuration.docEnv.getSourceVersion();
return sv.compareTo(SourceVersion.RELEASE_16) < 0 ? c1 : c2;
}
private TypeMirror getType(Element member) { private TypeMirror getType(Element member) {
return utils.isExecutableElement(member) return utils.isExecutableElement(member)
? utils.getReturnType(typeElement, (ExecutableElement) member) ? utils.getReturnType(typeElement, (ExecutableElement) member)

View file

@ -412,9 +412,13 @@ public class ClassUseWriter extends SubWriterHolderWriter {
* @return a content tree representing the class use header * @return a content tree representing the class use header
*/ */
protected HtmlTree getClassUseHeader() { protected HtmlTree getClassUseHeader() {
String cltype = resources.getText(utils.isInterface(typeElement) String cltype = resources.getText(switch (typeElement.getKind()) {
? "doclet.Interface" case ANNOTATION_TYPE -> "doclet.AnnotationType";
: "doclet.Class"); case INTERFACE -> "doclet.Interface";
case RECORD -> "doclet.RecordClass";
case ENUM -> "doclet.Enum";
default -> "doclet.Class";
});
String clname = utils.getFullyQualifiedName(typeElement); String clname = utils.getFullyQualifiedName(typeElement);
String title = resources.getText("doclet.Window_ClassUse_Header", String title = resources.getText("doclet.Window_ClassUse_Header",
cltype, clname); cltype, clname);

View file

@ -177,6 +177,15 @@ public class Contents {
private final EnumMap<VisibleMemberTable.Kind, Content> navLinkLabels; private final EnumMap<VisibleMemberTable.Kind, Content> navLinkLabels;
public final String annotationTypeSummary;
public final String classSummary;
public final String enumSummary;
public final String errorSummary;
public final String exceptionSummary;
public final String interfaceSummary;
public final String packageSummary;
public final String recordSummary;
private final Resources resources; private final Resources resources;
/** /**
@ -289,7 +298,7 @@ public class Contents {
propertyLabel = getContent("doclet.Property"); propertyLabel = getContent("doclet.Property");
propertyDetailsLabel = getContent("doclet.Property_Detail"); propertyDetailsLabel = getContent("doclet.Property_Detail");
propertySummaryLabel = getContent("doclet.Property_Summary"); propertySummaryLabel = getContent("doclet.Property_Summary");
record = getContent("doclet.Record"); record = getContent("doclet.RecordClass");
recordComponents = getContent("doclet.RecordComponents"); recordComponents = getContent("doclet.RecordComponents");
referencedIn = getContent("doclet.ReferencedIn"); referencedIn = getContent("doclet.ReferencedIn");
returns = getContent("doclet.Returns"); returns = getContent("doclet.Returns");
@ -315,6 +324,15 @@ public class Contents {
navLinkLabels.put(VisibleMemberTable.Kind.FIELDS, getContent("doclet.navField")); navLinkLabels.put(VisibleMemberTable.Kind.FIELDS, getContent("doclet.navField"));
navLinkLabels.put(VisibleMemberTable.Kind.CONSTRUCTORS, getContent("doclet.navConstructor")); navLinkLabels.put(VisibleMemberTable.Kind.CONSTRUCTORS, getContent("doclet.navConstructor"));
navLinkLabels.put(VisibleMemberTable.Kind.METHODS, getContent("doclet.navMethod")); navLinkLabels.put(VisibleMemberTable.Kind.METHODS, getContent("doclet.navMethod"));
this.annotationTypeSummary = resources.getText("doclet.Annotation_Types_Summary");
this.classSummary = resources.getText("doclet.Class_Summary");
this.enumSummary = resources.getText("doclet.Enum_Summary");
this.errorSummary = resources.getText("doclet.Error_Summary");
this.exceptionSummary = resources.getText("doclet.Exception_Summary");
this.interfaceSummary = resources.getText("doclet.Interface_Summary");
this.packageSummary = resources.getText("doclet.Package_Summary");
this.recordSummary = resources.getText("doclet.Record_Class_Summary");
} }
/** /**

View file

@ -78,13 +78,13 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
case CLASS: case CLASS:
return "class"; return "class";
case ENUM: case ENUM:
return "enum"; return "enum.class";
case EXCEPTION: case EXCEPTION:
return "exception"; return "exception";
case ERROR: case ERROR:
return "error"; return "error";
case ANNOTATION_TYPE: case ANNOTATION_TYPE:
return "annotation.type"; return "annotation.interface";
case FIELD: case FIELD:
return "field"; return "field";
case METHOD: case METHOD:
@ -94,7 +94,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
case ENUM_CONSTANT: case ENUM_CONSTANT:
return "enum.constant"; return "enum.constant";
case ANNOTATION_TYPE_MEMBER: case ANNOTATION_TYPE_MEMBER:
return "annotation.type.member"; return "annotation.interface.member";
case RECORD_CLASS: case RECORD_CLASS:
return "record.class"; return "record.class";
default: default:
@ -197,7 +197,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
case ANNOTATION_TYPE: case ANNOTATION_TYPE:
return "doclet.AnnotationType"; return "doclet.AnnotationType";
case RECORD_CLASS: case RECORD_CLASS:
return "doclet.Record"; return "doclet.RecordClass";
case FIELD: case FIELD:
return "doclet.Field"; return "doclet.Field";
case METHOD: case METHOD:
@ -287,17 +287,13 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
throws DocFileIOException { throws DocFileIOException {
HtmlTree body = getHeader(); HtmlTree body = getHeader();
bodyContents.addMainContent(getContentsList(deprAPI)); bodyContents.addMainContent(getContentsList(deprAPI));
String memberTableSummary;
Content content = new ContentBuilder(); Content content = new ContentBuilder();
for (DeprElementKind kind : DeprElementKind.values()) { for (DeprElementKind kind : DeprElementKind.values()) {
if (deprAPI.hasDocumentation(kind)) { if (deprAPI.hasDocumentation(kind)) {
memberTableSummary = resources.getText("doclet.Member_Table_Summary",
resources.getText(getHeadingKey(kind)),
resources.getText(getSummaryKey(kind)));
TableHeader memberTableHeader = new TableHeader( TableHeader memberTableHeader = new TableHeader(
contents.getContent(getHeaderKey(kind)), contents.descriptionLabel); contents.getContent(getHeaderKey(kind)), contents.descriptionLabel);
addDeprecatedAPI(deprAPI.getSet(kind), getAnchorName(kind), addDeprecatedAPI(deprAPI.getSet(kind), getAnchorName(kind),
getHeadingKey(kind), memberTableSummary, memberTableHeader, content); getHeadingKey(kind), memberTableHeader, content);
} }
} }
bodyContents.addMainContent(content); bodyContents.addMainContent(content);
@ -368,12 +364,11 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
* @param deprList list of deprecated API elements * @param deprList list of deprecated API elements
* @param id the id attribute of the table * @param id the id attribute of the table
* @param headingKey the caption for the deprecated table * @param headingKey the caption for the deprecated table
* @param tableSummary the summary for the deprecated table
* @param tableHeader table headers for the deprecated table * @param tableHeader table headers for the deprecated table
* @param contentTree the content tree to which the deprecated table will be added * @param contentTree the content tree to which the deprecated table will be added
*/ */
protected void addDeprecatedAPI(SortedSet<Element> deprList, String id, String headingKey, protected void addDeprecatedAPI(SortedSet<Element> deprList, String id, String headingKey,
String tableSummary, TableHeader tableHeader, Content contentTree) { TableHeader tableHeader, Content contentTree) {
if (deprList.size() > 0) { if (deprList.size() > 0) {
Content caption = contents.getContent(headingKey); Content caption = contents.getContent(headingKey);
Table table = new Table(HtmlStyle.summaryTable) Table table = new Table(HtmlStyle.summaryTable)

View file

@ -32,7 +32,9 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.lang.model.element.Element; import javax.lang.model.element.Element;
import javax.lang.model.element.PackageElement; import javax.lang.model.element.PackageElement;
@ -118,7 +120,7 @@ public class HtmlConfiguration extends BaseConfiguration {
*/ */
protected DeprecatedAPIListBuilder deprecatedAPIListBuilder; protected DeprecatedAPIListBuilder deprecatedAPIListBuilder;
public final Contents contents; private Contents contents;
protected final Messages messages; protected final Messages messages;
@ -181,7 +183,6 @@ public class HtmlConfiguration extends BaseConfiguration {
} }
messages = new Messages(this, msgResources); messages = new Messages(this, msgResources);
contents = new Contents(this);
options = new HtmlOptions(this); options = new HtmlOptions(this);
Runtime.Version v; Runtime.Version v;
@ -195,6 +196,11 @@ public class HtmlConfiguration extends BaseConfiguration {
conditionalPages = EnumSet.noneOf(ConditionalPage.class); conditionalPages = EnumSet.noneOf(ConditionalPage.class);
} }
protected void initConfiguration(DocletEnvironment docEnv,
Function<String, String> resourceKeyMapper) {
super.initConfiguration(docEnv, resourceKeyMapper);
contents = new Contents(this);
}
private final Runtime.Version docletVersion; private final Runtime.Version docletVersion;
public final Date startTime = new Date(); public final Date startTime = new Date();
@ -215,7 +221,7 @@ public class HtmlConfiguration extends BaseConfiguration {
* @return a utility object providing commonly used fragments of content * @return a utility object providing commonly used fragments of content
*/ */
public Contents getContents() { public Contents getContents() {
return contents; return Objects.requireNonNull(contents);
} }
@Override @Override

View file

@ -26,12 +26,15 @@
package jdk.javadoc.internal.doclets.formats.html; package jdk.javadoc.internal.doclets.formats.html;
import java.util.*; import java.util.*;
import java.util.function.Function;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.ModuleElement; import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement; import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import jdk.javadoc.doclet.Doclet; import jdk.javadoc.doclet.Doclet;
import jdk.javadoc.doclet.DocletEnvironment;
import jdk.javadoc.doclet.Reporter; import jdk.javadoc.doclet.Reporter;
import jdk.javadoc.internal.doclets.toolkit.AbstractDoclet; import jdk.javadoc.internal.doclets.toolkit.AbstractDoclet;
import jdk.javadoc.internal.doclets.toolkit.DocletException; import jdk.javadoc.internal.doclets.toolkit.DocletException;
@ -115,6 +118,52 @@ public class HtmlDoclet extends AbstractDoclet {
return configuration; return configuration;
} }
@Override
protected Function<String, String> getResourceKeyMapper(DocletEnvironment docEnv) {
SourceVersion sv = docEnv.getSourceVersion();
Map<String, String> map = new HashMap<>();
String[][] pairs = {
// in standard.properties
{ "doclet.Enum_Hierarchy", "doclet.Enum_Class_Hierarchy" },
{ "doclet.Annotation_Type_Hierarchy", "doclet.Annotation_Interface_Hierarchy" },
{ "doclet.Href_Enum_Title", "doclet.Href_Enum_Class_Title" },
{ "doclet.Annotation_Types", "doclet.Annotation_Interfaces" },
{ "doclet.Annotation_Type_Members", "doclet.Annotation_Interface_Members" },
{ "doclet.annotation_types", "doclet.annotation_interfaces" },
{ "doclet.annotation_type_members", "doclet.annotation_interface_members" },
{ "doclet.help.enum.intro", "doclet.help.enum.class.intro" },
{ "doclet.help.annotation_type.intro", "doclet.help.annotation_interface.intro" },
{ "doclet.help.annotation_type.declaration", "doclet.help.annotation_interface.declaration" },
{ "doclet.help.annotation_type.description", "doclet.help.annotation_interface.description" },
// in doclets.properties
{ "doclet.Annotation_Types_Summary", "doclet.Annotation_Interfaces_Summary" },
{ "doclet.Enum_Summary", "doclet.Enum_Class_Summary" },
{ "doclet.Enums", "doclet.EnumClasses" },
{ "doclet.AnnotationType", "doclet.AnnotationInterface" },
{ "doclet.AnnotationTypes", "doclet.AnnotationInterfaces" },
{ "doclet.annotationtype", "doclet.annotationinterface" },
{ "doclet.annotationtypes", "doclet.annotationinterfaces" },
{ "doclet.Enum", "doclet.EnumClass" },
{ "doclet.enum", "doclet.enumclass" },
{ "doclet.enums", "doclet.enumclasses" },
{ "doclet.Annotation_Type_Member", "doclet.Annotation_Interface_Member" },
{ "doclet.enum_values_doc.fullbody", "doclet.enum_class_values_doc.fullbody" },
{ "doclet.enum_values_doc.return", "doclet.enum_class_values_doc.return" },
{ "doclet.enum_valueof_doc.fullbody", "doclet.enum_class_valueof_doc.fullbody" },
{ "doclet.enum_valueof_doc.throws_ila", "doclet.enum_class_valueof_doc.throws_ila" },
{ "doclet.search.types", "doclet.search.classes_and_interfaces"}
};
for (String[] pair : pairs) {
if (sv.compareTo(SourceVersion.RELEASE_16) >= 0) {
map.put(pair[0], pair[1]);
} else {
map.put(pair[1], pair[0]);
}
}
return (k) -> map.getOrDefault(k, k);
}
@Override // defined by AbstractDoclet @Override // defined by AbstractDoclet
public void generateClassFiles(ClassTree classTree) throws DocletException { public void generateClassFiles(ClassTree classTree) throws DocletException {

View file

@ -216,7 +216,7 @@ public class HtmlDocletWriter {
public HtmlDocletWriter(HtmlConfiguration configuration, DocPath path) { public HtmlDocletWriter(HtmlConfiguration configuration, DocPath path) {
this.configuration = configuration; this.configuration = configuration;
this.options = configuration.getOptions(); this.options = configuration.getOptions();
this.contents = configuration.contents; this.contents = configuration.getContents();
this.messages = configuration.messages; this.messages = configuration.messages;
this.resources = configuration.docResources; this.resources = configuration.docResources;
this.links = new Links(path, configuration.utils); this.links = new Links(path, configuration.utils);

View file

@ -97,12 +97,24 @@ public class MarkerComments {
public static final Comment START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY = public static final Comment START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY ==========="); new Comment("=========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY ===========");
/**
* Marker to identify start of annotation interface optional member summary.
*/
public static final Comment START_OF_ANNOTATION_INTERFACE_OPTIONAL_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION INTERFACE OPTIONAL MEMBER SUMMARY ===========");
/** /**
* Marker to identify start of annotation type required member summary. * Marker to identify start of annotation type required member summary.
*/ */
public static final Comment START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY = public static final Comment START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ==========="); new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ===========");
/**
* Marker to identify start of annotation interface required member summary.
*/
public static final Comment START_OF_ANNOTATION_INTERFACE_REQUIRED_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION INTERFACE REQUIRED MEMBER SUMMARY ===========");
/** /**
* Marker to identify start of constructor summary. * Marker to identify start of constructor summary.
*/ */
@ -140,10 +152,10 @@ public class MarkerComments {
new Comment("============ ANNOTATION TYPE MEMBER DETAIL ==========="); new Comment("============ ANNOTATION TYPE MEMBER DETAIL ===========");
/** /**
* Marker to identify start of annotation type field details. * Marker to identify start of annotation interface details.
*/ */
public static final Comment START_OF_ANNOTATION_TYPE_FIELD_DETAILS = public static final Comment START_OF_ANNOTATION_INTERFACE_DETAILS =
new Comment("============ ANNOTATION TYPE FIELD DETAIL ==========="); new Comment("============ ANNOTATION INTERFACE MEMBER DETAIL ===========");
/** /**
* Marker to identify start of method details. * Marker to identify start of method details.

View file

@ -481,9 +481,6 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
addSummaryHeader(MarkerComments.START_OF_MODULES_SUMMARY, contents.navModules, section); addSummaryHeader(MarkerComments.START_OF_MODULES_SUMMARY, contents.navModules, section);
if (display(requires)) { if (display(requires)) {
String text = resources.getText("doclet.Requires_Summary"); String text = resources.getText("doclet.Requires_Summary");
String tableSummary = resources.getText("doclet.Member_Table_Summary",
text,
resources.getText("doclet.modules"));
Content caption = new StringContent(text); Content caption = new StringContent(text);
Table table = getTable3(caption, requiresTableHeader); Table table = getTable3(caption, requiresTableHeader);
addModulesList(requires, table); addModulesList(requires, table);
@ -492,9 +489,6 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
// Display indirect modules table in both "api" and "all" mode. // Display indirect modules table in both "api" and "all" mode.
if (display(indirectModules)) { if (display(indirectModules)) {
String amrText = resources.getText("doclet.Indirect_Requires_Summary"); String amrText = resources.getText("doclet.Indirect_Requires_Summary");
String amrTableSummary = resources.getText("doclet.Member_Table_Summary",
amrText,
resources.getText("doclet.modules"));
Content amrCaption = new StringContent(amrText); Content amrCaption = new StringContent(amrText);
Table amrTable = getTable3(amrCaption, requiresTableHeader); Table amrTable = getTable3(amrCaption, requiresTableHeader);
addModulesList(indirectModules, amrTable); addModulesList(indirectModules, amrTable);

View file

@ -116,7 +116,7 @@ public class Navigation {
this.configuration = configuration; this.configuration = configuration;
this.options = configuration.getOptions(); this.options = configuration.getOptions();
this.element = element; this.element = element;
this.contents = configuration.contents; this.contents = configuration.getContents();
this.documentedPage = page; this.documentedPage = page;
this.path = path; this.path = path;
this.pathToRoot = path.parent().invert(); this.pathToRoot = path.parent().invert();

View file

@ -61,7 +61,6 @@ public class PackageUseWriter extends SubWriterHolderWriter {
final PackageElement packageElement; final PackageElement packageElement;
final SortedMap<String, Set<TypeElement>> usingPackageToUsedClasses = new TreeMap<>(); final SortedMap<String, Set<TypeElement>> usingPackageToUsedClasses = new TreeMap<>();
final String packageUseTableSummary;
/** /**
* Constructor. * Constructor.
@ -96,9 +95,6 @@ public class PackageUseWriter extends SubWriterHolderWriter {
} }
} }
} }
packageUseTableSummary = resources.getText("doclet.Use_Table_Summary",
resources.getText("doclet.packages"));
} }
/** /**
@ -193,8 +189,6 @@ public class PackageUseWriter extends SubWriterHolderWriter {
PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName); PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName);
HtmlTree section = HtmlTree.SECTION(HtmlStyle.detail) HtmlTree section = HtmlTree.SECTION(HtmlStyle.detail)
.setId(getPackageAnchorName(usingPackage)); .setId(getPackageAnchorName(usingPackage));
String tableSummary = resources.getText("doclet.Use_Table_Summary",
resources.getText("doclet.classes"));
Content caption = contents.getContent( Content caption = contents.getContent(
"doclet.ClassUse_Classes.in.0.used.by.1", "doclet.ClassUse_Classes.in.0.used.by.1",
getPackageLink(packageElement, utils.getPackageName(packageElement)), getPackageLink(packageElement, utils.getPackageName(packageElement)),

View file

@ -164,43 +164,43 @@ public class PackageWriterImpl extends HtmlDocletWriter
@Override @Override
public void addInterfaceSummary(SortedSet<TypeElement> interfaces, Content summaryContentTree) { public void addInterfaceSummary(SortedSet<TypeElement> interfaces, Content summaryContentTree) {
TableHeader tableHeader= new TableHeader(contents.interfaceLabel, contents.descriptionLabel); TableHeader tableHeader= new TableHeader(contents.interfaceLabel, contents.descriptionLabel);
addClassesSummary(interfaces, resources.interfaceSummary, tableHeader, summaryContentTree); addClassesSummary(interfaces, contents.interfaceSummary, tableHeader, summaryContentTree);
} }
@Override @Override
public void addClassSummary(SortedSet<TypeElement> classes, Content summaryContentTree) { public void addClassSummary(SortedSet<TypeElement> classes, Content summaryContentTree) {
TableHeader tableHeader= new TableHeader(contents.classLabel, contents.descriptionLabel); TableHeader tableHeader= new TableHeader(contents.classLabel, contents.descriptionLabel);
addClassesSummary(classes, resources.classSummary, tableHeader, summaryContentTree); addClassesSummary(classes, contents.classSummary, tableHeader, summaryContentTree);
} }
@Override @Override
public void addEnumSummary(SortedSet<TypeElement> enums, Content summaryContentTree) { public void addEnumSummary(SortedSet<TypeElement> enums, Content summaryContentTree) {
TableHeader tableHeader= new TableHeader(contents.enum_, contents.descriptionLabel); TableHeader tableHeader= new TableHeader(contents.enum_, contents.descriptionLabel);
addClassesSummary(enums, resources.enumSummary, tableHeader, summaryContentTree); addClassesSummary(enums, contents.enumSummary, tableHeader, summaryContentTree);
} }
@Override @Override
public void addRecordSummary(SortedSet<TypeElement> records, Content summaryContentTree) { public void addRecordSummary(SortedSet<TypeElement> records, Content summaryContentTree) {
TableHeader tableHeader= new TableHeader(contents.record, contents.descriptionLabel); TableHeader tableHeader= new TableHeader(contents.record, contents.descriptionLabel);
addClassesSummary(records, resources.recordSummary, tableHeader, summaryContentTree); addClassesSummary(records, contents.recordSummary, tableHeader, summaryContentTree);
} }
@Override @Override
public void addExceptionSummary(SortedSet<TypeElement> exceptions, Content summaryContentTree) { public void addExceptionSummary(SortedSet<TypeElement> exceptions, Content summaryContentTree) {
TableHeader tableHeader= new TableHeader(contents.exception, contents.descriptionLabel); TableHeader tableHeader= new TableHeader(contents.exception, contents.descriptionLabel);
addClassesSummary(exceptions, resources.exceptionSummary, tableHeader, summaryContentTree); addClassesSummary(exceptions, contents.exceptionSummary, tableHeader, summaryContentTree);
} }
@Override @Override
public void addErrorSummary(SortedSet<TypeElement> errors, Content summaryContentTree) { public void addErrorSummary(SortedSet<TypeElement> errors, Content summaryContentTree) {
TableHeader tableHeader= new TableHeader(contents.error, contents.descriptionLabel); TableHeader tableHeader= new TableHeader(contents.error, contents.descriptionLabel);
addClassesSummary(errors, resources.errorSummary, tableHeader, summaryContentTree); addClassesSummary(errors, contents.errorSummary, tableHeader, summaryContentTree);
} }
@Override @Override
public void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes, Content summaryContentTree) { public void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes, Content summaryContentTree) {
TableHeader tableHeader= new TableHeader(contents.annotationType, contents.descriptionLabel); TableHeader tableHeader= new TableHeader(contents.annotationType, contents.descriptionLabel);
addClassesSummary(annoTypes, resources.annotationTypeSummary, tableHeader, summaryContentTree); addClassesSummary(annoTypes, contents.annotationTypeSummary, tableHeader, summaryContentTree);
} }
public void addClassesSummary(SortedSet<TypeElement> classes, String label, public void addClassesSummary(SortedSet<TypeElement> classes, String label,

View file

@ -35,9 +35,9 @@ package jdk.javadoc.internal.doclets.formats.html;
*/ */
public enum SectionName { public enum SectionName {
ANNOTATION_TYPE_ELEMENT_DETAIL("annotation.type.element.detail"), ANNOTATION_TYPE_ELEMENT_DETAIL("annotation.interface.element.detail"),
ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY("annotation.type.optional.element.summary"), ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY("annotation.interface.optional.element.summary"),
ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY("annotation.type.required.element.summary"), ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY("annotation.interface.required.element.summary"),
CONSTRUCTOR_DETAIL("constructor.detail"), CONSTRUCTOR_DETAIL("constructor.detail"),
CONSTRUCTOR_SUMMARY("constructor.summary"), CONSTRUCTOR_SUMMARY("constructor.summary"),
ENUM_CONSTANT_DETAIL("enum.constant.detail"), ENUM_CONSTANT_DETAIL("enum.constant.detail"),

View file

@ -39,11 +39,14 @@ doclet.Class_Hierarchy=Class Hierarchy
doclet.Window_Class_Hierarchy=Class Hierarchy doclet.Window_Class_Hierarchy=Class Hierarchy
doclet.Interface_Hierarchy=Interface Hierarchy doclet.Interface_Hierarchy=Interface Hierarchy
doclet.Enum_Hierarchy=Enum Hierarchy doclet.Enum_Hierarchy=Enum Hierarchy
doclet.Enum_Class_Hierarchy=Enum Class Hierarchy
doclet.Annotation_Type_Hierarchy=Annotation Type Hierarchy doclet.Annotation_Type_Hierarchy=Annotation Type Hierarchy
doclet.Annotation_Interface_Hierarchy=Annotation Interface Hierarchy
doclet.Href_Class_Title=class in {0} doclet.Href_Class_Title=class in {0}
doclet.Href_Interface_Title=interface in {0} doclet.Href_Interface_Title=interface in {0}
doclet.Href_Annotation_Title=annotation in {0} doclet.Href_Annotation_Title=annotation in {0}
doclet.Href_Enum_Title=enum in {0} doclet.Href_Enum_Title=enum in {0}
doclet.Href_Enum_Class_Title=enum class in {0}
doclet.Href_Type_Param_Title=type parameter in {0} doclet.Href_Type_Param_Title=type parameter in {0}
doclet.Href_Class_Or_Interface_Title=class or interface in {0} doclet.Href_Class_Or_Interface_Title=class or interface in {0}
doclet.Summary=Summary: doclet.Summary=Summary:
@ -95,10 +98,14 @@ doclet.tag.invalid_usage=invalid usage of tag {0}
doclet.Deprecated_API=Deprecated API doclet.Deprecated_API=Deprecated API
doclet.For_Removal=For Removal doclet.For_Removal=For Removal
doclet.Annotation_Types=Annotation Types doclet.Annotation_Types=Annotation Types
doclet.Annotation_Interfaces=Annotation Interfaces
doclet.Annotation_Type_Members=Annotation Type Elements doclet.Annotation_Type_Members=Annotation Type Elements
doclet.Annotation_Interface_Members=Annotation Interface Elements
doclet.for_removal=for removal doclet.for_removal=for removal
doclet.annotation_types=annotation types doclet.annotation_types=annotation types
doclet.annotation_interfaces=annotation interfaces
doclet.annotation_type_members=annotation type elements doclet.annotation_type_members=annotation type elements
doclet.annotation_interface_members=annotation interface elements
doclet.record_classes=record classes doclet.record_classes=record classes
doclet.Generated_Docs_Untitled=Generated Documentation (Untitled) doclet.Generated_Docs_Untitled=Generated Documentation (Untitled)
doclet.Other_Packages=Other Packages doclet.Other_Packages=Other Packages
@ -212,16 +219,24 @@ doclet.help.footnote=\
This help file applies to API documentation generated by the standard doclet. This help file applies to API documentation generated by the standard doclet.
doclet.help.enum.intro=\ doclet.help.enum.intro=\
Each enum has its own separate page with the following sections: Each enum has its own separate page with the following sections:
doclet.help.enum.class.intro=\
Each enum class has its own separate page with the following sections:
doclet.help.enum.declaration=\ doclet.help.enum.declaration=\
Enum Declaration Enum Declaration
doclet.help.enum.definition=\ doclet.help.enum.definition=\
Enum Description Enum Description
doclet.help.annotation_type.intro=\ doclet.help.annotation_type.intro=\
Each annotation type has its own separate page with the following sections: Each annotation type has its own separate page with the following sections:
doclet.help.annotation_interface.intro=\
Each annotation interface has its own separate page with the following sections:
doclet.help.annotation_type.declaration=\ doclet.help.annotation_type.declaration=\
Annotation Type Declaration Annotation Type Declaration
doclet.help.annotation_interface.declaration=\
Annotation Interface Declaration
doclet.help.annotation_type.description=\ doclet.help.annotation_type.description=\
Annotation Type Description Annotation Type Description
doclet.help.annotation_interface.description=\
Annotation Interface Description
doclet.help.search.head=Search doclet.help.search.head=Search
# Introduction to Javadoc search features, followed by a list of examples # Introduction to Javadoc search features, followed by a list of examples
doclet.help.search.intro=You can search for definitions of modules, packages, types, fields, methods, \ doclet.help.search.intro=You can search for definitions of modules, packages, types, fields, methods, \

View file

@ -25,8 +25,10 @@
package jdk.javadoc.internal.doclets.toolkit; package jdk.javadoc.internal.doclets.toolkit;
import java.util.Map;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeSet; import java.util.TreeSet;
import java.util.function.Function;
import javax.lang.model.SourceVersion; import javax.lang.model.SourceVersion;
import javax.lang.model.element.PackageElement; import javax.lang.model.element.PackageElement;
@ -99,7 +101,7 @@ public abstract class AbstractDoclet implements Doclet {
@Override @Override
public boolean run(DocletEnvironment docEnv) { public boolean run(DocletEnvironment docEnv) {
configuration = getConfiguration(); configuration = getConfiguration();
configuration.initConfiguration(docEnv); configuration.initConfiguration(docEnv, getResourceKeyMapper(docEnv));
utils = configuration.utils; utils = configuration.utils;
messages = configuration.getMessages(); messages = configuration.getMessages();
BaseOptions options = configuration.getOptions(); BaseOptions options = configuration.getOptions();
@ -149,6 +151,10 @@ public abstract class AbstractDoclet implements Doclet {
return false; return false;
} }
protected Function<String, String> getResourceKeyMapper(DocletEnvironment docEnv) {
return null;
}
private void reportInternalError(Throwable t) { private void reportInternalError(Throwable t) {
if (getClass().equals(StandardDoclet.class) || getClass().equals(HtmlDoclet.class)) { if (getClass().equals(StandardDoclet.class) || getClass().equals(HtmlDoclet.class)) {
System.err.println(configuration.getDocResources().getText("doclet.internal.report.bug")); System.err.println(configuration.getDocResources().getText("doclet.internal.report.bug"));

View file

@ -41,6 +41,7 @@ import java.util.SortedMap;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.TreeSet; import java.util.TreeSet;
import java.util.function.Function;
import javax.lang.model.SourceVersion; import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element; import javax.lang.model.element.Element;
@ -237,7 +238,8 @@ public abstract class BaseConfiguration {
private boolean initialized = false; private boolean initialized = false;
protected void initConfiguration(DocletEnvironment docEnv) { protected void initConfiguration(DocletEnvironment docEnv,
Function<String, String> resourceKeyMapper) {
if (initialized) { if (initialized) {
throw new IllegalStateException("configuration previously initialized"); throw new IllegalStateException("configuration previously initialized");
} }
@ -251,6 +253,8 @@ public abstract class BaseConfiguration {
options.setJavaFX(isJavaFXMode()); options.setJavaFX(isJavaFXMode());
} }
getDocResources().setKeyMapper(resourceKeyMapper);
// Once docEnv and Utils have been initialized, others should be safe. // Once docEnv and Utils have been initialized, others should be safe.
metakeywords = new MetaKeywords(this); metakeywords = new MetaKeywords(this);
cmtUtils = new CommentUtils(this); cmtUtils = new CommentUtils(this);

View file

@ -29,6 +29,7 @@ import java.text.MessageFormat;
import java.util.Locale; import java.util.Locale;
import java.util.MissingResourceException; import java.util.MissingResourceException;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.function.Function;
/** /**
* Access to the localizable resources used by a doclet. * Access to the localizable resources used by a doclet.
@ -39,17 +40,10 @@ import java.util.ResourceBundle;
* HTML doclet. * HTML doclet.
*/ */
public class Resources { public class Resources {
public final String annotationTypeSummary;
public final String classSummary;
public final String enumSummary;
public final String errorSummary;
public final String exceptionSummary;
public final String interfaceSummary;
public final String packageSummary;
public final String recordSummary;
protected ResourceBundle commonBundle; protected final ResourceBundle commonBundle;
protected ResourceBundle docletBundle; protected final ResourceBundle docletBundle;
protected Function<String, String> mapper;
/** /**
* Creates a {@code Resources} object to provide access the resource * Creates a {@code Resources} object to provide access the resource
@ -65,20 +59,17 @@ public class Resources {
public Resources(Locale locale, String commonBundleName, String docletBundleName) { public Resources(Locale locale, String commonBundleName, String docletBundleName) {
this.commonBundle = ResourceBundle.getBundle(commonBundleName, locale); this.commonBundle = ResourceBundle.getBundle(commonBundleName, locale);
this.docletBundle = ResourceBundle.getBundle(docletBundleName, locale); this.docletBundle = ResourceBundle.getBundle(docletBundleName, locale);
}
this.annotationTypeSummary = getText("doclet.Annotation_Types_Summary"); public void setKeyMapper(Function<String, String> mapper) {
this.classSummary = getText("doclet.Class_Summary"); this.mapper = mapper;
this.enumSummary = getText("doclet.Enum_Summary");
this.errorSummary = getText("doclet.Error_Summary");
this.exceptionSummary = getText("doclet.Exception_Summary");
this.interfaceSummary = getText("doclet.Interface_Summary");
this.packageSummary = getText("doclet.Package_Summary");
this.recordSummary = getText("doclet.Record_Summary");
} }
/** /**
* Returns the string for the given key from one of the doclet's * Returns the string for the given key from one of the doclet's
* resource bundles. * resource bundles. If the current {@code mapper} is not {@code null},
* it will be applied to the {@code key} before looking up the resulting
* key in the resource bundle(s).
* *
* The more specific bundle is checked first; * The more specific bundle is checked first;
* if it is not there, the common bundle is then checked. * if it is not there, the common bundle is then checked.
@ -89,13 +80,17 @@ public class Resources {
* bundle. * bundle.
*/ */
public String getText(String key) throws MissingResourceException { public String getText(String key) throws MissingResourceException {
if (docletBundle.containsKey(key)) String mKey = mapper == null ? key : mapper.apply(key);
return docletBundle.getString(key);
return commonBundle.getString(key); if (docletBundle.containsKey(mKey))
return docletBundle.getString(mKey);
return commonBundle.getString(mKey);
} }
/** /**
* Returns the string for the given key from one of the doclet's * Returns the string for the given key (after applying the current
* {@code mapper} if it is not {@code null}) from one of the doclet's
* resource bundles, substituting additional arguments into * resource bundles, substituting additional arguments into
* into the resulting string with {@link MessageFormat#format}. * into the resulting string with {@link MessageFormat#format}.
* *

View file

@ -128,7 +128,7 @@ public class ClassBuilder extends AbstractBuilder {
key = "doclet.Enum"; key = "doclet.Enum";
break; break;
case RECORD: case RECORD:
key = "doclet.Record"; key = "doclet.RecordClass";
break; break;
case ANNOTATION_TYPE: case ANNOTATION_TYPE:
key = "doclet.AnnotationType"; key = "doclet.AnnotationType";

View file

@ -127,7 +127,9 @@ doclet.Uses_Summary=Uses
doclet.Provides_Summary=Provides doclet.Provides_Summary=Provides
doclet.Interface_Summary=Interface Summary doclet.Interface_Summary=Interface Summary
doclet.Annotation_Types_Summary=Annotation Types Summary doclet.Annotation_Types_Summary=Annotation Types Summary
doclet.Annotation_Interfaces_Summary=Annotation Interfaces Summary
doclet.Enum_Summary=Enum Summary doclet.Enum_Summary=Enum Summary
doclet.Enum_Class_Summary=Enum Class Summary
doclet.Exception_Summary=Exception Summary doclet.Exception_Summary=Exception Summary
doclet.Error_Summary=Error Summary doclet.Error_Summary=Error Summary
doclet.Class_Summary=Class Summary doclet.Class_Summary=Class Summary
@ -139,11 +141,13 @@ doclet.Property_Summary=Property Summary
doclet.Enum_Constant_Summary=Enum Constant Summary doclet.Enum_Constant_Summary=Enum Constant Summary
doclet.Constructor_Summary=Constructor Summary doclet.Constructor_Summary=Constructor Summary
doclet.Method_Summary=Method Summary doclet.Method_Summary=Method Summary
doclet.Record_Summary=Record Summary doclet.Record_Class_Summary=Record Class Summary
doclet.Interfaces=Interfaces doclet.Interfaces=Interfaces
doclet.Enums=Enums doclet.Enums=Enums
doclet.EnumClasses=Enum Classes
doclet.RecordClasses=Record Classes doclet.RecordClasses=Record Classes
doclet.AnnotationTypes=Annotation Types doclet.AnnotationTypes=Annotation Types
doclet.AnnotationInterfaces=Annotation Interfaces
doclet.Exceptions=Exceptions doclet.Exceptions=Exceptions
doclet.Errors=Errors doclet.Errors=Errors
doclet.Classes=Classes doclet.Classes=Classes
@ -155,17 +159,23 @@ doclet.All_Implemented_Interfaces=All Implemented Interfaces:
doclet.Interface=Interface doclet.Interface=Interface
doclet.Class=Class doclet.Class=Class
doclet.AnnotationType=Annotation Type doclet.AnnotationType=Annotation Type
doclet.AnnotationInterface=Annotation Interface
doclet.annotationtype=annotation type doclet.annotationtype=annotation type
doclet.annotationinterface=annotation interface
doclet.annotationtypes=annotation types doclet.annotationtypes=annotation types
doclet.annotationinterfaces=annotation interfaces
doclet.Enum=Enum doclet.Enum=Enum
doclet.EnumClass=Enum Class
doclet.enum=enum doclet.enum=enum
doclet.enumclass=enum class
doclet.enums=enums doclet.enums=enums
doclet.enumclasses=enum classes
doclet.interface=interface doclet.interface=interface
doclet.interfaces=interfaces doclet.interfaces=interfaces
doclet.class=class doclet.class=class
doclet.classes=classes doclet.classes=classes
doclet.Record=Record doclet.RecordClass=Record Class
doclet.record=record doclet.recordclass=record class
doclet.Error=Error doclet.Error=Error
doclet.error=error doclet.error=error
doclet.errors=errors doclet.errors=errors
@ -206,8 +216,6 @@ doclet.value_tag_invalid_constant=@value tag (which references {0}) can only be
doclet.value_tag_invalid_use=@value tag cannot be used here. doclet.value_tag_invalid_use=@value tag cannot be used here.
doclet.dest_dir_create=Creating destination directory: "{0}" doclet.dest_dir_create=Creating destination directory: "{0}"
doclet.in={0} in {1} doclet.in={0} in {1}
doclet.Use_Table_Summary=Use table, listing {0}, and an explanation
doclet.Member_Table_Summary={0} table, listing {1}, and an explanation
doclet.fields=fields doclet.fields=fields
doclet.Fields=Fields doclet.Fields=Fields
doclet.Properties=Properties doclet.Properties=Properties
@ -239,6 +247,7 @@ doclet.Method=Method
doclet.Annotation_Type_Optional_Member=Optional Element doclet.Annotation_Type_Optional_Member=Optional Element
doclet.Annotation_Type_Required_Member=Required Element doclet.Annotation_Type_Required_Member=Required Element
doclet.Annotation_Type_Member=Annotation Type Element doclet.Annotation_Type_Member=Annotation Type Element
doclet.Annotation_Interface_Member=Annotation Interface Element
doclet.Enum_Constant=Enum Constant doclet.Enum_Constant=Enum Constant
doclet.Description=Description doclet.Description=Description
doclet.ConstantField=Constant Field doclet.ConstantField=Constant Field
@ -253,15 +262,25 @@ doclet.urlRedirected=URL {0} was redirected to {1} -- Update the command-line op
doclet.enum_values_doc.fullbody=\ doclet.enum_values_doc.fullbody=\
Returns an array containing the constants of this enum type, in\n\ Returns an array containing the constants of this enum type, in\n\
the order they are declared. the order they are declared.
doclet.enum_class_values_doc.fullbody=\
Returns an array containing the constants of this enum class, in\n\
the order they are declared.
doclet.enum_values_doc.return=\ doclet.enum_values_doc.return=\
an array containing the constants of this enum type, in the order they are declared an array containing the constants of this enum type, in the order they are declared
doclet.enum_class_values_doc.return=\
an array containing the constants of this enum class, in the order they are declared
doclet.enum_valueof_doc.fullbody=\ doclet.enum_valueof_doc.fullbody=\
Returns the enum constant of this type with the specified name.\n\ Returns the enum constant of this type with the specified name.\n\
The string must match <i>exactly</i> an identifier used to declare an\n\ The string must match <i>exactly</i> an identifier used to declare an\n\
enum constant in this type. (Extraneous whitespace characters are \n\ enum constant in this type. (Extraneous whitespace characters are \n\
not permitted.) not permitted.)
doclet.enum_class_valueof_doc.fullbody=\
Returns the enum constant of this class with the specified name.\n\
The string must match <i>exactly</i> an identifier used to declare an\n\
enum constant in this class. (Extraneous whitespace characters are \n\
not permitted.)
doclet.enum_valueof_doc.param_name=\ doclet.enum_valueof_doc.param_name=\
the name of the enum constant to be returned. the name of the enum constant to be returned.
@ -271,6 +290,8 @@ doclet.enum_valueof_doc.return=\
doclet.enum_valueof_doc.throws_ila=\ doclet.enum_valueof_doc.throws_ila=\
if this enum type has no constant with the specified name if this enum type has no constant with the specified name
doclet.enum_class_valueof_doc.throws_ila=\
if this enum class has no constant with the specified name
doclet.enum_valueof_doc.throws_npe=\ doclet.enum_valueof_doc.throws_npe=\
if the argument is null if the argument is null
@ -278,7 +299,7 @@ doclet.enum_valueof_doc.throws_npe=\
#Documentation for records #Documentation for records
doclet.record_constructor_doc.fullbody=\ doclet.record_constructor_doc.fullbody=\
Creates an instance of a {0} record. Creates an instance of a {0} record class.
doclet.record_constructor_doc.param_name=\ doclet.record_constructor_doc.param_name=\
the value for the {0} record component the value for the {0} record component
@ -294,10 +315,10 @@ doclet.record_equals_doc.fullbody.tail.both=\
primitive components are compared with '=='. primitive components are compared with '=='.
doclet.record_equals_doc.fullbody.tail.primitive=\ doclet.record_equals_doc.fullbody.tail.primitive=\
All components in this record are compared with '=='. All components in this record class are compared with '=='.
doclet.record_equals_doc.fullbody.tail.reference=\ doclet.record_equals_doc.fullbody.tail.reference=\
All components in this record are compared with \ All components in this record class are compared with \
{@link java.util.Objects#equals(Object,Object) Objects::equals(Object,Object)}. {@link java.util.Objects#equals(Object,Object) Objects::equals(Object,Object)}.
doclet.record_equals_doc.param_name=\ doclet.record_equals_doc.param_name=\
@ -314,8 +335,8 @@ doclet.record_hashCode_doc.return=\
a hash code value for this object a hash code value for this object
doclet.record_toString_doc.fullbody=\ doclet.record_toString_doc.fullbody=\
Returns a string representation of this record. \ Returns a string representation of this record class. \
The representation contains the name of the type, followed by \ The representation contains the name of the class, followed by \
the name and value of each of the record components. the name and value of each of the record components.
doclet.record_toString_doc.return=\ doclet.record_toString_doc.return=\
@ -338,6 +359,7 @@ doclet.search.no_results=No results found
doclet.search.loading=Loading search index... doclet.search.loading=Loading search index...
doclet.search.modules=Modules doclet.search.modules=Modules
doclet.search.packages=Packages doclet.search.packages=Packages
doclet.search.classes_and_interfaces=Classes and Interfaces
doclet.search.types=Types doclet.search.types=Types
doclet.search.members=Members doclet.search.members=Members
doclet.search.search_tags=Search Tags doclet.search.search_tags=Search Tags

View file

@ -1362,7 +1362,7 @@ public class Utils {
case INTERFACE -> case INTERFACE ->
"doclet.Interface"; "doclet.Interface";
case RECORD -> case RECORD ->
"doclet.Record"; "doclet.RecordClass";
case CLASS -> case CLASS ->
isException(te) ? "doclet.Exception" isException(te) ? "doclet.Exception"
: isError(te) ? "doclet.Error" : isError(te) ? "doclet.Error"

View file

@ -50,6 +50,6 @@ public class TestAnnotationOptional extends JavadocTester {
checkOutput("pkg/AnnotationOptional.html", true, checkOutput("pkg/AnnotationOptional.html", true,
""" """
<section class="details" id="annotation.type.element.detail">"""); <section class="details" id="annotation.interface.element.detail">""");
} }
} }

View file

@ -79,11 +79,11 @@ public class TestAnnotationTypes extends JavadocTester {
<li>Field&nbsp;|&nbsp;</li>"""); <li>Field&nbsp;|&nbsp;</li>""");
checkOutput("pkg/AnnotationType.html", true, checkOutput("pkg/AnnotationType.html", true,
"<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->", "<!-- ============ ANNOTATION INTERFACE MEMBER DETAIL =========== -->",
"<ul class=\"member-list\">", "<ul class=\"member-list\">",
"<li>", "<li>",
""" """
<section class="details" id="annotation.type.element.detail">""", <section class="details" id="annotation.interface.element.detail">""",
"<h2>Element Details</h2>", "<h2>Element Details</h2>",
"<!-- -->", "<!-- -->",
"</a>", "</a>",

View file

@ -57,21 +57,21 @@ public class TestClassTree extends JavadocTester {
<li class="circle">pkg.<a href="ParentClass.html" title="class in pkg"><span cla\ <li class="circle">pkg.<a href="ParentClass.html" title="class in pkg"><span cla\
ss="type-name-link">ParentClass</span></a>""", ss="type-name-link">ParentClass</span></a>""",
""" """
<h2 title="Annotation Type Hierarchy">Annotation Type Hierarchy</h2> <h2 title="Annotation Interface Hierarchy">Annotation Interface Hierarchy</h2>
<ul> <ul>
<li class="circle">pkg.<a href="AnnotationType.html" title="annotation in pkg"><\ <li class="circle">pkg.<a href="AnnotationType.html" title="annotation in pkg"><\
span class="type-name-link">AnnotationType</span></a> (implements java.lang.anno\ span class="type-name-link">AnnotationType</span></a> (implements java.lang.anno\
tation.Annotation)</li> tation.Annotation)</li>
</ul>""", </ul>""",
""" """
<h2 title="Enum Hierarchy">Enum Hierarchy</h2> <h2 title="Enum Class Hierarchy">Enum Class Hierarchy</h2>
<ul> <ul>
<li class="circle">java.lang.Object <li class="circle">java.lang.Object
<ul> <ul>
<li class="circle">java.lang.Enum&lt;E&gt; (implements java.lang.Comparable&lt;T\ <li class="circle">java.lang.Enum&lt;E&gt; (implements java.lang.Comparable&lt;T\
&gt;, java.lang.constant.Constable, java.io.Serializable) &gt;, java.lang.constant.Constable, java.io.Serializable)
<ul> <ul>
<li class="circle">pkg.<a href="Coin.html" title="enum in pkg"><span class="type-name-link">Coin</span></a></li> <li class="circle">pkg.<a href="Coin.html" title="enum class in pkg"><span class="type-name-link">Coin</span></a></li>
</ul> </ul>
</li> </li>
</ul> </ul>

View file

@ -216,7 +216,7 @@ public class TestDeprecatedDocs extends JavadocTester {
<div class="type-signature"><span class="annotations">@Deprecated(forRemoval=true) <div class="type-signature"><span class="annotations">@Deprecated(forRemoval=true)
</span><span class="modifiers">public enum </span><span class="element-name type-name-label">TestEnum</span> </span><span class="modifiers">public enum </span><span class="element-name type-name-label">TestEnum</span>
<span class="extends-implements">extends java.lang.Enum&lt;<a href="TestEnum.htm\ <span class="extends-implements">extends java.lang.Enum&lt;<a href="TestEnum.htm\
l" title="enum in pkg">TestEnum</a>&gt;</span></div> l" title="enum class in pkg">TestEnum</a>&gt;</span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated, for re\ <div class="deprecation-block"><span class="deprecated-label">Deprecated, for re\
moval: This API element is subject to removal in a future version.</span> moval: This API element is subject to removal in a future version.</span>
<div class="deprecation-comment">enum_test1 passes.</div> <div class="deprecation-comment">enum_test1 passes.</div>
@ -224,7 +224,7 @@ public class TestDeprecatedDocs extends JavadocTester {
""" """
<div class="member-signature"><span class="annotations">@Deprecated(forRemoval=true) <div class="member-signature"><span class="annotations">@Deprecated(forRemoval=true)
</span><span class="modifiers">public static final</span>&nbsp;<span class="retu\ </span><span class="modifiers">public static final</span>&nbsp;<span class="retu\
rn-type"><a href="TestEnum.html" title="enum in pkg">TestEnum</a></span>&nbsp;<s\ rn-type"><a href="TestEnum.html" title="enum class in pkg">TestEnum</a></span>&nbsp;<s\
pan class="element-name">FOR_REMOVAL</span></div> pan class="element-name">FOR_REMOVAL</span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated, for re\ <div class="deprecation-block"><span class="deprecated-label">Deprecated, for re\
moval: This API element is subject to removal in a future version.</span> moval: This API element is subject to removal in a future version.</span>
@ -269,15 +269,15 @@ public class TestDeprecatedDocs extends JavadocTester {
<ul> <ul>
<li><a href="#forRemoval">For Removal</a></li> <li><a href="#forRemoval">For Removal</a></li>
<li><a href="#class">Classes</a></li> <li><a href="#class">Classes</a></li>
<li><a href="#enum">Enums</a></li> <li><a href="#enum.class">Enum Classes</a></li>
<li><a href="#exception">Exceptions</a></li> <li><a href="#exception">Exceptions</a></li>
<li><a href="#error">Errors</a></li> <li><a href="#error">Errors</a></li>
<li><a href="#annotation.type">Annotation Types</a></li> <li><a href="#annotation.interface">Annotation Interfaces</a></li>
<li><a href="#field">Fields</a></li> <li><a href="#field">Fields</a></li>
<li><a href="#method">Methods</a></li> <li><a href="#method">Methods</a></li>
<li><a href="#constructor">Constructors</a></li> <li><a href="#constructor">Constructors</a></li>
<li><a href="#enum.constant">Enum Constants</a></li> <li><a href="#enum.constant">Enum Constants</a></li>
<li><a href="#annotation.type.member">Annotation Type Elements</a></li> <li><a href="#annotation.interface.member">Annotation Interface Elements</a></li>
</ul>""", </ul>""",
""" """
<div id="forRemoval"> <div id="forRemoval">
@ -286,12 +286,12 @@ public class TestDeprecatedDocs extends JavadocTester {
<div class="table-header col-first">Element</div> <div class="table-header col-first">Element</div>
<div class="table-header col-last">Description</div>""", <div class="table-header col-last">Description</div>""",
""" """
<div id="enum"> <div id="enum.class">
<div class="caption"><span>Enums</span></div> <div class="caption"><span>Enum Classes</span></div>
<div class="summary-table two-column-summary"> <div class="summary-table two-column-summary">
<div class="table-header col-first">Enum</div> <div class="table-header col-first">Enum Class</div>
<div class="table-header col-last">Description</div> <div class="table-header col-last">Description</div>
<div class="col-deprecated-item-name even-row-color"><a href="pkg/TestEnum.html" title="enum in pkg">pkg.TestEnum</a></div> <div class="col-deprecated-item-name even-row-color"><a href="pkg/TestEnum.html" title="enum class in pkg">pkg.TestEnum</a></div>
<div class="col-last even-row-color"> <div class="col-last even-row-color">
<div class="deprecation-comment">enum_test1 passes.</div> <div class="deprecation-comment">enum_test1 passes.</div>
</div>""", </div>""",

View file

@ -63,7 +63,7 @@ public class TestHelpFile extends JavadocTester {
<ul class="help-section-list"> <ul class="help-section-list">
<li>Interfaces</li> <li>Interfaces</li>
<li>Classes</li> <li>Classes</li>
<li>Enums</li>""", <li>Enum Classes</li>""",
""" """
</section> </section>
<section class="help-section"> <section class="help-section">

View file

@ -353,7 +353,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
""" """
<div class="member-signature"><span class="modifiers">public static final</span>\ <div class="member-signature"><span class="modifiers">public static final</span>\
&nbsp;<span class="return-type"><a href="C1.ModalExclusionType.html" title="enum\ &nbsp;<span class="return-type"><a href="C1.ModalExclusionType.html" title="enum\
in pkg1">C1.ModalExclusionType</a></span>&nbsp;<span class="element-name">APPLICATION_E\ class in pkg1">C1.ModalExclusionType</a></span>&nbsp;<span class="element-name">APPLICATION_E\
XCLUDE</span></div> XCLUDE</span></div>
</section> </section>
</li>"""); </li>""");

View file

@ -191,10 +191,10 @@ public class TestHtmlTableTags extends JavadocTester {
checkOutput("pkg2/package-summary.html", true, checkOutput("pkg2/package-summary.html", true,
""" """
<div class="type-summary"> <div class="type-summary">
<table summary="Enum Summary table, listing enums, and an explanation">""", <table summary="Enum Class Summary table, listing enums, and an explanation">""",
""" """
<div class="type-summary"> <div class="type-summary">
<table summary="Annotation Types Summary table, listing annotation types, and an explanation">"""); <table summary="Annotation Interfaces Summary table, listing annotation types, and an explanation">""");
// Class documentation // Class documentation
checkOutput("pkg1/C1.html", true, checkOutput("pkg1/C1.html", true,
@ -309,8 +309,8 @@ public class TestHtmlTableTags extends JavadocTester {
"<div class=\"caption\"><span>Interface Summary</span></div>"); "<div class=\"caption\"><span>Interface Summary</span></div>");
checkOutput("pkg2/package-summary.html", true, checkOutput("pkg2/package-summary.html", true,
"<div class=\"caption\"><span>Enum Summary</span></div>", "<div class=\"caption\"><span>Enum Class Summary</span></div>",
"<div class=\"caption\"><span>Annotation Types Summary</span></div>"); "<div class=\"caption\"><span>Annotation Interfaces Summary</span></div>");
// Class documentation // Class documentation
checkOutput("pkg1/C1.html", true, checkOutput("pkg1/C1.html", true,
@ -373,7 +373,7 @@ public class TestHtmlTableTags extends JavadocTester {
checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true,
""" """
<div class="caption"><span>Methods in <a href="../package-summary.html">pkg2</a> that return\ <div class="caption"><span>Methods in <a href="../package-summary.html">pkg2</a> that return\
<a href="../C2.ModalExclusionType.html" title="enum in pkg2">C2.ModalExclusionT\ <a href="../C2.ModalExclusionType.html" title="enum class in pkg2">C2.ModalExclusionT\
ype</a></span></div>"""); ype</a></span></div>""");
// Package use documentation // Package use documentation
@ -421,10 +421,10 @@ public class TestHtmlTableTags extends JavadocTester {
checkOutput("pkg2/package-summary.html", true, checkOutput("pkg2/package-summary.html", true,
""" """
<div class="table-header col-first">Enum</div> <div class="table-header col-first">Enum Class</div>
<div class="table-header col-last">Description</div>""", <div class="table-header col-last">Description</div>""",
""" """
<div class="table-header col-first">Annotation Type</div> <div class="table-header col-first">Annotation Interface</div>
<div class="table-header col-last">Description</div>"""); <div class="table-header col-last">Description</div>""");
// Class documentation // Class documentation
@ -558,7 +558,7 @@ public class TestHtmlTableTags extends JavadocTester {
checkOutput("pkg2/package-summary.html", true, checkOutput("pkg2/package-summary.html", true,
""" """
<div class="col-first even-row-color"><a href="C2.ModalExclusionType.html" title="enum in pkg2">C2.ModalExclusionType</a></div> <div class="col-first even-row-color"><a href="C2.ModalExclusionType.html" title="enum class in pkg2">C2.ModalExclusionType</a></div>
<div class="col-last even-row-color"> <div class="col-last even-row-color">
<div class="block">A sample enum.</div> <div class="block">A sample enum.</div>
</div>""", </div>""",
@ -715,7 +715,7 @@ public class TestHtmlTableTags extends JavadocTester {
checkOutput("pkg2/package-summary.html", true, checkOutput("pkg2/package-summary.html", true,
""" """
<div class="col-first even-row-color"><a href="C2.ModalExclusionType.html" title="enum in pkg2">C2.ModalExclusionType</a></div> <div class="col-first even-row-color"><a href="C2.ModalExclusionType.html" title="enum class in pkg2">C2.ModalExclusionType</a></div>
<div class="col-last even-row-color"></div>""", <div class="col-last even-row-color"></div>""",
""" """
<div class="col-first even-row-color"><a href="C3.html" title="annotation in pkg2">C3</a></div> <div class="col-first even-row-color"><a href="C3.html" title="annotation in pkg2">C3</a></div>

View file

@ -144,10 +144,10 @@ public class TestHtmlVersion extends JavadocTester {
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>""", <h2 title="Interface Hierarchy">Interface Hierarchy</h2>""",
""" """
<section class="hierarchy"> <section class="hierarchy">
<h2 title="Annotation Type Hierarchy">Annotation Type Hierarchy</h2>""", <h2 title="Annotation Interface Hierarchy">Annotation Interface Hierarchy</h2>""",
""" """
<section class="hierarchy"> <section class="hierarchy">
<h2 title="Enum Hierarchy">Enum Hierarchy</h2>""", <h2 title="Enum Class Hierarchy">Enum Class Hierarchy</h2>""",
""" """
<footer role="contentinfo">""", <footer role="contentinfo">""",
""" """
@ -272,11 +272,11 @@ public class TestHtmlVersion extends JavadocTester {
""", """,
""" """
<section class="hierarchy"> <section class="hierarchy">
<h2 title="Annotation Type Hierarchy">Annotation Type Hierarchy</h2> <h2 title="Annotation Interface Hierarchy">Annotation Interface Hierarchy</h2>
""", """,
""" """
<section class="hierarchy"> <section class="hierarchy">
<h2 title="Enum Hierarchy">Enum Hierarchy</h2> <h2 title="Enum Class Hierarchy">Enum Class Hierarchy</h2>
""", """,
""" """
<footer role="contentinfo">""", <footer role="contentinfo">""",
@ -534,19 +534,19 @@ public class TestHtmlVersion extends JavadocTester {
<!-- ======== START OF CLASS DATA ======== --> <!-- ======== START OF CLASS DATA ======== -->
<div class="header">""", <div class="header">""",
""" """
<section class="member-summary" id="annotation.type.required.element.summary"> <section class="member-summary" id="annotation.interface.required.element.summary">
<h2>Required Element Summary</h2> <h2>Required Element Summary</h2>
<div class="caption"><span>Required Elements</span></div> <div class="caption"><span>Required Elements</span></div>
<div class="summary-table three-column-summary">""", <div class="summary-table three-column-summary">""",
""" """
<section class="member-summary" id="annotation.type.optional.element.summary"> <section class="member-summary" id="annotation.interface.optional.element.summary">
<h2>Optional Element Summary</h2> <h2>Optional Element Summary</h2>
<div class="caption"><span>Optional Elements</span></div> <div class="caption"><span>Optional Elements</span></div>
<div class="summary-table three-column-summary">""", <div class="summary-table three-column-summary">""",
""" """
<section class="details" id="annotation.type.element.detail"> <section class="details" id="annotation.interface.element.detail">
<ul class="details-list"> <ul class="details-list">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== --> <!-- ============ ANNOTATION INTERFACE MEMBER DETAIL =========== -->
<li> <li>
<section class="member-details"> <section class="member-details">
<h2>Element Details</h2> <h2>Element Details</h2>
@ -759,7 +759,7 @@ public class TestHtmlVersion extends JavadocTester {
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>""", <h2 title="Interface Hierarchy">Interface Hierarchy</h2>""",
""" """
</ul> </ul>
<h2 title="Enum Hierarchy">Enum Hierarchy</h2>"""); <h2 title="Enum Class Hierarchy">Enum Class Hierarchy</h2>""");
// Negated test for index-all page // Negated test for index-all page
checkOutput("index-all.html", false, checkOutput("index-all.html", false,

View file

@ -60,11 +60,11 @@ public class TestIndex extends JavadocTester {
>""", >""",
""" """
<a href="pkg/AnnotationType.html" title="annotation in pkg"><span class="type-na\ <a href="pkg/AnnotationType.html" title="annotation in pkg"><span class="type-na\
me-link">AnnotationType</span></a> - Annotation Type in <a href="pkg/package-sum\ me-link">AnnotationType</span></a> - Annotation Interface in <a href="pkg/package-sum\
mary.html">pkg</a>""", mary.html">pkg</a>""",
""" """
<a href="pkg/Coin.html" title="enum in pkg"><span class="type-name-link">Coin</s\ <a href="pkg/Coin.html" title="enum class in pkg"><span class="type-name-link">Coin</s\
pan></a> - Enum in <a href="pkg/package-summary.html">pkg</a>""", pan></a> - Enum Class in <a href="pkg/package-summary.html">pkg</a>""",
""" """
Class in <a href="package-summary.html">&lt;Unnamed&gt;</a>""", Class in <a href="package-summary.html">&lt;Unnamed&gt;</a>""",
""" """
@ -77,6 +77,6 @@ public class TestIndex extends JavadocTester {
<dd>&nbsp;</dd> <dd>&nbsp;</dd>
</dl>""", </dl>""",
""" """
<dt><span class="search-tag-link"><a href="pkg/Coin.html#Enum">Enum</a></span> - Search tag in enum pkg.Coin</dt>"""); <dt><span class="search-tag-link"><a href="pkg/Coin.html#Enum">Enum</a></span> - Search tag in enum class pkg.Coin</dt>""");
} }
} }

View file

@ -171,7 +171,7 @@ public class TestLists extends JavadocTester {
checkOutput("p/A.html", true, checkOutput("p/A.html", true,
""" """
<ul class="details-list"> <ul class="details-list">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== --> <!-- ============ ANNOTATION INTERFACE MEMBER DETAIL =========== -->
<li> <li>
<section class="member-details"> <section class="member-details">
<h2>Element Details</h2> <h2>Element Details</h2>
@ -240,9 +240,9 @@ public class TestLists extends JavadocTester {
""" """
<section class="summary"> <section class="summary">
<ul class="summary-list"> <ul class="summary-list">
<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== --> <!-- =========== ANNOTATION INTERFACE REQUIRED MEMBER SUMMARY =========== -->
<li> <li>
<section class="member-summary" id="annotation.type.required.element.summary"> <section class="member-summary" id="annotation.interface.required.element.summary">
<h2>Required Element Summary</h2> <h2>Required Element Summary</h2>
<div class="caption"><span>Required Elements</span></div> <div class="caption"><span>Required Elements</span></div>
<div class="summary-table three-column-summary">"""); <div class="summary-table three-column-summary">""");

View file

@ -1383,7 +1383,7 @@ public class TestModules extends JavadocTester {
<button id="all-classes-table-tab6" role="tab" aria-selected="false" aria-contro\ <button id="all-classes-table-tab6" role="tab" aria-selected="false" aria-contro\
ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\ ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
ck="show('all-classes-table', 'all-classes-table-tab6', 2)" class="table-tab">An\ ck="show('all-classes-table', 'all-classes-table-tab6', 2)" class="table-tab">An\
notation Types Summary</button>\ notation Interfaces Summary</button>\
</div> </div>
""", """,
""" """

View file

@ -65,31 +65,31 @@ public class TestNewLanguageFeatures extends JavadocTester {
void checkEnums() { void checkEnums() {
checkOutput("pkg/Coin.html", true, checkOutput("pkg/Coin.html", true,
// Make sure enum header is correct. // Make sure enum header is correct.
"Enum Coin</h1>", "Enum Class Coin</h1>",
// Make sure enum signature is correct. // Make sure enum signature is correct.
""" """
<div class="type-signature"><span class="modifiers">public enum </span><span clas\ <div class="type-signature"><span class="modifiers">public enum </span><span clas\
s="element-name type-name-label">Coin</span> s="element-name type-name-label">Coin</span>
<span class="extends-implements">extends java.lang.Enum&lt;<a href="Coin.html" ti\ <span class="extends-implements">extends java.lang.Enum&lt;<a href="Coin.html" ti\
tle="enum in pkg">Coin</a>&gt;</span></div>""", tle="enum class in pkg">Coin</a>&gt;</span></div>""",
// Check for enum constant section // Check for enum constant section
"<div class=\"caption\"><span>Enum Constants</span></div>", "<div class=\"caption\"><span>Enum Constants</span></div>",
// Detail for enum constant // Detail for enum constant
""" """
<span class="member-name-link"><a href="#Dime">Dime</a></span>""", <span class="member-name-link"><a href="#Dime">Dime</a></span>""",
// Automatically insert documentation for values() and valueOf(). // Automatically insert documentation for values() and valueOf().
"Returns an array containing the constants of this enum type,", "Returns an array containing the constants of this enum class,",
"Returns the enum constant of this type with the specified name", "Returns the enum constant of this class with the specified name",
"Overloaded valueOf() method has correct documentation.", "Overloaded valueOf() method has correct documentation.",
"Overloaded values method has correct documentation.", "Overloaded values method has correct documentation.",
""" """
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;\ <div class="member-signature"><span class="modifiers">public static</span>&nbsp;\
<span class="return-type"><a href="Coin.html" title="enum in pkg">Coin</a></span\ <span class="return-type"><a href="Coin.html" title="enum class in pkg">Coin</a></span\
>&nbsp;<span class="element-name">valueOf</span>&#8203;<span class="parameters">(java.la\ >&nbsp;<span class="element-name">valueOf</span>&#8203;<span class="parameters">(java.la\
ng.String&nbsp;name)</span></div> ng.String&nbsp;name)</span></div>
<div class="block">Returns the enum constant of this type with the specified name. <div class="block">Returns the enum constant of this class with the specified name.
The string must match <i>exactly</i> an identifier used to declare an The string must match <i>exactly</i> an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are\s enum constant in this class. (Extraneous whitespace characters are\s
not permitted.)</div> not permitted.)</div>
<dl class="notes"> <dl class="notes">
<dt>Parameters:</dt> <dt>Parameters:</dt>
@ -97,7 +97,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
<dt>Returns:</dt> <dt>Returns:</dt>
<dd>the enum constant with the specified name</dd> <dd>the enum constant with the specified name</dd>
<dt>Throws:</dt> <dt>Throws:</dt>
<dd><code>java.lang.IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd> <dd><code>java.lang.IllegalArgumentException</code> - if this enum class has no constant with the specified name</dd>
<dd><code>java.lang.NullPointerException</code> - if the argument is null</dd>"""); <dd><code>java.lang.NullPointerException</code> - if the argument is null</dd>""");
// NO constructor section // NO constructor section

View file

@ -262,12 +262,12 @@ public class TestOptions extends JavadocTester {
checkOutput("linksource/SomeEnum.html", true, checkOutput("linksource/SomeEnum.html", true,
""" """
<div class="member-signature"><span class="modifiers">public static final</span>\ <div class="member-signature"><span class="modifiers">public static final</span>\
&nbsp;<span class="return-type"><a href="SomeEnum.html" title="enum in linksourc\ &nbsp;<span class="return-type"><a href="SomeEnum.html" title="enum class in linksourc\
e">SomeEnum</a></span>&nbsp;<span class="element-name"><a href="../src-html/linksource/S\ e">SomeEnum</a></span>&nbsp;<span class="element-name"><a href="../src-html/linksource/S\
omeEnum.html#line.29">VALUE1</a></span></div>""", omeEnum.html#line.29">VALUE1</a></span></div>""",
""" """
<div class="member-signature"><span class="modifiers">public static final</span>\ <div class="member-signature"><span class="modifiers">public static final</span>\
&nbsp;<span class="return-type"><a href="SomeEnum.html" title="enum in linksourc\ &nbsp;<span class="return-type"><a href="SomeEnum.html" title="enum class in linksourc\
e">SomeEnum</a></span>&nbsp;<span class="element-name"><a href="../src-html/linksource/S\ e">SomeEnum</a></span>&nbsp;<span class="element-name"><a href="../src-html/linksource/S\
omeEnum.html#line.30">VALUE2</a></span></div>"""); omeEnum.html#line.30">VALUE2</a></span></div>""");

View file

@ -249,9 +249,9 @@ public class TestOrdering extends JavadocTester {
String expectedEnumOrdering[] = { String expectedEnumOrdering[] = {
""" """
Add.add.html" title="enum in REPLACE_ME\"""", Add.add.html" title="enum class in REPLACE_ME\"""",
""" """
Add.ADD.html" title="enum in REPLACE_ME\"""" Add.ADD.html" title="enum class in REPLACE_ME\""""
}; };
String expectedFieldOrdering[] = { String expectedFieldOrdering[] = {
@ -397,78 +397,78 @@ public class TestOrdering extends JavadocTester {
checkOrder("index-all.html", composeTestVectors()); checkOrder("index-all.html", composeTestVectors());
checkOrder("add0/add/package-tree.html", checkOrder("add0/add/package-tree.html",
""" """
<a href="Add.add.html" title="enum in add0.add">""", <a href="Add.add.html" title="enum class in add0.add">""",
""" """
<a href="Add.ADD.html" title="enum in add0.add">"""); <a href="Add.ADD.html" title="enum class in add0.add">""");
checkOrder("overview-tree.html", checkOrder("overview-tree.html",
""" """
<a href="Add.add.html" title="enum in &lt;Unnamed&gt;">""", <a href="Add.add.html" title="enum class in &lt;Unnamed&gt;">""",
""" """
<a href="add0/Add.add.html" title="enum in add0">""", <a href="add0/Add.add.html" title="enum class in add0">""",
""" """
<a href="add0/add/Add.add.html" title="enum in add0.add">""", <a href="add0/add/Add.add.html" title="enum class in add0.add">""",
""" """
<a href="add0/add/add/Add.add.html" title="enum in add0.add.add">""", <a href="add0/add/add/Add.add.html" title="enum class in add0.add.add">""",
""" """
<a href="add0/add/add/add/Add.add.html" title="enum in add0.add.add.add">""", <a href="add0/add/add/add/Add.add.html" title="enum class in add0.add.add.add">""",
""" """
<a href="add1/Add.add.html" title="enum in add1">""", <a href="add1/Add.add.html" title="enum class in add1">""",
""" """
<a href="add1/add/Add.add.html" title="enum in add1.add">""", <a href="add1/add/Add.add.html" title="enum class in add1.add">""",
""" """
<a href="add1/add/add/Add.add.html" title="enum in add1.add.add">""", <a href="add1/add/add/Add.add.html" title="enum class in add1.add.add">""",
""" """
<a href="add1/add/add/add/Add.add.html" title="enum in add1.add.add.add">""", <a href="add1/add/add/add/Add.add.html" title="enum class in add1.add.add.add">""",
""" """
<a href="add2/Add.add.html" title="enum in add2">""", <a href="add2/Add.add.html" title="enum class in add2">""",
""" """
<a href="add2/add/Add.add.html" title="enum in add2.add">""", <a href="add2/add/Add.add.html" title="enum class in add2.add">""",
""" """
<a href="add2/add/add/Add.add.html" title="enum in add2.add.add">""", <a href="add2/add/add/Add.add.html" title="enum class in add2.add.add">""",
""" """
<a href="add2/add/add/add/Add.add.html" title="enum in add2.add.add.add">""", <a href="add2/add/add/add/Add.add.html" title="enum class in add2.add.add.add">""",
""" """
<a href="add3/Add.add.html" title="enum in add3">""", <a href="add3/Add.add.html" title="enum class in add3">""",
""" """
<a href="add3/add/Add.add.html" title="enum in add3.add">""", <a href="add3/add/Add.add.html" title="enum class in add3.add">""",
""" """
<a href="add3/add/add/Add.add.html" title="enum in add3.add.add">""", <a href="add3/add/add/Add.add.html" title="enum class in add3.add.add">""",
""" """
<a href="add3/add/add/add/Add.add.html" title="enum in add3.add.add.add">""", <a href="add3/add/add/add/Add.add.html" title="enum class in add3.add.add.add">""",
""" """
<a href="Add.ADD.html" title="enum in &lt;Unnamed&gt;">""", <a href="Add.ADD.html" title="enum class in &lt;Unnamed&gt;">""",
""" """
<a href="add0/Add.ADD.html" title="enum in add0">""", <a href="add0/Add.ADD.html" title="enum class in add0">""",
""" """
<a href="add0/add/Add.ADD.html" title="enum in add0.add">""", <a href="add0/add/Add.ADD.html" title="enum class in add0.add">""",
""" """
<a href="add0/add/add/Add.ADD.html" title="enum in add0.add.add">""", <a href="add0/add/add/Add.ADD.html" title="enum class in add0.add.add">""",
""" """
<a href="add0/add/add/add/Add.ADD.html" title="enum in add0.add.add.add">""", <a href="add0/add/add/add/Add.ADD.html" title="enum class in add0.add.add.add">""",
""" """
<a href="add1/Add.ADD.html" title="enum in add1">""", <a href="add1/Add.ADD.html" title="enum class in add1">""",
""" """
<a href="add1/add/Add.ADD.html" title="enum in add1.add">""", <a href="add1/add/Add.ADD.html" title="enum class in add1.add">""",
""" """
<a href="add1/add/add/Add.ADD.html" title="enum in add1.add.add">""", <a href="add1/add/add/Add.ADD.html" title="enum class in add1.add.add">""",
""" """
<a href="add1/add/add/add/Add.ADD.html" title="enum in add1.add.add.add">""", <a href="add1/add/add/add/Add.ADD.html" title="enum class in add1.add.add.add">""",
""" """
<a href="add2/Add.ADD.html" title="enum in add2">""", <a href="add2/Add.ADD.html" title="enum class in add2">""",
""" """
<a href="add2/add/Add.ADD.html" title="enum in add2.add">""", <a href="add2/add/Add.ADD.html" title="enum class in add2.add">""",
""" """
<a href="add2/add/add/Add.ADD.html" title="enum in add2.add.add">""", <a href="add2/add/add/Add.ADD.html" title="enum class in add2.add.add">""",
""" """
<a href="add2/add/add/add/Add.ADD.html" title="enum in add2.add.add.add">""", <a href="add2/add/add/add/Add.ADD.html" title="enum class in add2.add.add.add">""",
""" """
<a href="add3/Add.ADD.html" title="enum in add3">""", <a href="add3/Add.ADD.html" title="enum class in add3">""",
""" """
<a href="add3/add/Add.ADD.html" title="enum in add3.add">""", <a href="add3/add/Add.ADD.html" title="enum class in add3.add">""",
""" """
<a href="add3/add/add/Add.ADD.html" title="enum in add3.add.add">""", <a href="add3/add/add/Add.ADD.html" title="enum class in add3.add.add">""",
""" """
<a href="add3/add/add/add/Add.ADD.html" title="enum in add3.add.add.add">"""); <a href="add3/add/add/add/Add.ADD.html" title="enum class in add3.add.add.add">""");
} }
void emitFile(String pkgname, String clsname, ListOrder order) throws IOException { void emitFile(String pkgname, String clsname, ListOrder order) throws IOException {
@ -558,9 +558,9 @@ public class TestOrdering extends JavadocTester {
checkOrder("index-all.html", checkOrder("index-all.html",
"something</a> - package something</dt>", "something</a> - package something</dt>",
"something</span></a> - Class in", "something</span></a> - Class in",
"something</span></a> - Enum in", "something</span></a> - Enum Class in",
"something</span></a> - Interface in", "something</span></a> - Interface in",
"something</span></a> - Annotation Type in", "something</span></a> - Annotation Interface in",
"something</a></span> - Variable in class", "something</a></span> - Variable in class",
"something()</a></span> - Constructor", "something()</a></span> - Constructor",
""" """

View file

@ -304,9 +304,9 @@ public class TestOverrideMethods extends JavadocTester {
<a href="pkg5/Classes.C.html#m7()">m7()</a>""", <a href="pkg5/Classes.C.html#m7()">m7()</a>""",
""" """
<a href="pkg5/Classes.GP.html#m7()">m7()</a>""", <a href="pkg5/Classes.GP.html#m7()">m7()</a>""",
"Returns the enum constant of this type with the specified name.", "Returns the enum constant of this class with the specified name.",
""" """
Returns an array containing the constants of this enum type, in Returns an array containing the constants of this enum class, in
the order they are declared.""" the order they are declared."""
); );

View file

@ -87,7 +87,7 @@ public class TestRecordLinks extends JavadocTester {
checkOutput("example/JavadocTest.Bar.html", true, checkOutput("example/JavadocTest.Bar.html", true,
""" """
<h1 title="Record JavadocTest.Bar" class="title">Record JavadocTest.Bar</h1> <h1 title="Record Class JavadocTest.Bar" class="title">Record Class JavadocTest.Bar</h1>
""", """,
""" """
<div class="block"><a href="#bar()"><code>bar()</code></a> <div class="block"><a href="#bar()"><code>bar()</code></a>

View file

@ -73,7 +73,7 @@ public class TestRecordTypes extends JavadocTester {
checkOutput("R.html", true, checkOutput("R.html", true,
""" """
<h1 title="Record R" class="title">Record R</h1>""", <h1 title="Record Class R" class="title">Record Class R</h1>""",
""" """
<span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""", <span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""",
""" """
@ -94,7 +94,7 @@ public class TestRecordTypes extends JavadocTester {
checkOutput("p/R.html", true, checkOutput("p/R.html", true,
""" """
<h1 title="Record R" class="title">Record R</h1>""", <h1 title="Record Class R" class="title">Record Class R</h1>""",
""" """
<span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""", <span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""",
""" """
@ -115,7 +115,7 @@ public class TestRecordTypes extends JavadocTester {
checkOutput("p/R.html", true, checkOutput("p/R.html", true,
""" """
<h1 title="Record R" class="title">Record R</h1>""", <h1 title="Record Class R" class="title">Record Class R</h1>""",
""" """
<span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""", <span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""",
""" """
@ -140,7 +140,7 @@ public class TestRecordTypes extends JavadocTester {
checkOutput("p/R.html", true, checkOutput("p/R.html", true,
""" """
<h1 title="Record R" class="title">Record R</h1>""", <h1 title="Record Class R" class="title">Record Class R</h1>""",
""" """
<span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""", <span class="modifiers">public record </span><span class="element-name type-name-label">R</span>""",
""" """
@ -171,7 +171,7 @@ public class TestRecordTypes extends JavadocTester {
checkOutput("p/R.html", true, checkOutput("p/R.html", true,
""" """
<h1 title="Record R" class="title">Record R&lt;T&gt;</h1>""", <h1 title="Record Class R" class="title">Record Class R&lt;T&gt;</h1>""",
""" """
<span class="modifiers">public record </span><span class="element-name type-name-label">R&lt;T&gt;</span>""", <span class="modifiers">public record </span><span class="element-name type-name-label">R&lt;T&gt;</span>""",
""" """
@ -208,7 +208,7 @@ public class TestRecordTypes extends JavadocTester {
""" """
<section class="constructor-summary" id="constructor.summary">""", <section class="constructor-summary" id="constructor.summary">""",
"<a href=\"#%3Cinit%3E(int)\">R</a>", "<a href=\"#%3Cinit%3E(int)\">R</a>",
"Creates an instance of a <code>R</code> record.", "Creates an instance of a <code>R</code> record class.",
""" """
<section class="method-summary" id="method.summary">""", <section class="method-summary" id="method.summary">""",
""" """
@ -223,12 +223,12 @@ public class TestRecordTypes extends JavadocTester {
Returns the value of the <a href="#param-r1"><code>r1</code></a> record component.""", Returns the value of the <a href="#param-r1"><code>r1</code></a> record component.""",
""" """
<a href="#toString()">toString</a>""", <a href="#toString()">toString</a>""",
"Returns a string representation of this record.", "Returns a string representation of this record class.",
"Method Details", "Method Details",
""" """
<span class="element-name">toString</span>""", <span class="element-name">toString</span>""",
"Returns a string representation of this record. The representation " "Returns a string representation of this record class. The representation "
+ "contains the name of the type, followed by the name and value of " + "contains the name of the class, followed by the name and value of "
+ "each of the record components.", + "each of the record components.",
""" """
<span class="element-name">hashCode</span>""", <span class="element-name">hashCode</span>""",
@ -239,7 +239,7 @@ public class TestRecordTypes extends JavadocTester {
""" """
Indicates whether some other object is "equal to" this one. The objects are equa\ Indicates whether some other object is "equal to" this one. The objects are equa\
l if the other object is of the same class and if all the record components are \ l if the other object is of the same class and if all the record components are \
equal. All components in this record are compared with '=='.""", equal. All components in this record class are compared with '=='.""",
""" """
<span class="element-name">r1</span>""", <span class="element-name">r1</span>""",
""" """
@ -271,7 +271,7 @@ public class TestRecordTypes extends JavadocTester {
""" """
<section class="constructor-summary" id="constructor.summary">""", <section class="constructor-summary" id="constructor.summary">""",
"<a href=\"#%3Cinit%3E(int)\">R</a>", "<a href=\"#%3Cinit%3E(int)\">R</a>",
"Creates an instance of a <code>R</code> record.", "Creates an instance of a <code>R</code> record class.",
""" """
<section class="method-summary" id="method.summary">""", <section class="method-summary" id="method.summary">""",
""" """
@ -286,12 +286,12 @@ public class TestRecordTypes extends JavadocTester {
Returns the value of the <a href="#param-r1"><code>r1</code></a> record component.""", Returns the value of the <a href="#param-r1"><code>r1</code></a> record component.""",
""" """
<a href="#toString()">toString</a>""", <a href="#toString()">toString</a>""",
"Returns a string representation of this record.", "Returns a string representation of this record class.",
"Method Details", "Method Details",
""" """
<span class="element-name">toString</span>""", <span class="element-name">toString</span>""",
"Returns a string representation of this record. The representation " "Returns a string representation of this record class. The representation "
+ "contains the name of the type, followed by the name and value of " + "contains the name of the class, followed by the name and value of "
+ "each of the record components.", + "each of the record components.",
""" """
<span class="element-name">hashCode</span>""", <span class="element-name">hashCode</span>""",
@ -302,7 +302,7 @@ public class TestRecordTypes extends JavadocTester {
""" """
Indicates whether some other object is "equal to" this one. The objects are equa\ Indicates whether some other object is "equal to" this one. The objects are equa\
l if the other object is of the same class and if all the record components are \ l if the other object is of the same class and if all the record components are \
equal. All components in this record are compared with '=='.""", equal. All components in this record class are compared with '=='.""",
""" """
<span class="element-name">r1</span>""", <span class="element-name">r1</span>""",
""" """
@ -313,13 +313,13 @@ public class TestRecordTypes extends JavadocTester {
@Test @Test
public void testGeneratedEqualsPrimitive(Path base) throws IOException { public void testGeneratedEqualsPrimitive(Path base) throws IOException {
testGeneratedEquals(base, "int a, int b", testGeneratedEquals(base, "int a, int b",
"All components in this record are compared with '=='."); "All components in this record class are compared with '=='.");
} }
@Test @Test
public void testGeneratedEqualsReference(Path base) throws IOException { public void testGeneratedEqualsReference(Path base) throws IOException {
testGeneratedEquals(base, "Object a, Object b", testGeneratedEquals(base, "Object a, Object b",
"All components in this record are compared with <code>Objects::equals(Object,Object)</code>"); "All components in this record class are compared with <code>Objects::equals(Object,Object)</code>");
} }
@Test @Test
@ -522,7 +522,7 @@ public class TestRecordTypes extends JavadocTester {
<div id="record.class"> <div id="record.class">
<div class="caption"><span>Record Classes</span></div> <div class="caption"><span>Record Classes</span></div>
<div class="summary-table two-column-summary"> <div class="summary-table two-column-summary">
<div class="table-header col-first">Record</div> <div class="table-header col-first">Record Class</div>
<div class="table-header col-last">Description</div> <div class="table-header col-last">Description</div>
<div class="col-deprecated-item-name even-row-color"><a href="p/R.html" title="class in p">p.R</a></div> <div class="col-deprecated-item-name even-row-color"><a href="p/R.html" title="class in p">p.R</a></div>
<div class="col-last even-row-color"> <div class="col-last even-row-color">

View file

@ -452,7 +452,7 @@ public class TestSearch extends JavadocTester {
""" """
<dt><span class="search-tag-link"><a href="pkg2/TestAnnotationType.html#searchph\ <dt><span class="search-tag-link"><a href="pkg2/TestAnnotationType.html#searchph\
rasewithdescdeprecated">search phrase with desc deprecated</a></span> - Search t\ rasewithdescdeprecated">search phrase with desc deprecated</a></span> - Search t\
ag in annotation type pkg2.TestAnnotationType</dt>""", ag in annotation interface pkg2.TestAnnotationType</dt>""",
""" """
<dt><span class="search-tag-link"><a href="pkg2/TestClass.html#SearchTagDeprecat\ <dt><span class="search-tag-link"><a href="pkg2/TestClass.html#SearchTagDeprecat\
edClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestClas\ edClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestClas\
@ -487,14 +487,14 @@ public class TestSearch extends JavadocTester {
/a></span> - Search tag in pkg.AnotherClass.CONSTANT1</dt>""", /a></span> - Search tag in pkg.AnotherClass.CONSTANT1</dt>""",
""" """
<dt><span class="member-name-link"><a href="pkg2/TestEnum.html#ONE">ONE</a></spa\ <dt><span class="member-name-link"><a href="pkg2/TestEnum.html#ONE">ONE</a></spa\
n> - Enum constant in enum pkg2.<a href="pkg2/TestEnum.html" title="enum in pkg2">TestEnum</a></dt>""", n> - Enum constant in enum class pkg2.<a href="pkg2/TestEnum.html" title="enum class in pkg2">TestEnum</a></dt>""",
""" """
<dt><span class="member-name-link"><a href="pkg2/TestEnum.html#THREE">THREE</a><\ <dt><span class="member-name-link"><a href="pkg2/TestEnum.html#THREE">THREE</a><\
/span> - Enum constant in enum pkg2.<a href="pkg2/TestEnum.html" title="enum in pkg2">TestEnum</a></dt\ /span> - Enum constant in enum class pkg2.<a href="pkg2/TestEnum.html" title="enum class in pkg2">TestEnum</a></dt\
>""", >""",
""" """
<dt><span class="member-name-link"><a href="pkg2/TestEnum.html#TWO">TWO</a></spa\ <dt><span class="member-name-link"><a href="pkg2/TestEnum.html#TWO">TWO</a></spa\
n> - Enum constant in enum pkg2.<a href="pkg2/TestEnum.html" title="enum in pkg2">TestEnum</a></dt>"""); n> - Enum constant in enum class pkg2.<a href="pkg2/TestEnum.html" title="enum class in pkg2">TestEnum</a></dt>""");
checkOutput("index-all.html", true, checkOutput("index-all.html", true,
""" """
<div class="deprecation-comment">class_test1 passes. Search tag <span id="Search\ <div class="deprecation-comment">class_test1 passes. Search tag <span id="Search\
@ -518,7 +518,7 @@ public class TestSearch extends JavadocTester {
""" """
<dt><span class="search-tag-link"><a href="../pkg2/TestAnnotationType.html#searc\ <dt><span class="search-tag-link"><a href="../pkg2/TestAnnotationType.html#searc\
hphrasewithdescdeprecated">search phrase with desc deprecated</a></span> - Searc\ hphrasewithdescdeprecated">search phrase with desc deprecated</a></span> - Searc\
h tag in annotation type pkg2.TestAnnotationType</dt>""", h tag in annotation interface pkg2.TestAnnotationType</dt>""",
""" """
<dt><span class="search-tag-link"><a href="../pkg2/TestClass.html#SearchTagDepre\ <dt><span class="search-tag-link"><a href="../pkg2/TestClass.html#SearchTagDepre\
catedClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestC\ catedClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestC\
@ -575,16 +575,16 @@ public class TestSearch extends JavadocTester {
checkOutput("index-files/index-9.html", true, checkOutput("index-files/index-9.html", true,
""" """
<dt><span class="member-name-link"><a href="../pkg2/TestEnum.html#ONE">ONE</a></\ <dt><span class="member-name-link"><a href="../pkg2/TestEnum.html#ONE">ONE</a></\
span> - Enum constant in enum pkg2.<a href="../pkg2/TestEnum.html" title="enum in pkg2">TestEnum</a></\ span> - Enum constant in enum class pkg2.<a href="../pkg2/TestEnum.html" title="enum class in pkg2">TestEnum</a></\
dt>"""); dt>""");
checkOutput("index-files/index-14.html", true, checkOutput("index-files/index-14.html", true,
""" """
<dt><span class="member-name-link"><a href="../pkg2/TestEnum.html#THREE">THREE</\ <dt><span class="member-name-link"><a href="../pkg2/TestEnum.html#THREE">THREE</\
a></span> - Enum constant in enum pkg2.<a href="../pkg2/TestEnum.html" title="enum in pkg2">TestEnum</\ a></span> - Enum constant in enum class pkg2.<a href="../pkg2/TestEnum.html" title="enum class in pkg2">TestEnum</\
a></dt>""", a></dt>""",
""" """
<dt><span class="member-name-link"><a href="../pkg2/TestEnum.html#TWO">TWO</a></\ <dt><span class="member-name-link"><a href="../pkg2/TestEnum.html#TWO">TWO</a></\
span> - Enum constant in enum pkg2.<a href="../pkg2/TestEnum.html" title="enum in pkg2">TestEnum</a></\ span> - Enum constant in enum class pkg2.<a href="../pkg2/TestEnum.html" title="enum class in pkg2">TestEnum</a></\
dt>"""); dt>""");
} }
@ -611,7 +611,7 @@ public class TestSearch extends JavadocTester {
""" """
<dt><span class="search-tag-link"><a href="pkg2/TestAnnotationType.html#searchph\ <dt><span class="search-tag-link"><a href="pkg2/TestAnnotationType.html#searchph\
rasewithdescdeprecated">search phrase with desc deprecated</a></span> - Search t\ rasewithdescdeprecated">search phrase with desc deprecated</a></span> - Search t\
ag in annotation type pkg2.TestAnnotationType</dt>""", ag in annotation interface pkg2.TestAnnotationType</dt>""",
""" """
<dt><span class="search-tag-link"><a href="pkg2/TestClass.html#SearchTagDeprecat\ <dt><span class="search-tag-link"><a href="pkg2/TestClass.html#SearchTagDeprecat\
edClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestClas\ edClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestClas\
@ -655,7 +655,7 @@ public class TestSearch extends JavadocTester {
""" """
<dt><span class="search-tag-link"><a href="pkg2/TestAnnotationType.html#searchph\ <dt><span class="search-tag-link"><a href="pkg2/TestAnnotationType.html#searchph\
rasewithdescdeprecated">search phrase with desc deprecated</a></span> - Search t\ rasewithdescdeprecated">search phrase with desc deprecated</a></span> - Search t\
ag in annotation type pkg2.TestAnnotationType</dt>""", ag in annotation interface pkg2.TestAnnotationType</dt>""",
""" """
<dt><span class="search-tag-link"><a href="pkg2/TestClass.html#SearchTagDeprecat\ <dt><span class="search-tag-link"><a href="pkg2/TestClass.html#SearchTagDeprecat\
edClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestClas\ edClass">SearchTagDeprecatedClass</a></span> - Search tag in class pkg2.TestClas\
@ -833,7 +833,7 @@ public class TestSearch extends JavadocTester {
<button id="all-classes-table-tab3" role="tab" aria-selected="false" aria-contro\ <button id="all-classes-table-tab3" role="tab" aria-selected="false" aria-contro\
ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\ ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
ck="show('all-classes-table', 'all-classes-table-tab3', 2)" class="table-tab">En\ ck="show('all-classes-table', 'all-classes-table-tab3', 2)" class="table-tab">En\
um Summary</button>\ um Class Summary</button>\
<button id="all-classes-table-tab4" role="tab" aria-selected="false" aria-contro\ <button id="all-classes-table-tab4" role="tab" aria-selected="false" aria-contro\
ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\ ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
ck="show('all-classes-table', 'all-classes-table-tab4', 2)" class="table-tab">Ex\ ck="show('all-classes-table', 'all-classes-table-tab4', 2)" class="table-tab">Ex\
@ -845,7 +845,7 @@ public class TestSearch extends JavadocTester {
<button id="all-classes-table-tab6" role="tab" aria-selected="false" aria-contro\ <button id="all-classes-table-tab6" role="tab" aria-selected="false" aria-contro\
ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\ ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
ck="show('all-classes-table', 'all-classes-table-tab6', 2)" class="table-tab">An\ ck="show('all-classes-table', 'all-classes-table-tab6', 2)" class="table-tab">An\
notation Types Summary</button>\ notation Interfaces Summary</button>\
</div> </div>
<div id="all-classes-table.tabpanel" role="tabpanel"> <div id="all-classes-table.tabpanel" role="tabpanel">
<div class="summary-table two-column-summary" aria-labelledby="all-classes-table-tab0"> <div class="summary-table two-column-summary" aria-labelledby="all-classes-table-tab0">

View file

@ -63,7 +63,7 @@ public class TestSystemPropertyTaglet extends JavadocTester {
checkOrder("mymodule/mypackage/MyAnnotation.html", checkOrder("mymodule/mypackage/MyAnnotation.html",
""" """
<h1 title="Annotation Type MyAnnotation" class="title">Annotation Type MyAnnotation</h1>""", <h1 title="Annotation Interface MyAnnotation" class="title">Annotation Interface MyAnnotation</h1>""",
""" """
(annotation) the <code><span id="test.property" class="search-tag-result">test.property</span></code> system property.""", (annotation) the <code><span id="test.property" class="search-tag-result">test.property</span></code> system property.""",
"<h2>Element Details</h2>", "<h2>Element Details</h2>",
@ -99,7 +99,7 @@ public class TestSystemPropertyTaglet extends JavadocTester {
checkOrder("mymodule/mypackage/MyEnum.html", checkOrder("mymodule/mypackage/MyEnum.html",
""" """
<h1 title="Enum MyEnum" class="title">Enum MyEnum</h1>""", <h1 title="Enum Class MyEnum" class="title">Enum Class MyEnum</h1>""",
""" """
(enum) the <code><span id="test.property" class="search-tag-result">test.property</span></code> system property.""", (enum) the <code><span id="test.property" class="search-tag-result">test.property</span></code> system property.""",
"<h2>Enum Constant Details</h2>", "<h2>Enum Constant Details</h2>",
@ -166,7 +166,7 @@ public class TestSystemPropertyTaglet extends JavadocTester {
<h2 class="title" id="I:T">T</h2>""", <h2 class="title" id="I:T">T</h2>""",
""" """
<dt><span class="search-tag-link"><a href="mymodule/mypackage/MyAnnotation.html#\ <dt><span class="search-tag-link"><a href="mymodule/mypackage/MyAnnotation.html#\
test.property">test.property</a></span> - Search tag in annotation type mypackag\ test.property">test.property</a></span> - Search tag in annotation interface mypackag\
e.MyAnnotation</dt> e.MyAnnotation</dt>
<dd>System Property</dd>""", <dd>System Property</dd>""",
""" """
@ -175,7 +175,7 @@ public class TestSystemPropertyTaglet extends JavadocTester {
<dd>System Property</dd>""", <dd>System Property</dd>""",
""" """
<dt><span class="search-tag-link"><a href="mymodule/mypackage/MyEnum.html#test.p\ <dt><span class="search-tag-link"><a href="mymodule/mypackage/MyEnum.html#test.p\
roperty">test.property</a></span> - Search tag in enum mypackage.MyEnum</dt> roperty">test.property</a></span> - Search tag in enum class mypackage.MyEnum</dt>
<dd>System Property</dd>""", <dd>System Property</dd>""",
""" """
<dt><span class="search-tag-link"><a href="mymodule/mypackage/MyError.html#test.\ <dt><span class="search-tag-link"><a href="mymodule/mypackage/MyError.html#test.\
@ -267,13 +267,13 @@ public class TestSystemPropertyTaglet extends JavadocTester {
checkOutput("tag-search-index.js", true, checkOutput("tag-search-index.js", true,
""" """
{"l":"test.property","h":"annotation type mypackage.MyAnnotation","d":"System Pr\ {"l":"test.property","h":"annotation interface mypackage.MyAnnotation","d":"System Pr\
operty","u":"mymodule/mypackage/MyAnnotation.html#test.property"}""", operty","u":"mymodule/mypackage/MyAnnotation.html#test.property"}""",
""" """
{"l":"test.property","h":"class mypackage.MyClass","d":"System Property","u":"my\ {"l":"test.property","h":"class mypackage.MyClass","d":"System Property","u":"my\
module/mypackage/MyClass.html#test.property"}""", module/mypackage/MyClass.html#test.property"}""",
""" """
{"l":"test.property","h":"enum mypackage.MyEnum","d":"System Property","u":"mymo\ {"l":"test.property","h":"enum class mypackage.MyEnum","d":"System Property","u":"mymo\
dule/mypackage/MyEnum.html#test.property"}""", dule/mypackage/MyEnum.html#test.property"}""",
""" """
{"l":"test.property","h":"error mypackage.MyError","d":"System Property","u":"my\ {"l":"test.property","h":"error mypackage.MyError","d":"System Property","u":"my\

View file

@ -0,0 +1,157 @@
/*
* Copyright (c) 2020, 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.
*/
/*
* @test
* @bug 8258002
* @summary Update "type" terminology in generated docs
* @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
* @build toolbox.ToolBox javadoc.tester.*
* @run main TestTerminology
*/
import java.io.IOException;
import java.nio.file.Path;
import javax.lang.model.SourceVersion;
import javadoc.tester.JavadocTester;
import toolbox.ToolBox;
public class TestTerminology extends JavadocTester {
public static void main(String... args) throws Exception {
TestTerminology tester = new TestTerminology();
tester.runTests(m -> new Object[]{Path.of(m.getName())});
}
private final ToolBox tb = new ToolBox();
@Test
public void testAnnotationInterface(Path base) throws IOException {
Path src = base.resolve("src");
tb.writeJavaFiles(src,
"""
package p; /** Comment. */ public @interface A {
int m();
}
"""
);
testAnnotationInterface(base, src, SourceVersion.RELEASE_15);
testAnnotationInterface(base, src, SourceVersion.latest());
}
void testAnnotationInterface(Path base, Path src, SourceVersion sv) {
String v = asOption(sv);
javadoc("-d", base.resolve("out" + v).toString(),
"--source-path", src.toString(),
"--source", v,
"-use",
"p");
checkExit(Exit.OK);
checkOutput("p/A.html", sv.compareTo(SourceVersion.RELEASE_16) < 0,
"""
<h1 title="Annotation Type A" class="title">Annotation Type A</h1>"""
);
checkOutput("p/A.html", sv.compareTo(SourceVersion.RELEASE_16) >= 0,
"""
<h1 title="Annotation Interface A" class="title">Annotation Interface A</h1>"""
);
checkOutput("p/class-use/A.html", sv.compareTo(SourceVersion.RELEASE_16) < 0,
"""
<h1 title="Uses of Annotation Type p.A" class="title">Uses of Annotation Type<br>p.A</h1>"""
);
checkOutput("p/class-use/A.html", sv.compareTo(SourceVersion.RELEASE_16) >= 0,
"""
<h1 title="Uses of Annotation Interface p.A" class="title">Uses of Annotation Interface<br>p.A</h1>"""
);
}
@Test
public void testEnumClass(Path base) throws IOException {
Path src = base.resolve("src");
tb.writeJavaFiles(src,
"""
package p; /** Comment. */ public enum E { }
"""
);
testEnumClass(base, src, SourceVersion.RELEASE_15);
testEnumClass(base, src, SourceVersion.latest());
}
void testEnumClass(Path base, Path src, SourceVersion sv) {
String v = asOption(sv);
javadoc("-d", base.resolve("out" + v).toString(),
"--source-path", src.toString(),
"--source", v,
"p");
checkExit(Exit.OK);
checkOutput("p/E.html", sv.compareTo(SourceVersion.RELEASE_16) < 0,
"""
<h1 title="Enum E" class="title">Enum E</h1>"""
);
checkOutput("p/E.html", sv.compareTo(SourceVersion.RELEASE_16) >= 0,
"""
<h1 title="Enum Class E" class="title">Enum Class E</h1>"""
);
}
@Test
public void testSearch(Path base) throws IOException {
Path src = base.resolve("src");
tb.writeJavaFiles(src,
"""
package p; /** Comment. */ public class C { }
"""
);
testSearch(base, src, SourceVersion.RELEASE_15);
testSearch(base, src, SourceVersion.latest());
}
public void testSearch(Path base, Path src, SourceVersion sv) {
String v = asOption(sv);
javadoc("-d", base.resolve("out" + v).toString(),
"--source-path", src.toString(),
"--source", v,
"p");
checkExit(Exit.OK);
checkOutput("search.js", sv.compareTo(SourceVersion.RELEASE_16) < 0,
"""
var catTypes = "Types";""" //
);
checkOutput("search.js", sv.compareTo(SourceVersion.RELEASE_16) >= 0,
"""
var catTypes = "Classes and Interfaces";"""
);
}
private String asOption(SourceVersion sv) {
return sv.name().replace("RELEASE_", "");
}
}

View file

@ -216,7 +216,7 @@ public class CheckResourceKeys {
// special handling for code strings synthesized in // special handling for code strings synthesized in
// jdk.javadoc.internal.doclets.toolkit.util.Utils.getTypeName // jdk.javadoc.internal.doclets.toolkit.util.Utils.getTypeName
String[] extras = { String[] extras = {
"AnnotationType", "Class", "Enum", "Error", "Exception", "Interface", "Record" "AnnotationType", "Class", "Enum", "EnumClass", "Error", "Exception", "Interface", "RecordClass"
}; };
for (String s: extras) { for (String s: extras) {
if (results.contains("doclet." + s)) if (results.contains("doclet." + s))