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-8274172: Convert JavadocTester to use NIO #5644

Conversation

jonathan-gibbons
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons commented Sep 23, 2021

Please review a moderately simple update to convert JavadocTester to just use NIO, instead of a mix of File and NIO.

The original code used java.io.File. At some point (JDK 9-ish) new code was added that used NIO, resulting in a mix. This change converts the old code to use NIO as well.

This is mostly internal, with two changes that affect tests.

  1. The protected field outputDir is changed from a File to a Path. Some tests use outputDir directly, typically to convert it to a Path.
  2. The copyDir method had a strange spec. Partly, it used "target" to describe the directory being copied, but worse, it copied the entire source directory INTO the destination directory, as compared to copying the contents. The method was just used in a single test, so I've changed the spec of the method and the use in the test. This cleaned up a "TODO" as well, to use Files.walkFileTree for the copy.

Progress

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

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5644/head:pull/5644
$ git checkout pull/5644

Update a local copy of the PR:
$ git checkout pull/5644
$ git pull https://git.openjdk.java.net/jdk pull/5644/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5644

View PR using the GUI difftool:
$ git pr show -t 5644

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5644.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 23, 2021

👋 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 openjdk bot added the rfr Pull request is ready for review label Sep 23, 2021
@openjdk
Copy link

openjdk bot commented Sep 23, 2021

@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.org label Sep 23, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 23, 2021

Webrevs

Move `JavadocTester.copyDir` to `ToolBox`; use FileVisitor code
Copy link
Member

@pavelrappo pavelrappo left a comment

Choose a reason for hiding this comment

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

Jon, thanks for modernizing JavadocTester! Before you read my suggestions, please consider this. I see a review as an opportunity to learn and improve, not just to mold a PR into a mainline commit.

In this particular case, I want to figure out the right way of copying a file tree. Why? Because I see opportunities of reusing this code in javadoc. For example, we have similar functionality in DocFilesHandlerImpl.copyDirectory. Why not spend extra time to figure out, if only a javadoc-internal, reference way of copying file trees?

Copy link
Member

@pavelrappo pavelrappo left a comment

Choose a reason for hiding this comment

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

Reviewed on the condition that you won't push it with

Files.createDirectories(toDir.toAbsolutePath().getParent())

as you suggested earlier.

@openjdk
Copy link

openjdk bot commented Sep 27, 2021

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

8274172: Convert JavadocTester to use NIO

Reviewed-by: prappo

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

  • 7436a77: 8274317: Unnecessary reentrant synchronized block in java.awt.Cursor
  • 7426fd4: 8274325: C4819 warning at vm_version_x86.cpp on Windows after JDK-8234160
  • e3aff8f: 8274289: jdk/jfr/api/consumer/TestRecordedFrameType.java failed with "RuntimeException: assertNotEquals: expected Interpreted to not equal Interpreted"
  • 252aaa9: 8274293: Build failure on macOS with Xcode 13.0 as vfork is deprecated
  • 7700b25: 8273401: Disable JarIndex support in URLClassPath
  • 5ec1cdc: 8274321: Standardize values of @SInCE tags in javax.lang.model
  • 4838a2c: 8274143: Disable "invalid entry for security.provider.X" error message in log file when security.provider.X is empty
  • ab28db1: 8274312: ProblemList 2 serviceability/dcmd/gc tests with ZGC on macos-all
  • 8c122af: 8274314: Typo in WatchService#poll(long timeout, TimeUnit unit) javadoc
  • 9bc865d: 8273960: Redundant condition in Metadata.TypeComparator.compare
  • ... and 6 more: https://git.openjdk.java.net/jdk/compare/0c050be64b7db297126c4dca6c7ebfc9f386b9db...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 Sep 27, 2021
@jonathan-gibbons
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 28, 2021

Going to push as commit 5b0c9cc.
Since your change was applied there have been 48 commits pushed to the master branch:

  • 2657bcb: 8274136: -XX:+ExitOnOutOfMemoryError calls exit while threads are running
  • 53b25bc: 8273459: Update code segment alignment to 64 bytes
  • 1a29b1e: 8274016: Replace 'for' cycles with iterator with enhanced-for in java.desktop
  • d8a278f: 8274396: Suppress more warnings on non-serializable non-transient instance fields in client libs
  • e49e5b5: 8273972: Multi-core choke point in CMM engine (LCMSTransform.doTransform)
  • 2072bc7: 8274391: Suppress more warnings on non-serializable non-transient instance fields in java.util.concurrent
  • 6a477bd: 8274415: Suppress warnings on non-serializable non-transient instance fields in java.xml
  • 67e52a3: 8273634: [TEST_BUG] Improve javax/swing/text/ParagraphView/6364882/bug6364882.java
  • b7425b6: 8239502: [TEST_BUG] Test javax/swing/text/FlowView/6318524/bug6318524.java never fails
  • c57a6c6: 8274265: Suspicious string concatenation in logTestUtils.inline.hpp
  • ... and 38 more: https://git.openjdk.java.net/jdk/compare/0c050be64b7db297126c4dca6c7ebfc9f386b9db...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 28, 2021

@jonathan-gibbons Pushed as commit 5b0c9cc.

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

@jonathan-gibbons jonathan-gibbons deleted the 8274172.javadoctester-nio branch November 18, 2022 19:06
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
Development

Successfully merging this pull request may close these issues.

2 participants