Integrated: 8302293: jar --create fails with IllegalArgumentException if archive name is shorter than 3 characters

Jaikiran Pai jpai at openjdk.org
Sun Dec 29 08:40:52 UTC 2024


On Fri, 20 Dec 2024 06:38:54 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: bd0fde71
Author:    Jaikiran Pai <jpai at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/bd0fde71d9113bad902e71b61f0ca44c650809ef
Stats:     78 lines in 2 files changed: 73 ins; 0 del; 5 mod

8302293: jar --create fails with IllegalArgumentException if archive name is shorter than 3 characters

Reviewed-by: lancea

-------------

PR: https://git.openjdk.org/jdk/pull/22841


More information about the core-libs-dev mailing list