diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java index 0916866263..ae3ae33ffe 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java @@ -2661,7 +2661,7 @@ protected IJavaVariable findVariable(IJavaStackFrame frame, String name) throws * @return true if the local filesystem is case-sensitive, false otherwise */ protected boolean isFileSystemCaseSensitive() { - return Platform.OS_MACOSX.equals(Platform.getOS()) ? false : new File("a").compareTo(new File("A")) != 0; //$NON-NLS-1$ //$NON-NLS-2$ + return Platform.OS.isMac() ? false : new File("a").compareTo(new File("A")) != 0; //$NON-NLS-1$ //$NON-NLS-2$ } /** 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 a1c4b892bd..59644e581a 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 @@ -204,7 +204,7 @@ public AutomatedSuite() { addTest(new TestSuite(ProjectClasspathVariableTests.class)); //mac specific tests - if(Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { addTest(new TestSuite(PListParserTests.class)); } 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 dc23d482ce..a049fe5aa6 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 @@ -148,7 +148,7 @@ public void testCanUpdate() throws CoreException { public void testLibraryCaseSensitivity() { IVMInstall def = JavaRuntime.getDefaultVMInstall(); LibraryLocation[] libs = JavaRuntime.getLibraryLocations(def); - boolean caseSensitive = !Platform.getOS().equals(Platform.WS_WIN32); + boolean caseSensitive = !Platform.OS.isWindows(); LibraryLocation[] set1 = new LibraryLocation[libs.length]; LibraryLocation[] set2 = new LibraryLocation[libs.length]; for (int i = 0; i < libs.length; i++) { diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java index 8f10847acb..e081d9fb40 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ConsoleInputTests.java @@ -273,7 +273,7 @@ private void waitStarted() throws InterruptedException { } } assertNotNull("Console is null", fConsole); - if (Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { // on OSX java process writes unexpected message to stderr due to https://bugs.openjdk.java.net/browse/JDK-8022291 // need to wait for the message to fully appear so it can be filtered in #lineAppended above Thread.sleep(1000L); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EnvironmentTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EnvironmentTests.java index 81d4f3c7be..d459d757ae 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EnvironmentTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EnvironmentTests.java @@ -24,7 +24,6 @@ import org.eclipse.debug.core.ILaunchManager; import org.eclipse.jdt.debug.tests.AbstractDebugTest; import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; -import org.eclipse.osgi.service.environment.Constants; public class EnvironmentTests extends AbstractDebugTest { @@ -36,8 +35,7 @@ public EnvironmentTests(String name) { * Tests that we resolve environment variables as case insenitive on Windows. */ public void testWinOSCaseInsensitiveVariable() throws Exception { - boolean win32= Platform.getOS().equals(Constants.OS_WIN32); - if (win32) { + if (Platform.OS.isWindows()) { IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); String path1 = manager.performStringSubstitution("${env_var:pAth}"); String path2 = manager.performStringSubstitution("${env_var:PaTh}"); @@ -49,8 +47,7 @@ public void testWinOSCaseInsensitiveVariable() throws Exception { * Test that we can override a variable in a case insensitive way on Windows */ public void testWinOSCaseInsensitiveOverride() throws Exception { - boolean win32= Platform.getOS().equals(Constants.OS_WIN32); - if (win32) { + if (Platform.OS.isWindows()) { ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION); ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, "testWinOSCaseInsensitiveOverride"); Map override = new HashMap<>(); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaOutputHelpers.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaOutputHelpers.java index 57073f8e49..153283595d 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaOutputHelpers.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/JavaOutputHelpers.java @@ -26,7 +26,7 @@ public class JavaOutputHelpers { * */ public static boolean isKnownExtraneousOutput(String txt) { - if (!Platform.OS_MACOSX.equals(Platform.getOS())) { + if (!Platform.OS.isMac()) { return false; } diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ProcessTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ProcessTests.java index 7454fdaa15..988784404d 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ProcessTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ProcessTests.java @@ -63,7 +63,7 @@ public void testExitValueNormal() throws Exception { * wrapped in an IProcess. */ public void testAlreadyTerminatedProcess() throws Exception { - if (Platform.getOS().equals(Platform.OS_LINUX)) { + if (Platform.OS.isLinux()) { return; } Process process = DebugPlugin.exec(new String[]{"java"}, null); 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 b260cd5abf..4abb1fc1d5 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 @@ -148,7 +148,7 @@ public void testLibraryResolver2() throws Exception { VMInstallTestsLibraryLocationResolver.isTesting = true; try { String filename = "/testfiles/test-jre/bin/test-resolver.ee"; - if(Platform.OS_WIN32.equals(Platform.getOS())) { + if (Platform.OS.isWindows()) { filename = "/testfiles/test-jre/bin/test-resolver-win32.ee"; } VMStandin vm = getEEStandin(filename); @@ -195,7 +195,7 @@ public void testLibraryResolver4() throws Exception { VMInstallTestsLibraryLocationResolver.isTesting = true; try { String filename = "/testfiles/test-jre/bin/test-resolver2.ee"; - if(Platform.OS_WIN32.equals(Platform.getOS())) { + if (Platform.OS.isWindows()) { filename = "/testfiles/test-jre/bin/test-resolver-win32-2.ee"; } VMStandin vm = getEEStandin(filename); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/SyntheticVariableTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/SyntheticVariableTests.java index b7d3b05fe1..8e1ceef82f 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/SyntheticVariableTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/eval/SyntheticVariableTests.java @@ -99,7 +99,7 @@ public void testEvaluateMethodParameter_DeepInTwoNestedClasses() throws Exceptio } public void testCompleteMethodParameter_DeepInTwoNestedClasses() throws Exception { - if (Platform.getOS().equals(Platform.OS_MACOSX)) { + if (Platform.OS.isMac()) { return; } addClasses(); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongClassPathTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongClassPathTests.java index 5d87a87e7f..78db41a911 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongClassPathTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongClassPathTests.java @@ -13,9 +13,7 @@ *******************************************************************************/ package org.eclipse.jdt.debug.tests.launching; -import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assume.assumeFalse; -import static org.junit.Assume.assumeThat; import static org.junit.Assume.assumeTrue; import java.io.File; @@ -77,7 +75,7 @@ public static Test suite() { suite.addTest(new LongClassPathTests("testVeryLongClasspathWithClasspathOnlyJar")); if (JavaProjectHelper.isJava9Compatible()) { suite.addTest(new LongClassPathTests("testVeryLongClasspathWithArgumentFile")); - } else if (Platform.getOS().equals(Platform.OS_WIN32)) { + } else if (Platform.OS.isWindows()) { suite.addTest(new LongClassPathTests("testVeryLongClasspathWithEnvironmentVariable")); } return suite; @@ -129,7 +127,7 @@ public void testVeryLongClasspathWithClasspathOnlyJar() throws Exception { resumeAndExit(thread); // Then - if (!Platform.getOS().equals(Platform.OS_WIN32)) { + if (!Platform.OS.isWindows()) { // On windows, temp file deletion may fail assertFalse(tempFile.exists()); } @@ -161,7 +159,7 @@ public void testVeryLongClasspathWithArgumentFile() throws Exception { resumeAndExit(thread); // Then - if (!Platform.getOS().equals(Platform.OS_WIN32)) { + if (!Platform.OS.isWindows()) { // On windows, temp file deletion may fail assertFalse(tempFile.exists()); } @@ -171,7 +169,7 @@ public void testVeryLongClasspathWithArgumentFile() throws Exception { * On Windows, for JVM < 9, the CLASSPATH env variable is used if classpath is too long */ public void testVeryLongClasspathWithEnvironmentVariable() throws Exception { - assumeThat(Platform.getOS(), equalTo(Platform.OS_WIN32)); + assumeTrue("Not on Windows", Platform.OS.isWindows()); // Given javaProject = createJavaProjectClone("testVeryLongClasspath", CLASSPATH_PROJECT_CONTENT_PATH.toString(), JavaProjectHelper.JAVA_SE_1_6_EE_NAME, true); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongCommandLineTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongCommandLineTests.java index c51039d2f7..7c85f0b06a 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongCommandLineTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongCommandLineTests.java @@ -75,7 +75,7 @@ public void testVeryLongSystemPropertiesWithArgumentFile() throws Exception { resumeAndExit(thread); // Then - if (!Platform.getOS().equals(Platform.OS_WIN32)) { + if (!Platform.OS.isWindows()) { // On windows, temp file deletion may fail assertFalse(tempFile.exists()); } diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java index 7706047fb1..f8f814dbcf 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java @@ -82,7 +82,7 @@ protected void tearDown() throws Exception { */ public void testVeryLongModulepathWithArgumentFile() throws Exception { - if (!Platform.getOS().equals(Platform.OS_WIN32)) { + if (!Platform.OS.isWindows()) { return; } // Given @@ -107,7 +107,7 @@ public void testVeryLongModulepathWithArgumentFile() throws Exception { resumeAndExit(thread); // Then - if (!Platform.getOS().equals(Platform.OS_WIN32)) { + if (!Platform.OS.isWindows()) { // On windows, temp file deletion may fail assertFalse(tempFile.exists()); } diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceContainerTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceContainerTests.java index c17f46b114..c37f970f8f 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceContainerTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/sourcelookup/DirectorySourceContainerTests.java @@ -112,7 +112,7 @@ public void testCaseSensitiveQualifiedSourceLookup() throws Exception { } else { // case insensitive - should find the file assertEquals("Expected 1 result", 1, objects.length); - if (Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { assertEquals("Wrong file", new File(container.getDirectory(), "oRg/eClIpSe/dEbUg/tEsTs/tArGeTs/INfInItELOop.jaVa"), ((LocalFileStorage)objects[0]).getFile()); } else { assertEquals("Wrong file", new File(container.getDirectory(), "org/eclipse/debug/tests/targets/InfiniteLoop.java"), ((LocalFileStorage)objects[0]).getFile()); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/AbstractDebugViewTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/AbstractDebugViewTests.java index a73f3f0184..564cde63b5 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/AbstractDebugViewTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/AbstractDebugViewTests.java @@ -152,7 +152,7 @@ protected void assertStackFrameIsSelected(String breakpointMethodName) throws Ex TreeItem[] selected = getSelectedItemsFromDebugView(true); Object[] selectedText = selectedText(selected); if (selected.length != 1) { - if (Platform.getOS().equals(Platform.OS_MACOSX)) { + if (Platform.OS.isMac()) { // skip this test on Mac - see bug 516024 return; } diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/DebugViewTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/DebugViewTests.java index 5f6c49aa9e..71afcf3920 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/DebugViewTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/ui/DebugViewTests.java @@ -71,7 +71,7 @@ public void testLastStackElementShown() throws Exception { TreeItem[] selected = getSelectedItemsFromDebugView(true); Object[] selectedText = selectedText(selected); if (selected.length != 1) { - if (Platform.getOS().equals(Platform.OS_MACOSX)) { + if (Platform.OS.isMac()) { // skip this test on Mac - see bug 516024 return; } diff --git a/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF index 06269ace2e..553323a709 100644 --- a/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF @@ -43,7 +43,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)", org.eclipse.jdt.debug;bundle-version="[3.21.0,4.0.0)", org.eclipse.jdt.launching;bundle-version="[3.23.0,4.0.0)", org.eclipse.jdt.ui;bundle-version="[3.33.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)", + org.eclipse.core.runtime;bundle-version="[3.30.0,4.0.0)", org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.0.0)", org.eclipse.ui.console;bundle-version="[3.4.0,4.0.0)", org.eclipse.jdt.core.manipulation;bundle-version="[1.16.0,2.0.0)", diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java index 0ad071a266..a68f43ce0d 100644 --- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java +++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/jres/InstalledJREsBlock.java @@ -881,7 +881,7 @@ protected void search() { dialog.setText(JREMessages.InstalledJREsBlock_10); String path = null; - if (Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { String MAC_JAVA_SEARCH_PATH = "/Library/Java/JavaVirtualMachines"; //$NON-NLS-1$ dialog.setFilterPath(MAC_JAVA_SEARCH_PATH); path = dialog.open(); diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java index a3f71c614b..3f7855d406 100644 --- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java +++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/launcher/VMArgumentsBlock.java @@ -105,7 +105,7 @@ public void widgetSelected(SelectionEvent e) { } }); - if(Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { fUseStartOnFirstThread = SWTFactory.createCheckButton(group, LauncherMessages.VMArgumentsBlock_0, null, false, 1); fUseStartOnFirstThread.addSelectionListener(new SelectionAdapter() { @Override diff --git a/org.eclipse.jdt.launching/META-INF/MANIFEST.MF b/org.eclipse.jdt.launching/META-INF/MANIFEST.MF index 71435c3e1d..b822db2f20 100644 --- a/org.eclipse.jdt.launching/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.launching/META-INF/MANIFEST.MF @@ -19,7 +19,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)", org.eclipse.debug.core;bundle-version="[3.22.0,4.0.0)", org.eclipse.jdt.debug;bundle-version="[3.21.0,4.0.0)", org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)", + org.eclipse.core.runtime;bundle-version="[3.30.0,4.0.0)", org.eclipse.osgi;bundle-version="[3.8.0,4.0.0)", org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)" Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CommandLineQuoting.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CommandLineQuoting.java index 9ca92a78b1..3b9ccdb2cb 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CommandLineQuoting.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/CommandLineQuoting.java @@ -1,7 +1,6 @@ package org.eclipse.jdt.internal.launching; import org.eclipse.core.runtime.Platform; -import org.eclipse.osgi.service.environment.Constants; /** * Utility for quoting of command line Arguments @@ -14,7 +13,7 @@ private CommandLineQuoting() { public static String[] quoteWindowsArgs(String[] cmdLine) { // see https://bugs.eclipse.org/387504 , workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511002 - if (Platform.getOS().equals(Constants.OS_WIN32)) { + if (Platform.OS.isWindows()) { String[] winCmdLine = new String[cmdLine.length]; if (cmdLine.length > 0) { winCmdLine[0] = cmdLine[0]; diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java index 119a2cb4bc..7a0b9c15e3 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/DetectVMInstallationsJob.java @@ -63,7 +63,7 @@ public IStatus run(IProgressMonitor monitor) { candidates.removeIf(knownVMs::contains); Collection systemVMs = Collections.EMPTY_LIST; // for MacOS, system installed VMs need a special command to locate - if (Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { try { systemVMs = new ArrayList<>(Arrays.asList(MacInstalledJREs.getInstalledJREs(monitor))); systemVMs.removeIf(t -> knownVMs.contains(t.getInstallLocation())); @@ -130,7 +130,7 @@ private boolean isDuplicateName(String name) { private Collection computeCandidateVMs(StandardVMType standardType) { // parent directories containing a collection of VM installations Collection rootDirectories = new HashSet<>(); - if (Platform.OS_WIN32.equals(Platform.getOS())) { + if (Platform.OS.isWindows()) { computeWindowsCandidates(rootDirectories); } else { rootDirectories.add(new File("/usr/lib/jvm")); //$NON-NLS-1$ @@ -187,7 +187,7 @@ private static File miseDataDir() { private static File xdgDataHome() { String xdgDataHome = System.getenv("XDG_DATA_HOME"); //$NON-NLS-1$ - if (Platform.OS_WIN32.equals(Platform.getOS())) { + if (Platform.OS.isWindows()) { if (xdgDataHome == null) { xdgDataHome = System.getenv("LOCALAPPDATA"); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JRERuntimeClasspathEntryResolver.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JRERuntimeClasspathEntryResolver.java index f3bc7e9203..707a63710f 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JRERuntimeClasspathEntryResolver.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JRERuntimeClasspathEntryResolver.java @@ -155,7 +155,7 @@ public static boolean isSameArchives(LibraryLocation[] libs, LibraryLocation[] d for (int i = 0; i < defaultLibs.length; i++) { dpath = defaultLibs[i].getSystemLibraryPath(); lpath = libs[i].getSystemLibraryPath(); - if(Platform.getOS().equals(Platform.OS_WIN32)) { + if (Platform.OS.isWindows()) { //the .equals method of IPath ignores trailing separators so we must as well if (!dpath.removeTrailingSeparator().toOSString().equalsIgnoreCase(lpath.removeTrailingSeparator().toOSString())) { return false; diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java index bd09c2fa70..7df5298a8b 100644 --- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java +++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java @@ -485,7 +485,7 @@ public void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor m * @since 3.3 */ protected String[] prependJREPath(String[] env, IPath jdkpath) { - if(Platform.OS_WIN32.equals(Platform.getOS())) { + if (Platform.OS.isWindows()) { IPath jrepath = jdkpath.removeLastSegments(1); if(jrepath.lastSegment().equals(BIN)) { int count = jrepath.segmentCount(); 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 f510a704f0..7007a5b8ce 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 @@ -158,7 +158,7 @@ protected String[] validateCommandLine(ILaunchConfiguration configuration, Strin * @return the (possibly) modified command line to launch with */ private String[] wrap(ILaunchConfiguration config, String[] cmdLine) throws CoreException { - if(config != null && Platform.OS_MACOSX.equals(Platform.getOS())) { + if (config != null && Platform.OS.isMac()) { for (String element : cmdLine) { if ("-ws".equals(element) || element.contains("swt.jar") || element.contains("org.eclipse.swt")) { //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ return createSWTlauncher(cmdLine, @@ -593,7 +593,7 @@ int getCPIndex(String[] env) { * @since 3.3 */ protected String[] prependJREPath(String[] env) { - if (Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { if (fVMInstance instanceof IVMInstall2 vm) { String javaVersion = vm.getJavaVersion(); if (javaVersion != null) { 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 d1f35899cc..d342b1678d 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 @@ -272,7 +272,7 @@ protected String getVMVersion(File javaHome, File javaExecutable) { @Override public File detectInstallLocation() { // We want a Mac OSX VM install so don't process the install location for this type - if(Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { return null; } return getJavaHomeLocation(); @@ -677,7 +677,7 @@ protected LibraryInfo generateLibraryInfo(File javaHome, File javaExecutable) { Process p = null; try { String envp[] = null; - if (Platform.OS_MACOSX.equals(Platform.getOS())) { + if (Platform.OS.isMac()) { Map map = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved(); if (map.remove(StandardVMDebugger.JAVA_JVM_VERSION) != null) { envp = new String[map.size()];