Skip to content

Commit

Permalink
Stop using deprecated Platform.ARCH_X86
Browse files Browse the repository at this point in the history
Replaced with AARCH64 in easy places as it's the other universally
available platform now. Others that requires more additions are simply
removed as more sophisticated
  • Loading branch information
akurtakov committed Oct 3, 2024
1 parent 151075f commit b6d77b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ public String getCompleteProgramArguments(String os) {
public String getCompleteProgramArguments(String os, String arch) {
int archIndex = L_ARGS_ARCH_ALL;
if (arch != null && arch.length() > 0) {
if (Platform.ARCH_X86.equals(arch)) {
archIndex = L_ARGS_ARCH_X86;
} else if (Platform.ARCH_X86_64.equals(arch)) {
if (Platform.ARCH_X86_64.equals(arch)) {
archIndex = L_ARGS_ARCH_X86_64;
}
}
Expand Down Expand Up @@ -221,9 +219,7 @@ public String getCompleteVMArguments(String os) {
public String getCompleteVMArguments(String os, String arch) {
int archIndex = L_ARGS_ARCH_ALL;
if (arch != null && arch.length() > 0) {
if (Platform.ARCH_X86.equals(arch)) {
archIndex = L_ARGS_ARCH_X86;
} else if (Platform.ARCH_X86_64.equals(arch)) {
if (Platform.ARCH_X86_64.equals(arch)) {
archIndex = L_ARGS_ARCH_X86_64;
}
}
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 @@ -63,7 +63,6 @@ public class ArgumentsSection extends PDESection {
private static final String[] TAB_ARCHLABELS = new String[8];
static {
TAB_ARCHLABELS[IArgumentsInfo.L_ARGS_ALL] = PDEUIMessages.ArgumentsSection_allArch;
TAB_ARCHLABELS[IArgumentsInfo.L_ARGS_ARCH_X86] = Platform.ARCH_X86;
TAB_ARCHLABELS[IArgumentsInfo.L_ARGS_ARCH_X86_64] = Platform.ARCH_X86_64;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ private class PropertyDialog extends StatusDialog {

private final String[] COMBO_OSLABELS = new String[] { PDEUIMessages.PropertiesSection_All, Platform.OS_LINUX,
Platform.OS_MACOSX, Platform.OS_WIN32 };
private final String[] COMBO_ARCHLABELS = new String[] { PDEUIMessages.PropertiesSection_All, Platform.ARCH_X86,
Platform.ARCH_X86_64 };
private final String[] COMBO_ARCHLABELS = new String[] { PDEUIMessages.PropertiesSection_All,
Platform.ARCH_X86_64, Platform.ARCH_AARCH64 };

public PropertyDialog(Shell shell, IConfigurationProperty property,
Set<IConfigurationProperty> existingProperties) {
Expand Down

0 comments on commit b6d77b2

Please sign in to comment.