[jdk21u-dev] RFR: 8302293: jar --create fails with IllegalArgumentException if archive name is shorter than 3 characters

Satyen Subramaniam ssubramaniam at openjdk.org
Mon Jun 9 17:19:31 UTC 2025


Backporting JDK-8302293: jar --create fails with IllegalArgumentException if archive name is shorter than 3 characters. This change addresses a bug with the "jar --create" operation, where 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. Although this issue is sort of an edge case (as in most cases the ".jar" extension will be used), there are scenarios where it may intentionally be omitted (ex: with Linux binfmt making Java programs look and feel like native Linux binaries). Ran GHA Sanity Checks, local Tier 1 and 2, and new test directly. Patch is clean.

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

Commit messages:
 - Backport bd0fde71d9113bad902e71b61f0ca44c650809ef

Changes: https://git.openjdk.org/jdk21u-dev/pull/1858/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=1858&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8302293
  Stats: 78 lines in 2 files changed: 73 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk21u-dev/pull/1858.diff
  Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/1858/head:pull/1858

PR: https://git.openjdk.org/jdk21u-dev/pull/1858


More information about the jdk-updates-dev mailing list