Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 266859 - FeatureParser should be split in two. One for the folder/jar and one for the feature manifest
Summary: FeatureParser should be split in two. One for the folder/jar and one for the ...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-03 10:00 EST by Thomas Hallgren CLA
Modified: 2009-03-18 04:39 EDT (History)
2 users (show)

See Also:


Attachments
Patch that implements the proposed split. (26.39 KB, patch)
2009-03-03 10:03 EST, Thomas Hallgren CLA
john.arthorne: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2009-03-03 10:00:33 EST
The current FeatureParser has two of problems.

1. It is a black box, capable of parsing a feature source in the form of a folder or a jar. It can also parse the feature.xml alone but when that it does, there's no way to access the messageKeys that is built during parsing.

2. The feature.properties file is parsed twice. First to provide the 'messages' argument to the manifest parser (only to use its size) and then a  second time when adding messages for locales.

I think it would be cleaner if the FeatureParser is split in two classes.  A 'FeatureParser', that parses the folder/jar and a 'FeatureManifestParser' that parses only the feature.xml based in an InputStream. One reason for this is that  some build systems will not keep the feature.xml adjacent to the localization files at all times. Especially not after changing version qualifiers etc. A plain manifest parser can be used together with the LocalizationHelper in more ways the one.
Comment 1 Thomas Hallgren CLA 2009-03-03 10:03:37 EST
Created attachment 127324 [details]
Patch that implements the proposed split.

This patch implements the proposed split of the FeatureParser class. It also fixes the problem with feature.properties being read twice.

The patch also provides a public getMessageKeys() method on the FeatureManifestParser to make an integration with the LocalizationHelper possible by other users.
Comment 2 Thomas Hallgren CLA 2009-03-03 17:22:35 EST
Some of the work I'm doing for EclipseCon is dependent on this bugzilla so it would be really helpful to know if the patch can get accepted or if I need to find other ways to resolve this.

TIA
Comment 3 John Arthorne CLA 2009-03-05 14:37:11 EST
Hey Thomas, we are really swamped this week trying to wrap up API work for next week's API freeze. We have also been having trouble for the past two weeks producing a good quality build with no test failures, so want to avoid unnecessary changes. Would it still be helpful to you if this was done in M7?
Comment 4 Thomas Hallgren CLA 2009-03-05 16:55:05 EST
Yes, absolutely. I can get by using my own patched version for now. 
Comment 5 Pascal Rapicault CLA 2009-03-16 20:20:54 EDT
John could you please look at releasing Thomas's patch this week?
Comment 6 John Arthorne CLA 2009-03-18 04:39:19 EDT
Merged, tested, and released to HEAD.