RFR: 8302293: jar --create fails with IllegalArgumentException if archive name is shorter than 3 characters
Jaikiran Pai
jpai at openjdk.org
Fri Dec 20 06:44:16 UTC 2024
Can I please get a review for this change which proposes to fix the issue noted in https://bugs.openjdk.org/browse/JDK-8302293?
As noted in the issue, when creating a temporary file during the "jar --create" operation, if the original file name is lesser than 3 characters, the temporary file creation which uses the original file's name as the temporary file name prefix, runs into an exception. The commit in this PR addresses that issue by ensuring that the temporary file name prefix is atleast 3 characters in length. Within the same file, an additional place was spotted where the code could potentially run into the same exception, so that too has been addressed in this change.
A new jtreg test has been introduced which reproduces the issue and verifies the fix.
-------------
Commit messages:
- add comment to test method
- 8302293: jar --create fails with IllegalAccessException if archive name is shorter than 3 characters
Changes: https://git.openjdk.org/jdk/pull/22841/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22841&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8302293
Stats: 81 lines in 2 files changed: 76 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/22841.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22841/head:pull/22841
PR: https://git.openjdk.org/jdk/pull/22841
More information about the compiler-dev
mailing list