Community
Participate
Working Groups
Plugin providers have the ability to distribute the javadoc with a plugin by putting the html files (tree) in a subdirectory "doc" at the root of the plugin tree. This allows a hover-over to automatically show the javadoc when developers are coding and using the Java elements in that plugin. This functionality is broken, though, and doing a mouse hover over a type/field/method causes an exception to be logged in the error log; the exception happens in JavaElement.getLibraryJavadocLocation() (JDT). The culprit, though, seems to be the PDE method JavadocLocationManager.getJavadocLocation(), which contains the logic to support this embedded "doc" directory approach to deploying javadoc. The problem with the logic is that it returns a File.getAbsolutePath() string, where it should return a URL. This causes the JDT method mentioned above to trip up since it tries to create a URL object from the string. Note that the else case--the call to JavadocLocationManager.getEntry()--ends up returning a URL string, reinforcing my assessment that the root cause of this bug is in the "doc" logic in PDE.
Created attachment 151618 [details] fix
Created attachment 151619 [details] use this eclipse plugin to reproduce problem
Reproducibility steps: 1. Unzip the attached plugin archive to the plugins directory of your eclipse installation 2. Launch eclipse 3. In any plugin, add "mylib" as a required plug-in (use the manifest editor's Dependencies page) 4. Anywhere in your plugin code, add a call to mylib.Acivator.getDefault(). 5. Hover the cursor over "getDefault" 6. Note the exception that is logged in the error log
I don't see any comments in JDT saying that the javadoc location must be a URL, but the logic in jdt.launching does use URLs. PDE doesn't look at the value after setting it, so your fix won't cause us any problems. cc'ing Dani to see if he has any comments about the usage of JAVADOC_LOCATION_ATTRIBUTE_NAME It would be good to improve the javadoc on that element to say that its value must be a string url.
Patch is fine. Filed bug 294731 to get the Javadoc updated.
Thanks for confirming Dani. Patch applied to HEAD.