From 70f715bc87e8cb6657b172130a7ac9c5cb8d5e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Thu, 3 Oct 2024 18:26:26 +0300 Subject: [PATCH] Cleanup deprecated Platform.ARCH_X86 usage Silenced in code to allow targeting older versions. Replaced in tests. --- .../pde/internal/core/product/ArgumentsInfo.java | 2 ++ .../tests/internal/util/PDESchemaHelperTest.java | 12 ++++++------ .../internal/ui/editor/product/ArgumentsSection.java | 1 + .../ui/editor/product/PropertiesSection.java | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java index 2e47b1900f..483654b4ce 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/product/ArgumentsInfo.java @@ -123,6 +123,7 @@ public String getCompleteProgramArguments(String os) { return getCompleteProgramArguments(os, ""); //$NON-NLS-1$ } + @SuppressWarnings("deprecation") @Override public String getCompleteProgramArguments(String os, String arch) { int archIndex = L_ARGS_ARCH_ALL; @@ -217,6 +218,7 @@ public String getCompleteVMArguments(String os) { return getCompleteVMArguments(os, ""); //$NON-NLS-1$ } + @SuppressWarnings("deprecation") @Override public String getCompleteVMArguments(String os, String arch) { int archIndex = L_ARGS_ARCH_ALL; diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/util/PDESchemaHelperTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/util/PDESchemaHelperTest.java index 700cb57819..0e7fc55c70 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/util/PDESchemaHelperTest.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/core/tests/internal/util/PDESchemaHelperTest.java @@ -51,13 +51,13 @@ private void initConfigurationProperties() { property2.setName("osgi.configuration.area"); property2.setValue("/usr/local/share/Eclipse"); property2.setOs(Platform.OS_LINUX); - property2.setArch(Platform.ARCH_X86); + property2.setArch(Platform.ARCH_AARCH64); fConfigurationProperties.add(property2); IConfigurationProperty property3 = fProductModelFactory.createConfigurationProperty(); property3.setName("p1"); property3.setValue("v1"); property3.setOs(PDESchemaHelper.ALL_OS); - property3.setArch(Platform.ARCH_X86); + property3.setArch(Platform.ARCH_X86_64); fConfigurationProperties.add(property3); } @@ -70,12 +70,12 @@ public void testContainsMatchingProperty() { assertTrue(containsMatchingProperty); containsMatchingProperty = PDESchemaHelper.containsMatchingProperty(fConfigurationProperties, - "osgi.configuration.area", Platform.OS_LINUX, Platform.ARCH_X86); + "osgi.configuration.area", Platform.OS_LINUX, Platform.ARCH_AARCH64); assertTrue(containsMatchingProperty); // specific architecture containsMatchingProperty = PDESchemaHelper.containsMatchingProperty(fConfigurationProperties, - "org.osgi.instance.area", Platform.OS_WIN32, Platform.ARCH_X86); + "org.osgi.instance.area", Platform.OS_WIN32, Platform.ARCH_X86_64); assertTrue(containsMatchingProperty); containsMatchingProperty = PDESchemaHelper.containsMatchingProperty(fConfigurationProperties, @@ -89,7 +89,7 @@ public void testContainsMatchingProperty() { // for all os but specific arch containsMatchingProperty = PDESchemaHelper.containsMatchingProperty(fConfigurationProperties, - "org.osgi.instance.area", PDESchemaHelper.ALL_OS, Platform.ARCH_X86); + "org.osgi.instance.area", PDESchemaHelper.ALL_OS, Platform.ARCH_X86_64); assertTrue(containsMatchingProperty); // for different OS @@ -104,7 +104,7 @@ public void testContainsMatchingProperty() { // all os but different architecture containsMatchingProperty = PDESchemaHelper.containsMatchingProperty(fConfigurationProperties, "p1", - PDESchemaHelper.ALL_OS, Platform.ARCH_X86_64); + PDESchemaHelper.ALL_OS, Platform.ARCH_PPC64LE); assertFalse(containsMatchingProperty); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java index d20ccbfac3..c6e47d9d9b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java @@ -50,6 +50,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.Section; +@SuppressWarnings("deprecation") public class ArgumentsSection extends PDESection { private static final String[] TAB_LABELS = new String[4]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java index 50b897fc69..b5992afacb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java @@ -130,6 +130,7 @@ private class PropertyDialog extends StatusDialog { private final String[] COMBO_OSLABELS = new String[] { PDEUIMessages.PropertiesSection_All, Platform.OS_LINUX, Platform.OS_MACOSX, Platform.OS_WIN32 }; + @SuppressWarnings("deprecation") private final String[] COMBO_ARCHLABELS = new String[] { PDEUIMessages.PropertiesSection_All, Platform.ARCH_X86, Platform.ARCH_X86_64 };