| Summary: | Equinox DS fails on directives/properties in Service-Component manifest header | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Simon Chemouil <eclipse> | ||||||
| Component: | Compendium | Assignee: | Stoyan Boshev <s.boshev> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | tjwatson | ||||||
| Version: | unspecified | Flags: | s.boshev:
review+
|
||||||
| Target Milestone: | 3.7 M6 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Simon Chemouil
Created attachment 189478 [details]
Proposed fix
Here's a tentative fix that should be API compatible with the execution environment already set for Equinox DS.
I'm using it with no problems, whether manifest have directives/properties or not.
It strips the useless parts of the headers, and returns them to the original code expecting them not to have directives. (It might be more efficient to rewrite the parsing routing completely, but I went for a solution that involved no rewrite of existing code to be safe).
Created attachment 189486 [details]
proposed fix for header syntax
From spec:
Service-Component ::= header
header ::= clause ( ’,’ clause ) *
clause ::= path ( ’;’ path ) * ( ’;’ parameter ) *
The current code and the supplied patch do not handle 'clause' where there are ';' separated paths: e.g.
Service-Component: OSGI-INF/one.xml; OSGI-INF/two.xml; attr=test; directive:=test
This patch uses ManifestElement (the parser supplied by org.eclipse.osgi). DS is already importing the org.eclipse.osgi.util package for the NLS class. You might as well use the ManifestElement class to do this parsing. There are lots of gotchas to parsing this common header syntax. For example, the current code does not handle quoted strings either in the path elements.
Stoyan, please review the patch and release if appropriate. Thanks. (In reply to comment #2) > Created attachment 189486 [details] > proposed fix for header syntax [snip] Thomas, Thanks for the comments & the patch. Indeed, I was pretty sure there was some class doing appropriate Manifest parsing in Equinox, but I didn't look for it. I also didn't see paths could be separated by semi-colons. Your solution is much better :-). Thanks again! Comment on attachment 189478 [details]
Proposed fix
See Thomas Watson's patch.
Thanks for the patch Thomas! I have released it in HEAD. |