-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8371689: (fs) CopyMoveHelper.copyToForeignTarget use of sourcePosixView is confusing #28304
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
Conversation
|
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
|
@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: 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 61 new commits pushed to the
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 |
Webrevs
|
| FileSystemProvider provider = source.getFileSystem().provider(); | ||
|
|
||
| // retrieve whether source posix view is supported | ||
| FileStore fileStore = provider.getFileStore(source); |
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'm concerned this will add overhead to each copy operation. There shouldn't be any need to use FileStore in this method. If the provider supports the the POSIX view then this method can use it.
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.
So I think the summary is the JBS issue isn't really a bug, it's more than using sourcePosixView instead of boolean is confusing when looking at this code.
Removed in commit bebf4a5. |
|
|
||
| // retrieve source posix view, null if unsupported | ||
| final PosixFileAttributeView sourcePosixView = | ||
| Files.getFileAttributeView(source, PosixFileAttributeView.class); |
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 don't think we should delete this. Instead, I think we can initialize sourceSupportsPosixAttributes with Files.getFileAttributeView(source, PosixFileAttributeView.class) != null.
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 don't think we should delete this
So changed in ad29084.
| PosixFileAttributes.class, | ||
| linkOptions); | ||
| } | ||
| if (sourceAttrs == null) |
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.
This could if-then-else too.
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.
This could if-then-else too.
Since if the posix view is supported, then sourceAttrs could not be null here, correct?
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.
Right, but it can be simplified to if (sourceSupportsPosixAttributes) { .. } else { ..}. What you have is okay too.
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.
it can be simplified
So changed in e76d298.
AlanBateman
left a comment
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.
This update looks okay.
|
/integrate |
|
Going to push as commit 9ec773a.
Your commit was automatically rebased without conflicts. |
In
CopyMoveHelper, replacePosixFileAttributeViewwith aboolean.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28304/head:pull/28304$ git checkout pull/28304Update a local copy of the PR:
$ git checkout pull/28304$ git pull https://git.openjdk.org/jdk.git pull/28304/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28304View PR using the GUI difftool:
$ git pr show -t 28304Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28304.diff
Using Webrev
Link to Webrev Comment