JDK-8166735 : JarFile#getVersion spec clarification for unversioned jars
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-09-26
  • Updated: 2017-05-17
  • Resolved: 2016-11-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b145Fixed
Related Reports
Blocks :  
Relates :  
Description
As per the existing spec (comments), it is not clear what would be the value for JarFile#getVersion when JarFile API is used to process unversioned jar.

It is observed that when JarFile is used for processing unversioned jars, then getVersion always returns baseVersion. 

It would good to mention this scenario in the getVersion spec.

something along the lines,
"assert !jarFile.isMultiRelease() && jarFile.getVersion().equals(JarFile.baseVersion())"