Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356849 - Opening the page designer editor for the first time fails when the workspace's path has invalid URL characters
Summary: Opening the page designer editor for the first time fails when the workspace'...
Status: NEW
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: JSF Tools (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: jsf inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-06 15:07 EDT by Marcelo Paternostro CLA
Modified: 2011-09-06 15:07 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 Marcelo Paternostro CLA 2011-09-06 15:07:59 EDT
Build Identifier: 

The problem I am experiencing is in org.eclipse.jst.pagedesigner.dtresourceprovider.DefaultDTSkin.getStyleSheets(), which throws an exception when reading the contents referred by an invalid URL of the 'styleSheetURLs' list. The exception causes the editor to open with an error. Thankfully this code is only invoked once, so if the user tries to open the editor again, everything works fine.

More details…

- I get this exception because the path of my workspace is crazy: ${workspace_loc}/../oepe-dev $%runtime ;+1   I set up this workspace to fix a similar bug and have been using it since then - it has been quite useful to catch a few problems ;-)

- The ID of the editor being opened is org.eclipse.jst.pagedesigner.PageDesignerEditor.

- The real problem  here is that Java allows invalid URLs to be created, which throw exceptions when read or decoded. A possible fix would be to create a utility method to open URLs (== read contents) and then use it instead of URL.openStream(). Such a method, for file URLs, could try to locate the java.io.File to get its content.

Reproducible: Always

Steps to Reproduce:
1. Start Eclipse with a workspace that has % and other URL unfriendly characters as part of its path
2. Open a JSP file

Error: the editor opens with an error, caused by an exception thrown when DefaultDTSkin.getStyleSheets() is executed.