Community
Participate
Working Groups
Build-ID: N20081020-2000 Manifest generated from "Hello OSGi Declarative Services" contains following header: Import-Package: org.eclipse.osgi.framework.console;version="1.0.0";version="0.0.0", org.osgi.framework;version="1.3.0";version="0.0.0" Whereas it should be: Import-Package: org.eclipse.osgi.framework.console;version="1.0.0", org.osgi.framework;version="1.3.0" Note two problems here: 1. excesive 'version="1.0.0"' string for every imported package -> as a result dependencies are unresolved (errors in code) 2. missing white space at the beginning of header second line -> as a result Manifest has error "':' is required after the header name"
ok, the problem occurs for other templates as well, e.g. OSGi Service template produces following header: Import-Package: org.osgi.framework;version="1.3.0";version="0.0.0", org.osgi.util.tracker;version="1.3.1";version="0.0.0"
It's caused by patch to bug 247553 NewProjectCreationOperation.getCommaValuesFromPackagesSet(Set package, String version) is often passed following packages set: 'org.eclipse.osgi.framework.console;version="1.0.0"' so with "version=..." attached. I imagine that when version argument is null, method could don't add the "version=1.0.0" part.
Created attachment 116021 [details] patch I'm not quite sure why the version argument to the method is used only if there's only one package exported and not more, but am assuming this is according to bug 247553. I don't see any advantage of generating version=0.0.0 over leaving no version specified. This patch makes that if version argument is set to null or there's more than one package, nothing is generated. It also adds a space in the subsequent lines of Export-Package header. Ben, please review this patch. Won't it break fix for bug 247553?
Correct, no version implies 0.0.0 by default.
Good catch Jacek.
Sorry for the delay I'm fine with the patch except that we should change + * If there's only one package and version is not null, package is exported with that version number. into + * If there's only one package and version is not null, package is flagged with that version number. because it reflects better what really happens
About the need to add a space after the "\n", this may be related to another bug, i'im investigating (because it works just well for export-package entries when creating a new plug-in, it should just work the same way for import-package entries)