Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8260223: Handling of unnamed package in javadoc pages #2648

Closed
wants to merge 1 commit into from

Conversation

hns
Copy link
Member

@hns hns commented Feb 19, 2021

This replaces the unlocalized <Unnamed> string with a localized string resource in API docs covering code in the unnamed package. The name used in the default locale is "Unnamed Package". The old <Unnamed> token is still used as an internal placeholder, for example in Extern.java and in the search index files.

Previously, we had two distinct getPackageName(PackageElement) methods, one in HtmlDocletWriter returning a Content object and one in Utils returning a String. The former is now changed to return the localized content resource. To disambiguate it from the latter, it is renamed to getLocalizedPackageName. I also added reciprocal references to the doc comments in both methods.

A few minor notes on changes that may not be obvious:

  • In the package and module summary pages, I replaced the &nbsp; in the heading with an ordinary space character as the full content of the <h1> element now also appears in its title attribute, where entities are not supported.
  • I added an extra set of source files to test Use pages in TestUnnamedPackage as the existing sources contained an illegal Java file, causing PackageUseWriter to fail.

Progress

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

Issue

  • JDK-8260223: Handling of unnamed package in javadoc pages

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2648/head:pull/2648
$ git checkout pull/2648

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 19, 2021

👋 Welcome back hannesw! 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 openjdk bot added the rfr Pull request is ready for review label Feb 19, 2021
@openjdk
Copy link

openjdk bot commented Feb 19, 2021

@hns 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.org label Feb 19, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 19, 2021

Webrevs

Copy link
Contributor

@jonathan-gibbons jonathan-gibbons left a comment

Well, that was more pervasive than expected!

Nice work.

@@ -50,7 +50,6 @@
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.Navigation.PageMode;
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Feb 22, 2021

Choose a reason for hiding this comment

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

Yay, always glad to see use of RawHtml reduced!

moduleHead.add(mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL)
? contents.openModuleLabel : contents.moduleLabel);
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Feb 22, 2021

Choose a reason for hiding this comment

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

Nothing wrong here, but this is a good place to comment on the difference between "labels" (which should be localized) and keywords (which should not). I think we're getting to a better place where keywords only appear in signature block, and maybe other limited places.

@openjdk
Copy link

openjdk bot commented Feb 22, 2021

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

8260223: Handling of unnamed package in javadoc pages

Reviewed-by: jjg

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 34 new commits pushed to the master branch:

  • cf0019d: 8259942: Enable customizations in CompileJavaModules.gmk and Main.gmk
  • a6a7e43: 8242032: G1 region remembered sets may contain non-coarse level PRTs for already coarsened regions
  • d7eebda: 8261391: ZGC crash - SEGV in RevokeOneBias::do_thread
  • 5b7b18c: 8259800: timeout in tck test testForkJoin(ForkJoinPool8Test)
  • 419717d: 8261803: Remove unused TaskTerminator in g1 full gc ref proc executor
  • 011f5a5: 8261799: Remove unnecessary cast in psParallelCompact.hpp
  • e9d7c07: 8248318: Remove superfluous use of boxing in ObjectStreamClass
  • 6b7575b: 8228748: Remove GCLocker::_doing_gc
  • c20fb5d: 8261448: Preserve GC stack watermark across safepoints in StackWalk
  • 26c1db9: 8254239: G1ConcurrentMark.hpp unnecessarily disables MSVC++ warning 4522.
  • ... and 24 more: https://git.openjdk.java.net/jdk/compare/7e2c909ee1b217601e07b1bc32638acb2d3fab85...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this 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 Feb 22, 2021
@hns
Copy link
Member Author

hns commented Feb 23, 2021

/integrate

@openjdk openjdk bot closed this Feb 23, 2021
@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 Feb 23, 2021
@openjdk
Copy link

openjdk bot commented Feb 23, 2021

@hns Since your change was applied there have been 44 commits pushed to the master branch:

  • 8cfea7c: 8261921: ClassListParser::current should be used only by main thread
  • 991f7c1: 8210373: Deadlock in libj2gss.so when loading "j2gss" and "net" libraries in parallel.
  • 0217d69: 8261975: Missing "classpath exception" in VectorSupport.java
  • f2bde05: 8262097: Improve CompilerConfig ergonomics to fix a VM crash after JDK-8261229
  • aea474c: 8261269: When using clhsdb to "inspect" a java object, clhsdb prints "Oop for..." twice
  • a7e2e80: 8260695: The java.awt.color.ICC_Profile#getData/getData(int) are not thread safe
  • a30fb4f: 8255867: SignatureScheme JSSE property does not preserve ordering in handshake messages
  • a867288: 8211227: Inconsistent TLS protocol version in debug output
  • 7b924d8: 8261973: Shenandoah: Cleanup/simplify root verifier
  • 63f8fc8: 8259662: Don't wrap SocketExceptions into SSLExceptions in SSLSocketImpl
  • ... and 34 more: https://git.openjdk.java.net/jdk/compare/7e2c909ee1b217601e07b1bc32638acb2d3fab85...master

Your commit was automatically rebased without conflicts.

Pushed as commit a5c4b9a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated javadoc javadoc-dev@openjdk.org
2 participants