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

Bug 313187

Summary: OpenSchemaAction does not handle locations with spaces in it
Product: [Eclipse Project] PDE Reporter: Curtis Windatt <curtis.windatt.public>
Component: UIAssignee: Ankur Sharma <ankur_sharma>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.6   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch
none
Final patch none

Description Curtis Windatt CLA 2010-05-17 12:49:24 EDT
1) Open an Eclipse that is installed at a path with a space in it
2) Create a plug-in project,add an extension that comes from the default target platform
3) Select the extension and click "Open extension point schema"
Result:
Nothing happens, no error dialog, no schema is opened

Two fixes should be made:
1) OpenSchemaAction.run(), line 192 and 194, where we get a path from the url we should use the URIUtils to correctly handle spaces and other special characters.
2) Inside openSchemaFile and openSchemaJar, we should check that the file exists and report an error if it doesn't.
Comment 1 Curtis Windatt CLA 2010-05-17 12:50:05 EDT
Fix should be well contained, consider for 3.6
Comment 2 Curtis Windatt CLA 2010-05-19 16:44:50 EDT
See also bug 292938.
Comment 3 Ankur Sharma CLA 2011-03-23 10:47:25 EDT
Created attachment 191755 [details]
Patch
Comment 4 Ankur Sharma CLA 2011-04-07 05:14:59 EDT
Created attachment 192707 [details]
Final patch
Comment 5 Ankur Sharma CLA 2011-04-07 05:16:25 EDT
Curtis, can you plz verify the patch once on linux? I have tested already for Mac and WinXp. I just want to be sure before checking this in.
Comment 6 Curtis Windatt CLA 2011-04-07 12:41:49 EDT
Added a null check after decoding.  Otherwise if there is a problem decoding the action would throw NPEs instead of putting up the error dialog.

Fixed in HEAD.
Comment 7 Markus Keller CLA 2012-10-26 16:13:45 EDT
(In reply to comment #4)
> Created attachment 192707 [details] [diff]
> Final patch

URLDecoder is always wrong if you want to extract the path of an URL. It e.g. doesn't handle a "+" in the path properly.

The right solution is url.toURI().getPath().

Filed bug 392950.