Skip to content

Commit

Permalink
Cleanup deprecated Platform.ARCH_X86 usage
Browse files Browse the repository at this point in the history
Silenced in code to allow targeting older versions. Replaced in tests.
  • Loading branch information
akurtakov committed Oct 4, 2024
1 parent 8bb1847 commit 3fabfe7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down

0 comments on commit 3fabfe7

Please sign in to comment.