| Summary: | [UI] JsDoc location cannot be edited via the User Libraries pref page | ||
|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | General | Assignee: | Project Inbox <jsdt.javascript-inbox> |
| Status: | NEW --- | QA Contact: | Chris Jaun <cmjaun> |
| Severity: | normal | ||
| Priority: | P3 | CC: | adrianp.quatinus, cmjaun |
| Version: | 3.2 | ||
| Target Milestone: | Future | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Michael Rennie
I stepped through this code in the debugger: the inability to edit is caused by a MalformedURLException thrown from the org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.JavadocAttributeConfiguration.performEdit() method at JavadocAttributeConfiguration.java line 80:
public IIncludePathAttribute performEdit(Shell shell, ClasspathAttributeAccess attribute) {
String initialLocation= attribute.getClasspathAttribute().getValue();
String elementName= attribute.getParentClasspassEntry().getPath().lastSegment();
try {
URL locationURL= initialLocation != null ? new URL(initialLocation) : null; // <== line 80
URL[] result= BuildPathDialogAccess.configureJavadocLocation(shell, elementName, locationURL);
if (result != null) {
URL newURL= result[0];
String string= newURL != null ? newURL.toExternalForm() : null;
return JavaScriptCore.newIncludepathAttribute(IIncludePathAttribute.JSDOC_LOCATION_ATTRIBUTE_NAME, string);
}
} catch (MalformedURLException e) {
// todo
}
return null;
}
The exception is thrown because the default value for initialLocation is the empty string "", which is not a valid URL.
line 80 should be amended to read:
URL locationURL= initialLocation != null && !initialLocation.isEmpty() ? new URL(initialLocation) : null;
|