| Summary: | Opening the page designer editor for the first time fails when the workspace's path has invalid URL characters | ||
|---|---|---|---|
| Product: | [WebTools] Java Server Faces | Reporter: | Marcelo Paternostro <marcelo.paternostro> |
| Component: | JSF Tools | Assignee: | jsf inbox <jsf-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
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.