Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348820 - [EMF Runtime Extensions] Performance-optimized content type detection in MetaModelDescriptorRegistry ignores file extensions
Summary: [EMF Runtime Extensions] Performance-optimized content type detection in Meta...
Status: CLOSED FIXED
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 0.7.0   Edit
Assignee: Stephan Eberle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-08 18:26 EDT by Stephan Eberle CLA
Modified: 2021-07-14 02:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Eberle CLA 2011-06-08 18:26:32 EDT
= Problem description =
MetaModelDescriptorRegistry#fastGetContentTypeId(IFile) supports a performance-optimized approach for determining the content type id of model files by retrieving and leveragint their XML namespaces. It relies on scanning all registered content types and searching for those with a describer being an instance of org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl.Describer and matching the file's XML namespace. The id of the resulting content type - or the of best fitting content type in case there are multiple - is returned as result. This works well so far, but does not take the file's extension into account. Consequently, in cases where the file's XML namespace matches a registered content type but the file's extension doesn't the returned content type id is invalid.

= Resolution proposal =
* Enhance the performance-optimized content type detection algorithm such that the file's extension is taken into account.
* Leverage the file extension to filter out irrelevant content types as early as possible and save some extra processor cycles by not heading into the XML namespace matching part for those.
Comment 1 Stephan Eberle CLA 2011-06-08 19:11:40 EDT
Fixed as proposed in description.
Comment 2 Balazs Grill CLA 2021-07-14 02:17:18 EDT
Mass-closing Resolved tickets