Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324750 - [UI] JsDoc location cannot be edited via the User Libraries pref page
Summary: [UI] JsDoc location cannot be edited via the User Libraries pref page
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-08 10:36 EDT by Michael Rennie CLA
Modified: 2015-09-02 04:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2010-09-08 10:36:17 EDT
build id: 20100813105432

Steps

1. new workspace
2. navigate to the JavaScript > User Libraries pref page
3. add a new lib and add a folder to the new lib
4. expand the new lib and select the JsDoc entry
5. press the edit button

Expected

I would be presented with a way to edit the JsDoc location

Happens

Nothing. No error log entries.
Comment 1 Adrian Price CLA 2015-09-02 04:36:22 EDT
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;