Community
Participate
Working Groups
Build Identifier: 3.7.0 I'm developing some plugins and exporting its javadoc by adding a doc folder withing the generated jar file. JDT uses the JavadocLocationManager.getJavadocLocation method that returns wrong URLs for Linux and MacOS. The current implementation adds an extra "/" in the URL causing errors. So, instead of URL being something like file:/home/myhome/eclipse/plugins/myplugin.jar it is file://home/myhome/eclipse/plugins/myplugin.jar CURRENT IMPLEMENTATION File file = new File(model.getInstallLocation()); if (file.isDirectory()) { File doc = new File(file, "doc"); //$NON-NLS-1$ if (new File(doc, "package-list").exists()) //$NON-NLS-1$ return "file:/" + doc.getAbsolutePath(); //$NON-NLS-1$ } else if (CoreUtility.jarContainsResource(file, "doc/package-list", false)) { //$NON-NLS-1$ return "jar:file:/" + file.getAbsolutePath() + "!/doc"; //$NON-NLS-1$ //$NON-NLS-2$ SUGGESTION File file = new File(model.getInstallLocation()); if (file.isDirectory()) { File doc = new File(file, "doc"); //$NON-NLS-1$ if (new File(doc, "package-list").exists()) //$NON-NLS-1$ return "file:" + (Platform.OS_WIN32.equals(Platform.getOS()) ? "/" : "" ) + doc.getAbsolutePath(); //$NON-NLS-1$ } else if (CoreUtility.jarContainsResource(file, "doc/package-list", false)) { //$NON-NLS-1$ return "jar:file:" + (Platform.OS_WIN32.equals(Platform.getOS()) ? "/" : "" ) + file.getAbsolutePath() + "!/doc"; //$NON-NLS-1$ //$NON-NLS-2$ Reproducible: Always
Move to PDE/UI
Fixed in master. I replaced the string concatenation with a File.toURL(). This method has been deprecated in later versions of the JDK as it does not encode special characters. However, we haven't ever done encoding here and the method will handle the slashes correctly. Try it out and let us know if it fixes your problem.
How can I get a build with this fix?
(In reply to comment #3) > How can I get a build with this fix? As Dani already mentioned on the mailing list, the first build containing the change will be: http://download.eclipse.org/eclipse/downloads/drops/N20111031-2000 However, that link is not available yet (hasn't sync'd). Not sure if there is something wrong or if it is just slow. There is an I Build today that will also include the fix.