Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368287

Summary: additional line feeds would make the generated manifest more readable
Product: [RT] Virgo Reporter: Timothy Redmond <tredmond>
Component: bundlorAssignee: Project Inbox <virgo-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: antonlem78, dmarthaler, eclipse, frieder.heugel, glyn.normington, mlippert
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 368782    

Description Timothy Redmond CLA 2012-01-10 13:38:30 EST
Build Identifier: Bundlor Version: 1.1.0 Build id: M03

	
This is very minor and I would not be upset if you dropped it because it is too trivial. But I think that it can be useful - I will explain after I describe the issue.

I believe that you don't need to wait for character 72 to use a newline and a space in a manifest. If this is correct then I think it would be useful if this was added in the manifest after each exported or imported package. I admit that the manifest is a generated file but sometimes when debugging the the manifest it would be nice to be able to read it a bit more easily.

So I have a use case (and I have others like this). Eclipse is now claiming that a certain package from a bundlor generated manifest is not visible to other bundles. I think that eclipse is wrong because the bundles run fine inside equinox and felix (e.g. outside the eclipse ide environment) and this would not be the first time that the eclipse ide has been confused. (But it wouldn't be the first time that I was the one who was confused.) It would be nice if it was easy to scan the manifest to see the package in question and verify that it is exported. When I hand generated the manifests I was able to do this.

Reproducible: Always

Steps to Reproduce:
1.run bundlor to create a manifest
2.try to examine the resulting manifest
Comment 1 Glyn Normington CLA 2012-01-11 04:38:26 EST
Thanks for raising this. Seems like a reasonable requirement. Flagging as "help wanted" because it's a relatively self-contained change and I want to encourage potential contributors to have a crack at developing a patch.
Comment 2 daniel marthaler CLA 2016-09-26 11:33:32 EDT
*** Bug 398624 has been marked as a duplicate of this bug. ***
Comment 3 daniel marthaler CLA 2016-09-27 05:01:02 EDT
Quick look at the code reveals that writing of the manifest is initiated by "org.eclipse.virgo.util.osgi.manifest.internal.StandardBundleManifest" which in turn delegates the writing further to an instance of "java.util.jar.Manifest". The "\r\n" after 72 characters is actually implemented in [1] respectively in [2].

For the described enhancement we need to amend "org.eclipse.virgo.util.osgi.manifest.internal.StandardBundleManifest.write(Writer writer)" by using some kind of extended "java.util.jar.Manifest" implementation which allows to insert line breaks other than each 72 characters.

[1] http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/jar/Manifest.java#Manifest.write%28java.io.OutputStream%29
[2] http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/jar/Manifest.java#Manifest.make72Safe%28java.lang.StringBuffer%29