From ade30dabeecd0aee5b3d1b3749434452a7ad4794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sat, 20 Dec 2025 06:58:03 +0100 Subject: [PATCH 1/2] Return Platform.OS_UNKNOWN in case of null In some cases the return value of Platform.getOS() can be return null but its API doc states it return Platform.OS_UNKNOWN is the OS can not be found. Fix https://github.com/eclipse-platform/eclipse.platform.ui/issues/3604 --- .../org/eclipse/core/internal/runtime/InternalPlatform.java | 6 +++++- .../src/org/eclipse/core/runtime/Platform.java | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java index 7148f259a8d..e4ba969794e 100644 --- a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java +++ b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java @@ -471,7 +471,11 @@ public String getOption(String option) { } public String getOS() { - return getContextProperty(PROP_OS); + String property = getContextProperty(PROP_OS); + if (property == null) { + return Platform.OS_UNKNOWN; + } + return property; } public String getWS() { diff --git a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java index 65bd5f2ac11..5cadd28ba70 100644 --- a/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java +++ b/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Platform.java @@ -22,6 +22,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.MissingResourceException; +import java.util.Objects; import java.util.ResourceBundle; import org.eclipse.core.internal.runtime.AuthorizationHandler; import org.eclipse.core.internal.runtime.InternalPlatform; @@ -79,7 +80,7 @@ private OS() { * @since 3.30 */ public static boolean is(String osString) { - return Platform.getOS().equals(osString); + return Objects.equals(Platform.getOS(), osString); } /** From 26a8b12d6ae14610c890fdfc92384ad26e90c8ac Mon Sep 17 00:00:00 2001 From: Eclipse Platform Bot Date: Sat, 20 Dec 2025 08:41:26 +0000 Subject: [PATCH 2/2] Version bump(s) for 4.39 stream --- runtime/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF b/runtime/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF index 1eeb53d089c..7ad1e9e8a7b 100644 --- a/runtime/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF +++ b/runtime/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName -Bundle-Version: 3.34.100.qualifier +Bundle-Version: 3.34.200.qualifier Bundle-SymbolicName: org.eclipse.core.runtime; singleton:=true Bundle-Vendor: %providerName Bundle-Activator: org.eclipse.core.internal.runtime.PlatformActivator