This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 66341 - File type template can generate invalid manifest
Summary: File type template can generate invalid manifest
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-09 20:16 UTC by _ tboudreau
Modified: 2005-12-02 14:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2005-10-09 20:16:59 UTC
After creating a loader once, and manually deleting its files and manifest entry
(it was created in the wrong package), running the wizard later (it may have had
extra newlines or a line or two with spaces at the end of it) generated the
following:

Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.modules.foo
OpenIDE-Module-Layer: org/netbeans/modules/foo/layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/foo/Bundle.properties
OpenIDE-Module-Specification-Version: 1.0
Name: org/netbeans/modules/stepfour/loader/FooDataLoader.class
OpenIDE-Module-Class: Loader

The problem is that there is no blank line before Name: - I believe this
manifest will not work correctly.
Comment 1 Jesse Glick 2005-10-10 20:24:28 UTC
Manifest generation incl. insertion of spaces before Name: entries is pretty
exhaustively unit tested, so if you can reproduce from scratch please attach a
test case and I will fix; otherwise will be WORKSFORME.
Comment 2 _ tboudreau 2005-10-18 20:51:46 UTC
Just reproduced it.

Create a new file type from template.  Delete the loader and its associated
files, clean up the layer file.

Delete the loader entry from the manifest.  I don't know whether I left no CR at
the end of the last populated line, or if I left one, but it's one or the other.

Recreate the loader.
Comment 3 Jesse Glick 2005-10-20 22:33:56 UTC
Reproduced, thanks.
Comment 4 Jesse Glick 2005-10-21 00:24:52 UTC
FWIW, manifests should normally end in *two* newlines, and the code was behaving
correctly if they did - but I did not think to write a test for the case that
the manifest was missing a final pair of newlines and then a section is added.

committed   * Up-To-Date  1.4        
apisupport/project/src/org/netbeans/modules/apisupport/project/EditableManifest.java
committed   * Up-To-Date  1.3        
apisupport/project/test/unit/src/org/netbeans/modules/apisupport/project/EditableManifestTest.java
Comment 5 Tomas Danek 2005-12-02 14:17:29 UTC
test is good, passes. verified.