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

4847239: (spec) File.createTempFile() should make it clear that it doesn't create the temporary directory #4561

Closed
wants to merge 5 commits into from

Conversation

bplb
Copy link
Member

@bplb bplb commented Jun 23, 2021

Augment the specification of java.io.File.createTempFile(String,String,File) to clarify its behavior with respect to the File parameter directory.


Progress

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

Issue

  • JDK-4847239: (spec) File.createTempFile() should make it clear that it doesn't create the temporary directory

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4561

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 23, 2021

👋 Welcome back bpb! 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 Jun 23, 2021
@openjdk
Copy link

openjdk bot commented Jun 23, 2021

@bplb The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Jun 23, 2021
@bplb
Copy link
Member Author

bplb commented Jun 23, 2021

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jun 23, 2021
@openjdk
Copy link

openjdk bot commented Jun 23, 2021

@bplb has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@bplb please create a CSR request for issue JDK-4847239. This pull request cannot be integrated until the CSR request is approved.

@mlbridge
Copy link

mlbridge bot commented Jun 23, 2021

Webrevs

Copy link
Member

@naotoj naotoj 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. Do we have a test case that verifies the behavior?

@bplb
Copy link
Member Author

bplb commented Jun 23, 2021

Surprisingly it does not look like there is a verifying test. I checked it manually but I had better add a specific test.

@bplb
Copy link
Member Author

bplb commented Jun 23, 2021

Test added.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Jun 24, 2021
Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

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

Thanks for adding the test. Some nits follow.

test/jdk/java/io/File/createTempFile/TargetDirectory.java Outdated Show resolved Hide resolved
test/jdk/java/io/File/createTempFile/TargetDirectory.java Outdated Show resolved Hide resolved
@mlbridge
Copy link

mlbridge bot commented Jun 24, 2021

Mailing list message from Brian Burkhalter on core-libs-dev:

On Jun 24, 2021, at 3:29 AM, Lance Andersen <lancea at openjdk.java.net<mailto:lancea at openjdk.java.net>> wrote:

src/java.base/share/classes/java/io/File.java line 2116:

2114: * abstract pathname is valid and denotes an existing directory, then the
2115: * file will be created in that directory; otherwise, the file will not
2116: * be created and an {@code IOException} will be thrown. In no case will

I might suggest reworking the 1st sentence as it is a tad long and we could probably reduce the 'then' usages.

Maybe instead of "In no case..." change to "Under no circumstances ...."

Good points, Lance. I updated the verbiage.

Should it also indicate an IOException will be thrown if the directory does not exist?

I think that this is implicit in the second sentence of the revised version.

1 similar comment
@mlbridge
Copy link

mlbridge bot commented Jun 24, 2021

Mailing list message from Brian Burkhalter on core-libs-dev:

On Jun 24, 2021, at 3:29 AM, Lance Andersen <lancea at openjdk.java.net<mailto:lancea at openjdk.java.net>> wrote:

src/java.base/share/classes/java/io/File.java line 2116:

2114: * abstract pathname is valid and denotes an existing directory, then the
2115: * file will be created in that directory; otherwise, the file will not
2116: * be created and an {@code IOException} will be thrown. In no case will

I might suggest reworking the 1st sentence as it is a tad long and we could probably reduce the 'then' usages.

Maybe instead of "In no case..." change to "Under no circumstances ...."

Good points, Lance. I updated the verbiage.

Should it also indicate an IOException will be thrown if the directory does not exist?

I think that this is implicit in the second sentence of the revised version.

@bplb bplb force-pushed the File-createTempFile-4847239 branch from 0cd7310 to c8ef119 Compare June 24, 2021 18:29
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 24, 2021
@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Jun 25, 2021
@openjdk
Copy link

openjdk bot commented Jun 25, 2021

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

4847239: (spec) File.createTempFile() should make it clear that it doesn't create the temporary directory

Reviewed-by: naoto, lancea

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

  • 35c4702: 8268967: Update java.security to use switch expressions
  • b565459: 8267138: Stray suffix when starting gtests via GTestWrapper.java
  • 1d16797: 8268469: Update java.time to use switch expressions
  • ffa34ed: 8265919: RunThese30M fails "assert((!(((((JfrTraceIdBits::load(value)) & ((1 << 4) << 8)) != 0))))) failed: invariant"
  • fdcae66: 8269092: Add OldObjectSampleEvent.allocationSize field
  • fd43d9c: 8269225: JFR.stop misses the written info when the filename is only specified by JFR.start
  • 3a8f3d6: 8269280: (bf) Replace StringBuffer in *Buffer.toString()
  • c37988d: 8268276: Base64 Decoding optimization for x86 using AVX-512
  • 08ee7ae: 8268855: Cleanup name handling in the Thread class and subclasses
  • c79034e: 8269303: Remove unnecessary forward declaration of PSPromotionManager in cpCache.hpp
  • ... and 43 more: https://git.openjdk.java.net/jdk/compare/cd20c01942dd8559a31e51ef2a595c6eba44b8ad...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 Jun 25, 2021
@bplb
Copy link
Member Author

bplb commented Jun 25, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Jun 25, 2021

Going to push as commit 68ef21d.
Since your change was applied there have been 55 commits pushed to the master branch:

  • 3fae4b3: 6633375: FileOutputStream_md.c should be merged into FileOutputStream.c
  • 223759f: 8266901: Clarify the method description of Duration.toDaysPart()
  • 35c4702: 8268967: Update java.security to use switch expressions
  • b565459: 8267138: Stray suffix when starting gtests via GTestWrapper.java
  • 1d16797: 8268469: Update java.time to use switch expressions
  • ffa34ed: 8265919: RunThese30M fails "assert((!(((((JfrTraceIdBits::load(value)) & ((1 << 4) << 8)) != 0))))) failed: invariant"
  • fdcae66: 8269092: Add OldObjectSampleEvent.allocationSize field
  • fd43d9c: 8269225: JFR.stop misses the written info when the filename is only specified by JFR.start
  • 3a8f3d6: 8269280: (bf) Replace StringBuffer in *Buffer.toString()
  • c37988d: 8268276: Base64 Decoding optimization for x86 using AVX-512
  • ... and 45 more: https://git.openjdk.java.net/jdk/compare/cd20c01942dd8559a31e51ef2a595c6eba44b8ad...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 25, 2021

@bplb Pushed as commit 68ef21d.

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

@bplb bplb deleted the File-createTempFile-4847239 branch June 25, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants