diff options
| author | Sarika Sinha | 2017-09-22 09:03:10 +0000 |
|---|---|---|
| committer | Sarika Sinha | 2017-09-22 11:25:02 +0000 |
| commit | 5dc3b41e97884a94e4037ca7ae78bc4a7c4d962c (patch) | |
| tree | 97f1630efdab60976f3a1aa570040670a1e940ca | |
| parent | 1b64988d5b45b7ae0043ad750c169eb2718e50c2 (diff) | |
| download | eclipse.jdt.debug-5dc3b41e97884a94e4037ca7ae78bc4a7c4d962c.tar.gz eclipse.jdt.debug-5dc3b41e97884a94e4037ca7ae78bc4a7c4d962c.tar.xz eclipse.jdt.debug-5dc3b41e97884a94e4037ca7ae78bc4a7c4d962c.zip | |
Bug 521843 - [9] Cannot launch JUnit Plugin test with Java 9 instead ofU20170922-1005U20170922-0835U20170922-0750S4_7_1_aRC1M20170922-1005M20170922-0855M20170922-0740
Java 8
Change-Id: I11d9a11f5f48e93785efacf5aa5d5421c1200a3a
7 files changed, 63 insertions, 15 deletions
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java index 08eb3cfab..5ce5facb5 100644 --- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java +++ b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/JavaProjectHelper.java @@ -94,6 +94,15 @@ public class JavaProjectHelper { public static boolean isJava8Compatible() { return isCompatible(8); } + + /** + * Returns if the currently running VM is version compatible with Java 9 + * + * @return <code>true</code> if a Java 9 (or greater) VM is running <code>false</code> otherwise + */ + public static boolean isJava9Compatible() { + return isCompatible(9); + } /** * Returns if the currently running VM is version compatible with Java 7 * @@ -142,6 +151,15 @@ public class JavaProjectHelper { } } catch (NumberFormatException e) { } + } else if (nums.length == 1) { + try { + int major = Integer.parseInt(nums[0]); + if (major >= ver) { + return true; + } + } + catch (NumberFormatException e) { + } } } return false; diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java index 6e8ee0ff4..6237810d9 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,6 +27,7 @@ import org.eclipse.jdt.debug.tests.breakpoints.ExceptionBreakpointTests; import org.eclipse.jdt.debug.tests.breakpoints.HitCountBreakpointsTests; import org.eclipse.jdt.debug.tests.breakpoints.ImportBreakpointsTest; import org.eclipse.jdt.debug.tests.breakpoints.JavaBreakpointListenerTests; +import org.eclipse.jdt.debug.tests.breakpoints.JavaThreadEventHandlerTests; import org.eclipse.jdt.debug.tests.breakpoints.MethodBreakpointTests; import org.eclipse.jdt.debug.tests.breakpoints.MethodBreakpointTests15; import org.eclipse.jdt.debug.tests.breakpoints.MiscBreakpointsTests; @@ -38,7 +39,6 @@ import org.eclipse.jdt.debug.tests.breakpoints.TargetPatternBreakpointTests; import org.eclipse.jdt.debug.tests.breakpoints.TestToggleBreakpointsTarget; import org.eclipse.jdt.debug.tests.breakpoints.TestToggleBreakpointsTarget8; import org.eclipse.jdt.debug.tests.breakpoints.ThreadFilterBreakpointsTests; -import org.eclipse.jdt.debug.tests.breakpoints.JavaThreadEventHandlerTests; import org.eclipse.jdt.debug.tests.breakpoints.TriggerPointBreakpointsTests; import org.eclipse.jdt.debug.tests.breakpoints.TypeNameBreakpointTests; import org.eclipse.jdt.debug.tests.breakpoints.WatchpointTests; @@ -250,7 +250,9 @@ public class AutomatedSuite extends DebugSuite { addTest(new TestSuite(ClasspathContainerTests.class)); addTest(new TestSuite(RuntimeClasspathEntryTests.class)); addTest(new TestSuite(ClasspathProviderTests.class)); - addTest(new TestSuite(BootpathTests.class)); + if (!JavaProjectHelper.isJava9Compatible()) { + addTest(new TestSuite(BootpathTests.class)); + } addTest(new TestSuite(EEDefinitionTests.class)); //VM Install/Environment tests diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ClasspathContainerTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ClasspathContainerTests.java index 250f578f6..8aa727a1c 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ClasspathContainerTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ClasspathContainerTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -183,6 +183,9 @@ public class ClasspathContainerTests extends AbstractDebugTest { public void testJREContainerIndex() throws Exception { // get the current VM IVMInstall def = JavaRuntime.getDefaultVMInstall(); + if (JavaRuntime.isModularJava(def)) { + return; + } LibraryLocation[] libs = JavaRuntime.getLibraryLocations(def); // generate an index for the first library location only (to save time - do not need an index for all libraries) URL indexURL = this.getIndexForLibrary(libs[0]); @@ -225,6 +228,9 @@ public class ClasspathContainerTests extends AbstractDebugTest { public void testJREContainerIndex2() throws Exception { // get the current VM IVMInstall def = JavaRuntime.getDefaultVMInstall(); + if (JavaRuntime.isModularJava(def)) { + return; + } LibraryLocation[] libs = JavaRuntime.getLibraryLocations(def); // generate an index for the first library location only (to save time - do not need an index for all libraries) URL indexURL = this.getIndexForLibrary(libs[0]); diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java index 947f93d5d..06f626e84 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -233,4 +233,8 @@ public class LaunchingMessages extends NLS { public static String MacInstalledJREs_1; + public static String RunnerBootpathError; + + public static String RunnerBootpathPError; + } diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties index a06cc2945..5a28638f8 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/LaunchingMessages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2013 IBM Corporation and others. +# Copyright (c) 2000, 2017 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -195,3 +195,5 @@ VMDefinitionsContainer_6=Unable to restore Javadoc location for installed JRE '' VMDefinitionsContainer_7=Installed JRE ''{0}'' removed due to missing id. VMDefinitionsContainer_9=Installed JRE of type ''{0}'' removed due to missing install path, name, and id. VMDefinitionsContainer_10=Installed JREs +RunnerBootpathError=Xbootclasspath option have been removed as not supported beyond Java 8. +RunnerBootpathPError=Xbootclasspath/p option have been removed as not supported beyond Java 8.
\ No newline at end of file diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java index d91d665e1..66965c2ce 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMRunner.java @@ -35,6 +35,7 @@ import org.eclipse.jdt.launching.AbstractVMRunner; import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; import org.eclipse.jdt.launching.IVMInstall; import org.eclipse.jdt.launching.IVMInstall2; +import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.launching.VMRunnerConfiguration; import org.eclipse.osgi.util.NLS; @@ -595,18 +596,30 @@ public class StandardVMRunner extends AbstractVMRunner { String[] appendBootCP= null; Map<String, Object> map = config.getVMSpecificAttributesMap(); if (map != null) { - prependBootCP= (String[]) map.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_PREPEND); - bootCP= (String[]) map.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH); + prependBootCP = (String[]) map.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_PREPEND); + bootCP = (String[]) map.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH); + if (JavaRuntime.isModularJava(fVMInstance)) { + if (prependBootCP != null) { + prependBootCP = null; + LaunchingPlugin.log(LaunchingMessages.RunnerBootpathPError); + } + if (bootCP != null) { + bootCP = null; + LaunchingPlugin.log(LaunchingMessages.RunnerBootpathError); + } + } appendBootCP= (String[]) map.get(IJavaLaunchConfigurationConstants.ATTR_BOOTPATH_APPEND); } - if (prependBootCP == null && bootCP == null && appendBootCP == null) { - // use old single attribute instead of new attributes if not specified - bootCP = config.getBootClassPath(); + if (!JavaRuntime.isModularJava(fVMInstance)) { + if (prependBootCP == null && bootCP == null && appendBootCP == null) { + // use old single attribute instead of new attributes if not specified + bootCP = config.getBootClassPath(); + } } - // Bug 497945 -Temporary testing to see if we can launch inner eclipse in Mac after this. - /* - * if (prependBootCP != null) { arguments.add("-Xbootclasspath/p:" + convertClassPath(prependBootCP)); //$NON-NLS-1$ } - */ + if (prependBootCP != null) { + arguments.add("-Xbootclasspath/p:" + convertClassPath(prependBootCP)); //$NON-NLS-1$ + } + if (bootCP != null) { if (bootCP.length > 0) { arguments.add("-Xbootclasspath:" + convertClassPath(bootCP)); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java index 234886e56..1430738ed 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractJavaLaunchConfigurationDelegate.java @@ -238,6 +238,9 @@ public abstract class AbstractJavaLaunchConfigurationDelegate extends LaunchConf */ public String[] getBootpath(ILaunchConfiguration configuration) throws CoreException { + if (JavaRuntime.isModularConfiguration(configuration)) { + return null; + } String[][] paths = getBootpathExt(configuration); String[] pre = paths[0]; String[] main = paths[1]; |
