Skip to content

Commit

Permalink
Use new Platform.OS API to determine the running platform
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell authored and noopur2507 committed Dec 17, 2024
1 parent c0bc3a9 commit 4dc72d8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private List<String> 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;
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ public TypeInfoUtil(ITypeInfoImageProvider extension) {

private void processVMInstallType(IVMInstallType installType, List<IPath> locations, List<String> 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();
Expand Down Expand Up @@ -1116,7 +1116,7 @@ public TypeItemsComparator() {

private void processVMInstallType(IVMInstallType installType, List<String> locations, List<String> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4dc72d8

Please sign in to comment.