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

Bug 348820

Summary: [EMF Runtime Extensions] Performance-optimized content type detection in MetaModelDescriptorRegistry ignores file extensions
Product: [Automotive] Sphinx Reporter: Stephan Eberle <stephaneberle9>
Component: CoreAssignee: Stephan Eberle <stephaneberle9>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 0.7.0   
Target Milestone: 0.7.0   
Hardware: All   
OS: All   
Whiteboard:

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