-
Notifications
You must be signed in to change notification settings - Fork 233
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
8263940: NPE when creating default file system when default file system provider is packaged as JAR file on class path #2647
Conversation
👋 Welcome back ashi! A progress list of the required criteria for merging this PR into |
@amosshi This change now passes all automated pre-integration checks. 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 47 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 |
This backport pull request has now been updated with issue from the original commit. |
Webrevs
|
@@ -104,7 +104,7 @@ private void createFileSystemProviderJar(Path jar, Path dir) throws IOException | |||
List<String> paths = stream | |||
.map(path -> path.getFileName().toString()) | |||
.filter(f -> f.startsWith("TestProvider")) | |||
.toList(); | |||
.collect(Collectors.toList()); | |||
for(var p : paths) { |
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.
Fix compile error on Java 11:
- the
toList()
does not work on 11 - change it as
collect(Collectors.toList()
Key key = (Key) obj; | ||
if (key.utf8 != utf8) { | ||
return false; | ||
} | ||
if (!attrs.lastModifiedTime().equals(key.attrs.lastModifiedTime())) { |
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.
The private static class Key
class does not have the ZipCoder zc
constructor parameter, here we add it based on current latest code in https://github.com/openjdk/jdk/
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.
The backported change does not add the zc argumenht to the call in lin 1436.
Can you please explain why you add it? Originally it was added for larger change JDK-8243254
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.
Hi @GoeLin ,
- Because in the Line
1436
of the same file, it needs the 3rd parameterzc
.- Without this parameter, there will be a compile error.
1436 BasicFileAttributes.class), zc);
-
In the latest
jdk
code, the 3d parameterzc
has been there already- Well in
jdk11u-dev
, the parameter was not there yet
- Well in
-
Considering this is an internal
private
class (line1385
)- So we can add this parameter more safely with current Jira ticket.
1385 private static class Key {
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.
Yes, but it is you who added the paramteter zc in line 1436, not the patch you backported.
The backported patch only adds builtInFS.getPath()
and changes the line breaks.
So why did you add zc in line 1436? I think you should not add it there, and then you don't need the other additional changes either.
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.
@GoeLin ,
Yes, in the diff the zc
was not added.
Well because in the original commit openjdk/jdk@717792c , the zc
parameter exits in the base line already. so in jdk11u-dev
we were trying to keep in line with the latest code base.
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.
Ok, if the reason is only to get 11 closer to 17, I think it is better to remove zc at the call site and in the callee from this change here. The code belongs to JDK-8243254, but that change is an enhancement and quite large, so it's not a good candidate for backporting.
Here we just want to fix the bug addressed.
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.
|
/approval request "Backporting for parity with 11.0.24-oracle. Un-Clean backport. SAP nightlies passed on 2024-04-16,17,19,20” |
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.
LGTM
/integrate |
Going to push as commit d42634b.
Your commit was automatically rebased without conflicts. |
Backport of JDK-8263940
This PR contains 2 commits
git apply
ZipFile.java.rej
andSetDefaultProvider.java.rej
files.rej
files,ZipFile.java
- Added missing parameterZipCoder zc
inprivate static class Key
SetDefaultProvider.java
- Fixed Java 11 compile errorsgit apply
loggit status
logsrc/java.base/share/classes/java/util/zip/ZipFile.java.rej
contenttest/jdk/java/nio/file/spi/SetDefaultProvider.java.rej
contentTesting
SetDefaultProvider.java
- Test results: passed: 12024-04-29
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/2647/head:pull/2647
$ git checkout pull/2647
Update a local copy of the PR:
$ git checkout pull/2647
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/2647/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2647
View PR using the GUI difftool:
$ git pr show -t 2647
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/2647.diff
Webrev
Link to Webrev Comment