Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8316804

Gracefully handle the case where --release is not specified last

XMLWordPrintable

    • jar
    • In Review
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows 10.0.22621
      openjdk full version "22-ea+15-1134"

      A DESCRIPTION OF THE PROBLEM :
      The jar tool should gracefully handle the case where the --release argument is not specified last.
      This is mainly an issue with operation modes like --describe-module and --validate

      To demonstrate, in a JDK 22 directory, run the following 2 commands:
      .\bin\jar.exe --describe-module --release 9 -f .\lib\jrt-fs.jar
      .\bin\jar.exe --validate --release 9 -f .\lib\jrt-fs.jar

      Expected:
      Both commands are handled gracefully (either they work and allow --release to be specified anywhere, or they give a meaningful error message which points out that --release must be specified as the last argument).

      Actual:
      The first command gives the cryptic error "'-d, --describe-module' option requires no input file(s) to be specified".
      The second command fails with a "java.nio.file.FileAlreadyExistsException"



            cstein Christian Stein
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: