Bug 142326

Summary: PathmapManager only denormalizes file: and platform:/resource URIs
Product: [Modeling] GMF-Runtime Reporter: Christian Damus <give.a.damus>
Component: GeneralAssignee: Christian Damus <give.a.damus>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: dmisic, vramaswa
Version: 1.0Keywords: contributed
Target Milestone: 1.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch to fix the problem none

Description Christian Damus CLA 2006-05-17 15:44:51 EDT
The PathmapManager only denormalizes file: and platform:/resource URI schemes.  As a result, when I create a Resource (using ResourceSet.createResource(URI) method) for a pathmapped URI of a resource deployed in a bundle JAR, it ends up having a different URI than I asked to be created, and my application goes bonkers.

This happens because my pathmap://FOO/bar.xmi URI is normalized to jar:file:/path/to/eclipse/plugins/com.example_1.0.0.jar!/resources/bar.xmi but then denormalization fails because the jar:file: scheme is arbitrarily disallowed.  So, instead of getting a resource with the pathmap URI, I get a resource with the jar:file: URI.

For any pathmap: URI that the PathmapManager can normalize, the PathmapManager *must* be able to denormalize it to restore the original pathmap: URI.
Comment 1 Christian Damus CLA 2006-05-17 15:59:19 EDT
Created attachment 41789 [details]
Patch to fix the problem

Attached a patch that fixes the problem by removing an extraneous check for file: or platform:/resource URI schemes in the PathmapManager.denormalize() method.
Comment 2 Christian Damus CLA 2006-05-17 15:59:49 EDT
Adding Vishy to cc: to review and (hopefully) commit the patch.
Comment 3 Vishy Ramaswamy CLA 2006-05-17 19:12:22 EDT
Reviewed and applied patch
Comment 4 Vishy Ramaswamy CLA 2006-05-17 19:12:35 EDT
Committed patch
Comment 5 Richard Gronback CLA 2008-08-13 13:05:04 EDT
[target cleanup] 1.0 RC3 was the original target milestone for this bug
Comment 6 Eclipse Webmaster CLA 2010-07-19 12:24:25 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug