Bug 439579: Creating an "Installed JRE" doesn't associate javafx-src.zip to jfxrt.jar
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/VMInstallTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/VMInstallTests.java
index 806c045..8310356 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/VMInstallTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/VMInstallTests.java
@@ -16,15 +16,13 @@
import org.eclipse.jdt.debug.testplugin.JavaTestPlugin;
import org.eclipse.jdt.debug.tests.AbstractDebugTest;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-
+import org.eclipse.jdt.internal.launching.JavaFxLibraryResolver;
import org.eclipse.jdt.internal.launching.LaunchingPlugin;
-
import org.eclipse.jdt.launching.ILibraryLocationResolver;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMInstall2;
@@ -46,7 +44,7 @@
for (int i = 0; i < path.segmentCount(); i++) {
if ("ext".equals(path.segment(i))) {
- return true;
+ return !JavaFxLibraryResolver.JFXRT_JAR.equals(path.lastSegment());
}
}
return false;
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaFxLibraryResolver.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaFxLibraryResolver.java
index 8b8adb2..2507f65 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaFxLibraryResolver.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JavaFxLibraryResolver.java
@@ -20,7 +20,7 @@
public class JavaFxLibraryResolver implements ILibraryLocationResolver {
- private static final String JFXRT_JAR = "jfxrt.jar"; //$NON-NLS-1$
+ public static final String JFXRT_JAR = "jfxrt.jar"; //$NON-NLS-1$
private static final String JAVAFX_SRC_ZIP = "javafx-src.zip"; //$NON-NLS-1$
private static final String JAVAFX_8_JAVADOC = "http://docs.oracle.com/javase/8/javafx/api/"; //$NON-NLS-1$
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
index 424b373..5f5a35f 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
@@ -20,6 +20,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -149,6 +151,13 @@
if( fgLibraryLocationResolvers == null ) {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(LaunchingPlugin.ID_PLUGIN, JavaRuntime.EXTENSION_POINT_LIBRARY_LOCATION_RESOLVERS);
IConfigurationElement[] configs = extensionPoint.getConfigurationElements();
+ // The "libraryLocationResolvers" extension point doesn't have any conflict resolution.
+ // Sorting by namespace at least makes makes the order predictable.
+ Arrays.sort(configs, new Comparator<IConfigurationElement>() {
+ public int compare(IConfigurationElement e1, IConfigurationElement e2) {
+ return e1.getNamespaceIdentifier().compareTo(e2.getNamespaceIdentifier());
+ }
+ });
List<ILibraryLocationResolver> resolvers = new ArrayList<ILibraryLocationResolver>(configs.length);
for( int i = 0; i < configs.length; i++ ) {
IConfigurationElement e = configs[i];