-
Notifications
You must be signed in to change notification settings - Fork 77
JDK-8258002: Update "type" terminology in generated docs #20
Conversation
👋 Welcome back jjg! A progress list of the required criteria for merging this PR into |
@jonathan-gibbons The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, Jon.
@@ -25,6 +25,7 @@ | |||
|
|||
package jdk.javadoc.internal.doclets.formats.html; | |||
|
|||
import javax.lang.model.SourceVersion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import
@@ -181,7 +183,7 @@ public HtmlConfiguration(Doclet doclet, Locale locale, Reporter reporter) { | |||
} | |||
|
|||
messages = new Messages(this, msgResources); | |||
contents = new Contents(this); | |||
//contents = new Contents(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed instead of commented out
Function<String, String> resourceKeyMapper) { | ||
super.initConfiguration(docEnv, resourceKeyMapper); | ||
contents = new Contents(this); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish initialization of the configuration instance was not that complex... I guess the reason we must do it this way is that used SourceVersion is not known earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that initializing the configuration is overly complex. At least in part, it's because of an earlier desire to use final fields where possible, when using direct access. And yes, the problem here is that the SourceVersion
is not known until init
is called.
// """ | ||
// var catTypes = "Classes and Interfaces";""" | ||
// ); | ||
// awaits JDK-8247994: localize JavaScript search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be working now :)
@jonathan-gibbons This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
/integrate |
@jonathan-gibbons Pushed as commit c04c7e1. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is the work to update javadoc to use certain terminology dependent on the source version in use.
The groups of terms being changed are:
Types
toClasses and Interfaces
Annotation Type
toAnnotation Interface
Enum
toEnum Class
The new terminology will be used when the source version of the elements being documented is 16 or higher. This is the default behavior. The corollary is that the old terminology will be used when the
--source
or--release
option is used to specify a version less than16
.In addition, the terminology for
Record
is being unconditionally changed to useRecord Class
. Since the feature was in preview before this release, there is no need to be able to generate the previous form.Also, in the course of this work, it was noted that on the "Use" page for an annotation type/interface, it was incorrectly classified as a class, instead of annotation interface: that has been fixed.
Fundamentally, the change is managed at a very low level, by passing a mapping function into
Resource.getText
. This allows high level code,HtmlDoclet
in this case, to provide version-specific overrides of the resource key to be used. The avoids having to have version-specific checks at the point of use for each affected resource.Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk16 pull/20/head:pull/20
$ git checkout pull/20