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
8322332: Add API to access ZipEntry.extraAttributes #19204
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back xiaotaonan! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@xiaotaonan The following label will be automatically applied to this pull request:
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. |
I think this will require discussion on core libs before proposing APIs in this area. I think a starting point would be explain how you might use this, esp. with file permissions and sym links. Due to potential mis-use, I think, as before, have to be very cautious about introducing an API that provides access to the raw bits. |
/csr |
@AlanBateman has indicated that a compatibility and specification (CSR) request is needed for this pull request. @xiaotaonan please create a CSR request for issue JDK-8322332 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
This issue was reported by a person named Alan Snyder, I don't have his or her contact information, how to create a CSR in this situation. |
@xiaotaonan Since you appear confused, "discussion on core libs" means discussion on [email protected] mailing list https://mail.openjdk.org/mailman/listinfo/core-libs-dev where we can agree on what is a safe and future-proof way to expose the extraAttributes. The csr command is just routinely issued for any patch that changes the Java APIs to protect against accidentally changing the public API. You shouldn't submit your CSR until you are sure the API surface (including method signatures + API Documentation/Javadoc) are settled down. If anything changes, you must re-draft your CSR to go through the CSR review process again. Also, if you want to update a pull request, you can just push more commits; you don't have to force-push or delete your branch. When a pull request is integrated, openjdk bot will automatically squash and rename the squashed commit to your bug title, so please don't spam pull requests whenever you push a code update. |
For example, with a quick check, you can find that this field itself is not a good candidate for direct setter exposure:
Thus, a direct setter doesn't indicate the restriction that the field is 2-byte and is optional. A getter might be fine, but given there are other ZIP fields that we don't expose (such as bytes 36-37, 38-41) it's dubious whether such exposure would be needed at all. After all, we should continue the discussion on [email protected]. |
He came to core-libs-dev in Dec 2023 [1] to discuss this. The context at the time was symbolic links. It might be interesting to explore that in the context of the zip file system provider, less sure about the java.util.zip APIs. I assume he created JDK-8322332 after that discussion to at least have something in JBS. [1] https://mail.openjdk.org/pipermail/core-libs-dev/2023-December/116723.html |
Also see #16952, another patch that renames this field, which is planning for an integration soon; this PR will be out-of-date when that one is integrated. |
Mailing list message from Alan Snyder on core-libs-dev:
I was not using the Zip file system. I was processing a Zip file. Alan |
Mailing list message from - on core-libs-dev: Hi Alan Snyder, P.S. Seems the Skara bridge is not propagating emails to GitHub comments. On Sun, May 12, 2024 at 2:17?PM Alan Snyder <javalists at cbfiddle.com> wrote: -------------- next part -------------- |
They are equivalent, the suggestion to look at the sym link support in the zip file system provider is that it's a much better fit for this extension. It already has optional support for POSIX file permissions and the APIs for dealing with sym links. |
Mailing list message from - on core-libs-dev: Hi Mike, On Sun, May 12, 2024 at 6:10?PM Michael Hall <mik3hall at gmail.com> wrote:
-------------- next part -------------- |
Mailing list message from Michael Hall on core-libs-dev: I was thinking of zip api?s other than java?s. The field needs to be at a fixed place in the file format whatever the name? Unless a significant api change has been made. A couple of links from googling on ?zip extra field chaining" https://libzip.org/specifications/extrafld.txt If this were strictly jar files I would be less concerned but zip is widely used outside of java so more chances for conflict where java doesn?t have anything like ownership.
-------------- next part -------------- |
Add API to access ZipEntry.extraAttributes
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19204/head:pull/19204
$ git checkout pull/19204
Update a local copy of the PR:
$ git checkout pull/19204
$ git pull https://git.openjdk.org/jdk.git pull/19204/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19204
View PR using the GUI difftool:
$ git pr show -t 19204
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19204.diff
Webrev
Link to Webrev Comment