JDK-4894998 : Last line of Manifest discarded
  • Type: Bug
  • Component: tools
  • Sub-Component: jar
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-07-23
  • Updated: 2006-12-13
  • Resolved: 2006-12-13
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Name: gm110360			Date: 07/23/2003


FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-
b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version
5.00.2195]

A DESCRIPTION OF THE PROBLEM :
If you create a manifest file and import it in a jar the line of the
mainfiest is not imported in the Manifest.mf in the jar file. This
happens if you don't make a line break after the last line entered in your
manifest.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a manifest file and add some properties. Don't make a line break
after the last line and save it. Be sure to use an editor that doesn't add
the line break automatically (I used Eclipse to write the manifest
file).
2. Then import it with jar -cmf Manifest.mf myjar.jar ...
3.
Then inspect the Manifest.mf stored in the jar file.

EXPECTED VERSUS ACTUAL BEHAVIOR :
I would expect that all lines of my manifest file appear in the
Manifest.mf in the jar file.

What happend is that if I don't make an
line break after the last line of my manifest this line is not present in
the Manifest.mf in the jar file.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER WORKAROUND :
Allway make a line feed after the last line of your mainfest.
(Incident Review ID: 165654) 
======================================================================

Comments
EVALUATION It seems reasonable to not require the trailing newline when reading in a Manifest file, and to always add one when creating a new file by a program. Unfortunately, some text editors don't always add trailing newlines. See emacs' `require-final-newline' variable. ###@###.### 2003-08-18
18-08-2003