Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

JDK-8258002: Update "type" terminology in generated docs #20

Closed

Conversation

jonathan-gibbons
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons commented Dec 15, 2020

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 to Classes and Interfaces
  • Annotation Type to Annotation Interface
  • Enum to Enum 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 than 16.

In addition, the terminology for Record is being unconditionally changed to use Record 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

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8258002: Update "type" terminology in generated docs

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/20/head:pull/20
$ git checkout pull/20

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 15, 2020

👋 Welcome back jjg! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 15, 2020

@jonathan-gibbons The following label will be automatically applied to this pull request:

  • javadoc

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.

@openjdk openjdk bot added the javadoc javadoc-dev@openjdk.java.net label Dec 15, 2020
@jonathan-gibbons jonathan-gibbons marked this pull request as draft December 15, 2020 01:44
@openjdk openjdk bot added rfr Pull request is ready for review and removed rfr Pull request is ready for review labels Dec 15, 2020
@jonathan-gibbons jonathan-gibbons marked this pull request as ready for review December 15, 2020 15:52
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 15, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 15, 2020

Webrevs

Copy link
Member

@hns hns left a 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;
Copy link
Member

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);
Copy link
Member

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);
}
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be working now :)

@openjdk
Copy link

openjdk bot commented Dec 18, 2020

@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:

8258002: Update "type" terminology in generated docs

Reviewed-by: hannesw

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 master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 18, 2020
@jonathan-gibbons
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Dec 18, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 18, 2020
@openjdk
Copy link

openjdk bot commented Dec 18, 2020

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integrated Pull request has been integrated javadoc javadoc-dev@openjdk.java.net
Development

Successfully merging this pull request may close these issues.

2 participants