From 4dc72d8c0d1ea3ca58656c098ecd178269a0695a Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Sun, 15 Dec 2024 11:01:47 +0100 Subject: [PATCH] Use new Platform.OS API to determine the running platform --- .../jdt/ui/tests/refactoring/RenameTypeTests.java | 2 +- .../org/eclipse/jdt/ui/tests/chkpii/ChkpiiTests.java | 11 +---------- .../AdvancedJUnitLaunchConfigurationDelegateTest.java | 2 +- org.eclipse.jdt.ui/META-INF/MANIFEST.MF | 2 +- .../jdt/internal/ui/dialogs/TypeInfoViewer.java | 2 +- .../ui/dialogs/FilteredTypesSelectionDialog.java | 4 ++-- .../ui/javaeditor/breadcrumb/EditorBreadcrumb.java | 2 +- 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenameTypeTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenameTypeTests.java index a86c3cd784e..df2c40f8274 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenameTypeTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenameTypeTests.java @@ -299,7 +299,7 @@ public void testIllegalTypeName8() throws Exception { @Test public void testIllegalTypeName9() throws Exception { - if (Platform.OS_WIN32.equals(Platform.getOS())) + if (Platform.OS.isWindows()) helper1_0("A", "aux"); } diff --git a/org.eclipse.jdt.ui.tests/chkpii/org/eclipse/jdt/ui/tests/chkpii/ChkpiiTests.java b/org.eclipse.jdt.ui.tests/chkpii/org/eclipse/jdt/ui/tests/chkpii/ChkpiiTests.java index ace41d22317..00c7dd27910 100644 --- a/org.eclipse.jdt.ui.tests/chkpii/org/eclipse/jdt/ui/tests/chkpii/ChkpiiTests.java +++ b/org.eclipse.jdt.ui.tests/chkpii/org/eclipse/jdt/ui/tests/chkpii/ChkpiiTests.java @@ -33,8 +33,6 @@ import org.junit.Test; import org.junit.rules.TestName; -import org.eclipse.osgi.service.environment.Constants; - import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; @@ -255,14 +253,7 @@ private String getExec() { } private String getExcludeErrors() { - - String fileName; - - if (Constants.OS_WIN32.equals(Platform.getOS())) - fileName= "ignoreErrorsWindows.txt"; //$NON-NLS-1$ - else - fileName= "ignoreErrorsUnix.txt"; //$NON-NLS-1$ - + String fileName= Platform.OS.isWindows() ? "ignoreErrorsWindows.txt" : "ignoreErrorsUnix.txt"; //$NON-NLS-1$ //$NON-NLS-2$ return toLocation(getClass().getResource(fileName)); } diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/launcher/AdvancedJUnitLaunchConfigurationDelegateTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/launcher/AdvancedJUnitLaunchConfigurationDelegateTest.java index 7d50ae7d127..bd340fae95a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/launcher/AdvancedJUnitLaunchConfigurationDelegateTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/launcher/AdvancedJUnitLaunchConfigurationDelegateTest.java @@ -200,7 +200,7 @@ private List showCommandLineAndExtractContentOfTestNameFile(String proje private String extractPathForArgumentFile(String showCommandLine, String firstSearchStr, int indexTestNameFile) { String filePath= showCommandLine.substring(indexTestNameFile + firstSearchStr.length() + 1); - if (Platform.OS_WIN32.equals(Platform.getOS())) { + if (Platform.OS.isWindows()) { filePath = removeQuotationMarks(filePath); } return filePath; diff --git a/org.eclipse.jdt.ui/META-INF/MANIFEST.MF b/org.eclipse.jdt.ui/META-INF/MANIFEST.MF index e305e62874b..0e4f86e1437 100644 --- a/org.eclipse.jdt.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.ui/META-INF/MANIFEST.MF @@ -113,7 +113,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.15.0,4.0.0)", org.eclipse.ui.views;bundle-version="[3.3.100,4.0.0)", org.eclipse.ui.editors;bundle-version="[3.5.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.7.0,4.0.0)", org.eclipse.ltk.ui.refactoring;bundle-version="[3.12.0,4.0.0)", org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)", diff --git a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java index a671973cd94..54ca4ec1239 100644 --- a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java +++ b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java @@ -242,7 +242,7 @@ public void setFullyQualifyDuplicates(boolean value) { } private void processVMInstallType(IVMInstallType installType, List locations, List labels) { if (installType != null) { - boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS()); + boolean isMac= Platform.OS.isMac(); final String HOME_SUFFIX= "/Home"; //$NON-NLS-1$ for (IVMInstall install : installType.getVMInstalls()) { String label= getFormattedLabel(install.getName()); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java index 582868d6b45..ebdd5f03b46 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java @@ -810,7 +810,7 @@ public TypeInfoUtil(ITypeInfoImageProvider extension) { private void processVMInstallType(IVMInstallType installType, List locations, List labels) { if (installType != null) { - boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS()); + boolean isMac= Platform.OS.isMac(); for (IVMInstall install : installType.getVMInstalls()) { String label= getFormattedLabel(install.getName()); LibraryLocation[] libLocations = install.getLibraryLocations(); @@ -1116,7 +1116,7 @@ public TypeItemsComparator() { private void processVMInstallType(IVMInstallType installType, List locations, List labels) { if (installType != null) { - boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS()); + boolean isMac= Platform.OS.isMac(); final String HOME_SUFFIX= "/Home"; //$NON-NLS-1$ for (IVMInstall install : installType.getVMInstalls()) { String label = getFormattedLabel(install.getName()); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/breadcrumb/EditorBreadcrumb.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/breadcrumb/EditorBreadcrumb.java index 9ee7873b688..ac45b5d55d3 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/breadcrumb/EditorBreadcrumb.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/breadcrumb/EditorBreadcrumb.java @@ -282,7 +282,7 @@ public Control createContent(Composite parent) { if (menu != null && !menu.isDisposed() && menu.getDisplay() != null - && Platform.OS_WIN32.equals(Platform.getOS())) { + && Platform.OS.isWindows()) { menu.getDisplay().readAndDispatch(); } actionGroup.dispose();