-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8290047: (fs) FileSystem.getPathMatcher does not check for ":" at last index #9595
Conversation
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
Webrevs
|
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.
Looks good, Brian.
@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 202 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 |
src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
Outdated
Show resolved
Hide resolved
src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
Outdated
Show resolved
Hide resolved
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.
Please update the issue title and description and PR title and description to match the new understanding.
The IAE message in JrtFileSystem wording is a bit like it is leftover debugging output.
The messages for all 4 IAE could be something as simple as "missing pattern".
Not sure a message is needed. At the other extreme one could say "missing syntax" for ":pattern" and "missing pattern" for "syntax:". Or it could be "Parameter does not take the form: syntax:pattern". |
Is there anything else to be done in this PR? Thanks. |
It looks like this issue has changed from the original bug report and now rejects the empty pattern with IAE. This is a behavior change (and probably the right behavior) but I think will require a small update to the javadoc to make it clear that both an empty syntax and empty pattern are illegal. |
I read the existing specification
as covering both cases, but I suppose one could explicitly state that "neither syntax nor pattern may be empty." |
Alternatively, change "where ':' stands for itself" to "where syntax and pattern components are non-empty strings and ':' stands for itself" sot that it's up front when the input string is described. |
I think that reads better; will change accordingly. |
The existing code downstream of the check handles an empty glob or regex pattern as matching the empty string. |
Indeed for this code
without the proposed change
to
as originally suggested. |
I'm 99% sure the original intention was for the empty pattern to be rejected with IAE. It was an implementation but that it checked if the index is length rather than length-1. That was JDK 7 and changing is now without be behavior change. I can't imagine the impact would be significant but I agree it's not worth it and maybe we just drop the check as per the JBS issue and update the spec to document the long standing behavior. |
Agreed. |
/csr |
@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-8290047 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
/integrate |
Going to push as commit 4040927.
Your commit was automatically rebased without conflicts. |
For a
String
“s”,s.indexOf(int)
can never return a value>= s.length()
so change the checkto
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9595/head:pull/9595
$ git checkout pull/9595
Update a local copy of the PR:
$ git checkout pull/9595
$ git pull https://git.openjdk.org/jdk pull/9595/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9595
View PR using the GUI difftool:
$ git pr show -t 9595
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9595.diff