1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Bug 564123 Treat environment and build variable case sensitively

Remove all equalIgnoreCase and equal with uppercasing for environment
variables

Change-Id: Ic15974b5fb62413c7b1826ced544ff6d4a8eba2f
Signed-off-by: jantje <eclipse@baeyens.it>
This commit is contained in:
jantje 2020-06-19 15:35:27 +02:00 committed by Jonah Graham
parent 09582630d7
commit 2a62d58621
30 changed files with 61 additions and 157 deletions

View file

@ -19,7 +19,6 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable; import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier; import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider; import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.core.runtime.Platform;
/** /**
* Supplies some default environment variables for the Autotools toolchain. For * Supplies some default environment variables for the Autotools toolchain. For
@ -40,10 +39,7 @@ public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvir
} }
private static boolean isVar(String name) { private static boolean isVar(String name) {
// Windows has case insensitive env var names return name.equals(VerboseEnvironmentVariable.VERBOSE_VAR_NAME);
return Platform.getOS().equals(Platform.OS_WIN32)
? name.equalsIgnoreCase(VerboseEnvironmentVariable.VERBOSE_VAR_NAME)
: name.equals(VerboseEnvironmentVariable.VERBOSE_VAR_NAME);
} }
private static IBuildEnvironmentVariable create() { private static IBuildEnvironmentVariable create() {

View file

@ -122,7 +122,7 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
IEnvironmentVariable pathVar = null; IEnvironmentVariable pathVar = null;
if (envVars != null) { if (envVars != null) {
for (IEnvironmentVariable envVar : envVars) { for (IEnvironmentVariable envVar : envVars) {
if (envVar.getName().equalsIgnoreCase("PATH")) { //$NON-NLS-1$ if (envVar.getName().equals("PATH")) { //$NON-NLS-1$
pathVar = envVar; pathVar = envVar;
} }
} }

View file

@ -46,7 +46,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences; import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin; import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.osgi.service.environment.Constants;
public class BuildInfoFactory { public class BuildInfoFactory {
@ -115,14 +114,8 @@ public class BuildInfoFactory {
public Map<String, String> getExpandedEnvironment() { public Map<String, String> getExpandedEnvironment() {
Map<String, String> env = getEnvironment(); Map<String, String> env = getEnvironment();
HashMap<String, String> envMap = new HashMap<>(env.entrySet().size()); HashMap<String, String> envMap = new HashMap<>(env.entrySet().size());
boolean win32 = Platform.getOS().equals(Constants.OS_WIN32);
for (Map.Entry<String, String> entry : env.entrySet()) { for (Map.Entry<String, String> entry : env.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
if (win32) {
// Win32 vars are case insensitive. Uppercase everything so
// that (for example) "pAtH" will correctly replace "PATH"
key = key.toUpperCase();
}
String value = entry.getValue(); String value = entry.getValue();
// translate any string substitution variables // translate any string substitution variables
String translated = value; String translated = value;

View file

@ -33,11 +33,9 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.core.runtime.SubMonitor; import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.variables.VariablesPlugin; import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.osgi.service.environment.Constants;
public class MakeTarget extends PlatformObject implements IMakeTarget { public class MakeTarget extends PlatformObject implements IMakeTarget {
private final static int USE_PROJECT_ENV_SETTING = 3; private final static int USE_PROJECT_ENV_SETTING = 3;
@ -245,14 +243,8 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
} }
HashMap<String, String> envMap = new HashMap<>(env.entrySet().size()); HashMap<String, String> envMap = new HashMap<>(env.entrySet().size());
boolean win32 = Platform.getOS().equals(Constants.OS_WIN32);
for (Entry<String, String> entry : env.entrySet()) { for (Entry<String, String> entry : env.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
if (win32) {
// Win32 vars are case insensitive. Uppercase everything so
// that (for example) "pAtH" will correctly replace "PATH"
key = key.toUpperCase();
}
String value = entry.getValue(); String value = entry.getValue();
// translate any string substitution variables // translate any string substitution variables
String translated = value; String translated = value;

View file

@ -14,11 +14,11 @@
package org.eclipse.cdt.managedbuilder.core.tests; package org.eclipse.cdt.managedbuilder.core.tests;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.testplugin.ResourceHelper; import org.eclipse.cdt.core.testplugin.ResourceHelper;
import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedProject; import org.eclipse.cdt.managedbuilder.core.IManagedProject;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentBuildPathsChangeListener; import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentBuildPathsChangeListener;
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider; import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -85,12 +85,12 @@ public class ManagedBuildEnvironmentTests extends TestCase {
doInit(); doInit();
IConfiguration cfg = mproj.getConfigurations()[0]; IConfiguration cfg = mproj.getConfigurations()[0];
// CWD/PWD vars should NOT be overwritten anywhere // CWD/PWD vars should NOT be overwritten anywhere
IBuildEnvironmentVariable a = envProvider.getVariable(NAME_CWD, cfg, true, false); IEnvironmentVariable a = envProvider.getVariable(NAME_CWD, cfg, false);
assertNotNull(a); assertNotNull(a);
if (VAL_CWDPWD.equals(a.getValue())) if (VAL_CWDPWD.equals(a.getValue()))
fail("CWD should not be rewritten !"); //$NON-NLS-1$ fail("CWD should not be rewritten !"); //$NON-NLS-1$
a = envProvider.getVariable(NAME_PWD, cfg, true, false); a = envProvider.getVariable(NAME_PWD, cfg, false);
assertNotNull(a); assertNotNull(a);
if (VAL_CWDPWD.equals(a.getValue())) if (VAL_CWDPWD.equals(a.getValue()))
fail("PWD should not be rewritten !"); //$NON-NLS-1$ fail("PWD should not be rewritten !"); //$NON-NLS-1$
@ -128,28 +128,20 @@ public class ManagedBuildEnvironmentTests extends TestCase {
public void testEnvGetParams() { public void testEnvGetParams() {
doInit(); doInit();
IEnvironmentVariableProvider envProvider = ManagedBuildManager.getEnvironmentVariableProvider(); IEnvironmentVariableProvider envProvider = ManagedBuildManager.getEnvironmentVariableProvider();
IBuildEnvironmentVariable x = null;
IBuildEnvironmentVariable y = null; // if "path" and "PATH" exist they should be equal
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) { //$NON-NLS-1$ //$NON-NLS-2$ IEnvironmentVariable x = envProvider.getVariable("PATH", mproj.getConfigurations()[0], false);
assertEquals(envProvider.getDefaultDelimiter(), DEL_WIN); IEnvironmentVariable y = envProvider.getVariable("path", mproj.getConfigurations()[0], false);
assertFalse(envProvider.isVariableCaseSensitive());
// these var instances are different although contents is equal.
x = envProvider.getVariable("PATH", mproj.getConfigurations()[0], true, false);
assertNotNull(x); assertNotNull(x);
y = envProvider.getVariable("path", mproj.getConfigurations()[0], true, false);
assertNotNull(y);
assertEquals(x.getName(), y.getName());
assertEquals(x.getValue(), y.getValue());
} else {
assertEquals(envProvider.getDefaultDelimiter(), DEL_UNIX);
assertTrue(envProvider.isVariableCaseSensitive());
// "path" is different var (may absent);
x = envProvider.getVariable("PATH", mproj.getConfigurations()[0], true, false);
assertNotNull(x);
y = envProvider.getVariable("path", mproj.getConfigurations()[0], true, false);
if (y != null) { if (y != null) {
assertFalse(x.getName().equals(y.getName())); assertFalse(x.getName().equals(y.getName()));
} }
if (System.getProperty("os.name").toLowerCase().startsWith("windows")) { //$NON-NLS-1$ //$NON-NLS-2$
assertEquals(envProvider.getDefaultDelimiter(), DEL_WIN);
} else {
assertEquals(envProvider.getDefaultDelimiter(), DEL_UNIX);
} }
} }
@ -158,18 +150,17 @@ public class ManagedBuildEnvironmentTests extends TestCase {
*/ */
public void testEnvProvider() { public void testEnvProvider() {
doInit(); doInit();
IBuildEnvironmentVariable a = envProvider.getVariable(TestMacro.PRJ_VAR, mproj.getConfigurations()[0], true, IEnvironmentVariable a = envProvider.getVariable(TestMacro.PRJ_VAR, mproj.getConfigurations()[0], false);
false);
assertNotNull(a); assertNotNull(a);
assertEquals(TestMacro.PRJ_VAR + mproj.getName(), a.getValue()); assertEquals(TestMacro.PRJ_VAR + mproj.getName(), a.getValue());
IConfiguration[] cfgs = mproj.getConfigurations(); IConfiguration[] cfgs = mproj.getConfigurations();
a = envProvider.getVariable(TestMacro.CFG_VAR, cfgs[0], true, false); a = envProvider.getVariable(TestMacro.CFG_VAR, cfgs[0], false);
assertNotNull(a); assertNotNull(a);
assertEquals(TestMacro.CFG_VAR + cfgs[0].getName(), a.getValue()); assertEquals(TestMacro.CFG_VAR + cfgs[0].getName(), a.getValue());
// no provider for another configurations // no provider for another configurations
a = envProvider.getVariable(TestMacro.CFG_VAR, cfgs[1], true, false); a = envProvider.getVariable(TestMacro.CFG_VAR, cfgs[1], false);
assertNull(a); assertNull(a);
} }

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
Bundle-Version: 8.9.0.qualifier Bundle-Version: 9.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin

View file

@ -46,7 +46,6 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$ public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
public static final String VARIABLE_FORMAT = "variableFormat"; //$NON-NLS-1$ public static final String VARIABLE_FORMAT = "variableFormat"; //$NON-NLS-1$
public static final String IS_VARIABLE_CASE_SENSITIVE = "isVariableCaseSensitive"; //$NON-NLS-1$
public static final String RESERVED_MACRO_NAMES = "reservedMacroNames"; //$NON-NLS-1$ public static final String RESERVED_MACRO_NAMES = "reservedMacroNames"; //$NON-NLS-1$
public static final String RESERVED_MACRO_NAME_SUPPLIER = "reservedMacroNameSupplier"; //$NON-NLS-1$ public static final String RESERVED_MACRO_NAME_SUPPLIER = "reservedMacroNameSupplier"; //$NON-NLS-1$
public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$ public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
@ -273,13 +272,6 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
*/ */
public String getBuilderVariablePattern(); public String getBuilderVariablePattern();
/**
* Returns whether the builder supports case sensitive variables or not
*
* @return boolean
*/
public boolean isVariableCaseSensitive();
/** /**
* Returns an array of Strings representing the patterns of the builder/buildfile-generator * Returns an array of Strings representing the patterns of the builder/buildfile-generator
* reserved variables * reserved variables

View file

@ -101,12 +101,6 @@ public interface IEnvironmentVariableProvider {
*/ */
public String getDefaultDelimiter(); public String getDefaultDelimiter();
/**
* @return true if the OS supports case sensitive variables (Unix-like systems) or false
* if it does not (Win32 systems)
*/
public boolean isVariableCaseSensitive();
/** /**
* This method is defined to be used basically by the UI classes and should not be used by the * This method is defined to be used basically by the UI classes and should not be used by the
* tool-integrator * tool-integrator

View file

@ -26,6 +26,7 @@ import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.Vector; import java.util.Vector;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.settings.model.CSourceEntry; import org.eclipse.cdt.core.settings.model.CSourceEntry;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry;
@ -56,7 +57,6 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain; import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration; import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.macros.FileContextData; import org.eclipse.cdt.managedbuilder.internal.macros.FileContextData;
import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData; import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData;
@ -1498,11 +1498,11 @@ public class BuildDescription implements IBuildDescription {
} }
protected Map<String, String> calculateEnvironment() { protected Map<String, String> calculateEnvironment() {
IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg, IEnvironmentVariable[] variables = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg,
true, true); true);
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
for (IBuildEnvironmentVariable var : variables) { for (IEnvironmentVariable var : variables) {
map.put(var.getName(), var.getValue()); map.put(var.getName(), var.getValue());
} }
return map; return map;

View file

@ -101,7 +101,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private String convertToId; private String convertToId;
private FileContextBuildMacroValues fileContextBuildMacroValues; private FileContextBuildMacroValues fileContextBuildMacroValues;
private String builderVariablePattern; private String builderVariablePattern;
private Boolean isVariableCaseSensitive;
private String[] reservedMacroNames; private String[] reservedMacroNames;
private IReservedMacroNameSupplier reservedMacroNameSupplier; private IReservedMacroNameSupplier reservedMacroNameSupplier;
private IConfigurationElement reservedMacroNameSupplierElement; private IConfigurationElement reservedMacroNameSupplierElement;
@ -315,9 +314,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
builderVariablePattern = builder.builderVariablePattern; builderVariablePattern = builder.builderVariablePattern;
if (builder.isVariableCaseSensitive != null)
isVariableCaseSensitive = builder.isVariableCaseSensitive;
if (builder.reservedMacroNames != null) if (builder.reservedMacroNames != null)
reservedMacroNames = builder.reservedMacroNames.clone(); reservedMacroNames = builder.reservedMacroNames.clone();
@ -473,11 +469,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
// get the 'variableFormat' attribute // get the 'variableFormat' attribute
builderVariablePattern = SafeStringInterner.safeIntern(element.getAttribute(VARIABLE_FORMAT)); builderVariablePattern = SafeStringInterner.safeIntern(element.getAttribute(VARIABLE_FORMAT));
// get the 'isVariableCaseSensitive' attribute
String isCS = element.getAttribute(IS_VARIABLE_CASE_SENSITIVE);
if (isCS != null)
isVariableCaseSensitive = Boolean.parseBoolean(isCS);
// get the reserved macro names // get the reserved macro names
String reservedNames = element.getAttribute(RESERVED_MACRO_NAMES); String reservedNames = element.getAttribute(RESERVED_MACRO_NAMES);
if (reservedNames != null) if (reservedNames != null)
@ -1484,16 +1475,6 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
return builderVariablePattern; return builderVariablePattern;
} }
@Override
public boolean isVariableCaseSensitive() {
if (isVariableCaseSensitive == null) {
if (superClass != null)
return getSuperClass().isVariableCaseSensitive();
return true;
}
return isVariableCaseSensitive.booleanValue();
}
@Override @Override
public String[] getReservedMacroNames() { public String[] getReservedMacroNames() {
if (reservedMacroNames == null && superClass != null) if (reservedMacroNames == null && superClass != null)

View file

@ -31,6 +31,7 @@ import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.core.ErrorParserManager; import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher; import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IMarkerGenerator; import org.eclipse.cdt.core.IMarkerGenerator;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.model.ICModelMarker; import org.eclipse.cdt.core.model.ICModelMarker;
import org.eclipse.cdt.core.resources.ACBuilder; import org.eclipse.cdt.core.resources.ACBuilder;
import org.eclipse.cdt.core.resources.IConsole; import org.eclipse.cdt.core.resources.IConsole;
@ -47,7 +48,6 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.DescriptionBuilder; import org.eclipse.cdt.managedbuilder.internal.buildmodel.DescriptionBuilder;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.IBuildModelBuilder; import org.eclipse.cdt.managedbuilder.internal.buildmodel.IBuildModelBuilder;
import org.eclipse.cdt.managedbuilder.internal.buildmodel.ParallelBuilder; import org.eclipse.cdt.managedbuilder.internal.buildmodel.ParallelBuilder;
@ -978,8 +978,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
launcher.showCommand(true); launcher.showCommand(true);
// Set the environmennt // Set the environmennt
IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider() IEnvironmentVariable[] variables = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(cfg,
.getVariables(cfg, true, true); true);
String[] envp = null; String[] envp = null;
ArrayList<String> envList = new ArrayList<>(); ArrayList<String> envList = new ArrayList<>();
if (variables != null) { if (variables != null) {

View file

@ -19,6 +19,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
@ -50,7 +51,6 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain; import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider; import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData; import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData;
import org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedBuildCPathEntryContainer; import org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedBuildCPathEntryContainer;
@ -993,8 +993,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
private String getCWD() { private String getCWD() {
String cwd = ""; //$NON-NLS-1$ String cwd = ""; //$NON-NLS-1$
IBuildEnvironmentVariable cwdvar = ManagedBuildManager.getEnvironmentVariableProvider().getVariable("CWD", //$NON-NLS-1$ IEnvironmentVariable cwdvar = ManagedBuildManager.getEnvironmentVariableProvider().getVariable("CWD", //$NON-NLS-1$
getDefaultConfiguration(), false, true); getDefaultConfiguration(), true);
if (cwdvar != null) { if (cwdvar != null) {
cwd = cwdvar.getValue().replace('\\', '/'); cwd = cwdvar.getValue().replace('\\', '/');
} }

View file

@ -179,11 +179,6 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
return fMngr.getDefaultDelimiter(); return fMngr.getDefaultDelimiter();
} }
@Override
public boolean isVariableCaseSensitive() {
return fMngr.isVariableCaseSensitive();
}
@Override @Override
public IEnvironmentVariableSupplier[] getSuppliers(Object level) { public IEnvironmentVariableSupplier[] getSuppliers(Object level) {
return null; return null;

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.internal.core.envvar.EnvVarDescriptor;
import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IEnvVarBuildPath; import org.eclipse.cdt.managedbuilder.core.IEnvVarBuildPath;
import org.eclipse.cdt.managedbuilder.core.ITool; import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable; import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.utils.envvar.StorableEnvironment; import org.eclipse.cdt.utils.envvar.StorableEnvironment;
@ -49,8 +48,6 @@ public class StoredBuildPathEnvironmentContainer extends StorableEnvironmentLoad
private IConfiguration fConfiguration; private IConfiguration fConfiguration;
private StorableEnvironment fEnvironment; private StorableEnvironment fEnvironment;
private int fPathType; private int fPathType;
private boolean fIsVariableCaseSensitive = ManagedBuildManager.getEnvironmentVariableProvider()
.isVariableCaseSensitive();
public StoredBuildPathEnvironmentContainer(int pathType) { public StoredBuildPathEnvironmentContainer(int pathType) {
fPathType = pathType == IEnvVarBuildPath.BUILDPATH_LIBRARY ? IEnvVarBuildPath.BUILDPATH_LIBRARY fPathType = pathType == IEnvVarBuildPath.BUILDPATH_LIBRARY ? IEnvVarBuildPath.BUILDPATH_LIBRARY
@ -190,7 +187,7 @@ public class StoredBuildPathEnvironmentContainer extends StorableEnvironmentLoad
* returns true if the variable names are equal and false otherwise * returns true if the variable names are equal and false otherwise
*/ */
private boolean varNamesEqual(String name1, String name2) { private boolean varNamesEqual(String name1, String name2) {
return fIsVariableCaseSensitive ? name1.equals(name2) : name1.equalsIgnoreCase(name2); return name1.equals(name2);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -53,7 +53,6 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut
private static final String PATTERN_MACRO_NAME = "="; //$NON-NLS-1$ private static final String PATTERN_MACRO_NAME = "="; //$NON-NLS-1$
private IConfiguration fConfiguration; private IConfiguration fConfiguration;
private IBuilder fBuilder; private IBuilder fBuilder;
private HashSet<String> fCaseInsensitiveReferencedNames;
private ICdtVariableManager fVarMngr; private ICdtVariableManager fVarMngr;
private ICConfigurationDescription fCfgDes; private ICConfigurationDescription fCfgDes;
@ -257,26 +256,16 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut
String macroName = macro.getName(); String macroName = macro.getName();
String ref = null; String ref = null;
IReservedMacroNameSupplier supplier = getReservedMacroNameSupplier(); IReservedMacroNameSupplier supplier = getReservedMacroNameSupplier();
//on win32 all environment variable names are converted to upper case
macroName = EnvVarOperationProcessor.normalizeName(macroName); macroName = EnvVarOperationProcessor.normalizeName(macroName);
if (supplier == null || !supplier.isReservedName(macroName, fConfiguration)) { if (supplier == null || !supplier.isReservedName(macroName, fConfiguration)) {
String pattern = fBuilder.getBuilderVariablePattern(); String pattern = fBuilder.getBuilderVariablePattern();
if (pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1) { if (pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1) {
if (fBuilder.isVariableCaseSensitive()
|| getCaseInsensitiveReferencedNames().add(macroName.toUpperCase())) {
ref = pattern.replaceAll(PATTERN_MACRO_NAME, macroName); ref = pattern.replaceAll(PATTERN_MACRO_NAME, macroName);
} }
} }
}
return ref; return ref;
} }
protected Set<String> getCaseInsensitiveReferencedNames() {
if (fCaseInsensitiveReferencedNames == null)
fCaseInsensitiveReferencedNames = new HashSet<>();
return fCaseInsensitiveReferencedNames;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.macros.DefaultMacroSubstitutor#setMacroContextInfo(org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo) * @see org.eclipse.cdt.managedbuilder.internal.macros.DefaultMacroSubstitutor#setMacroContextInfo(org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo)
*/ */

View file

@ -21,6 +21,7 @@ import java.util.Set;
import java.util.Vector; import java.util.Vector;
import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigProfileManager; import org.eclipse.cdt.build.internal.core.scannerconfig2.CfgScannerConfigProfileManager;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IMacroEntry; import org.eclipse.cdt.core.model.IMacroEntry;
import org.eclipse.cdt.core.model.IPathEntry; import org.eclipse.cdt.core.model.IPathEntry;
@ -36,7 +37,6 @@ import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.ITarget; import org.eclipse.cdt.managedbuilder.core.ITarget;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo; import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector; import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -147,8 +147,8 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
IProgressMonitor monitor = new NullProgressMonitor(); IProgressMonitor monitor = new NullProgressMonitor();
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration config = info.getDefaultConfiguration(); IConfiguration config = info.getDefaultConfiguration();
IBuildEnvironmentVariable[] vars = ManagedBuildManager.getEnvironmentVariableProvider() IEnvironmentVariable[] vars = ManagedBuildManager.getEnvironmentVariableProvider()
.getVariables(config, true, true); .getVariables(config, true);
Properties env = new Properties(); Properties env = new Properties();
if (vars != null) if (vars != null)
for (int i = 0; i < vars.length; ++i) for (int i = 0; i < vars.length; ++i)

View file

@ -777,9 +777,6 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
Map<String, String> envMap = new HashMap<>(); Map<String, String> envMap = new HashMap<>();
for (IEnvironmentVariable var : getEnvironmentVariables()) { for (IEnvironmentVariable var : getEnvironmentVariables()) {
String name = var.getName(); String name = var.getName();
if (!envMngr.isVariableCaseSensitive()) {
name = name.toUpperCase();
}
envMap.put(name, var.getValue()); envMap.put(name, var.getValue());
} }
return envMap; return envMap;
@ -920,7 +917,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
* Return the best extension to use for calculating spec file from a list of extensions. * Return the best extension to use for calculating spec file from a list of extensions.
* @param extensions list of possible extensions to choose from * @param extensions list of possible extensions to choose from
* @return one of the extensions deemed the best one to use from the list * @return one of the extensions deemed the best one to use from the list
* @since 8.9 * @since 9.0
*/ */
protected Optional<String> selectBestSpecFileExtension(List<String> extensions) { protected Optional<String> selectBestSpecFileExtension(List<String> extensions) {
return extensions.stream().filter(s -> s != null && !s.isEmpty()).findFirst().map(ext -> { return extensions.stream().filter(s -> s != null && !s.isEmpty()).findFirst().map(ext -> {

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.gnu.ui; singleton:=true Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.gnu.ui; singleton:=true
Bundle-Version: 8.3.300.qualifier Bundle-Version: 8.3.400.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.gnu.ui.GnuUIPlugin Bundle-Activator: org.eclipse.cdt.managedbuilder.gnu.ui.GnuUIPlugin
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
@ -11,7 +11,7 @@ Export-Package: org.eclipse.cdt.managedbuilder.gnu.cygwin,
org.eclipse.cdt.managedbuilder.gnu.templates;x-internal:=true, org.eclipse.cdt.managedbuilder.gnu.templates;x-internal:=true,
org.eclipse.cdt.managedbuilder.gnu.ui org.eclipse.cdt.managedbuilder.gnu.ui
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.1.0,9.0.0)", org.eclipse.cdt.managedbuilder.core;bundle-version="[9.0.0,10.0.0]",
org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)", org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.core.resources org.eclipse.core.resources
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui; singleton:=true
Bundle-Version: 9.1.600.qualifier Bundle-Version: 9.1.700.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)", org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.cdt.make.core, org.eclipse.cdt.make.core,
org.eclipse.cdt.make.ui, org.eclipse.cdt.make.ui,
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.7.0,9.0.0)", org.eclipse.cdt.managedbuilder.core;bundle-version="[9.0.0,10.0.0]",
org.eclipse.cdt.ui;bundle-version="[7.0.0,8.0.0)", org.eclipse.cdt.ui;bundle-version="[7.0.0,8.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.console;bundle-version="[3.5.100,4.0.0)", org.eclipse.ui.console;bundle-version="[3.5.100,4.0.0)",

View file

@ -383,7 +383,7 @@ public class NewVarDialog extends Dialog {
private boolean macroNamesEqual(String name1, String name2) { private boolean macroNamesEqual(String name1, String name2) {
name1 = name1.trim(); name1 = name1.trim();
name2 = name2.trim(); name2 = name2.trim();
return name1.equalsIgnoreCase(name2); return name1.equals(name2);
} }
/* /*

View file

@ -28,7 +28,8 @@ import org.eclipse.core.runtime.Platform;
*/ */
public class EnvironmentReader { public class EnvironmentReader {
private static Properties envVars; private static Properties envVars;
private static List<String> toUppercaseEnvironmentVars = Arrays.asList("PATH"); //$NON-NLS-1$ @SuppressWarnings("nls")
private static List<String> toUppercaseEnvironmentVars = Arrays.asList("PATH", "CYGWIN_HOME", "LANG");
static { static {
boolean isWindows = Platform.OS_WIN32.equals(Platform.getOS()); boolean isWindows = Platform.OS_WIN32.equals(Platform.getOS());

View file

@ -134,9 +134,6 @@ public class CommandLauncher implements ICommandLauncher {
if (pos < 0) if (pos < 0)
pos = envStr.length(); pos = envStr.length();
String key = envStr.substring(0, pos); String key = envStr.substring(0, pos);
if (Platform.getOS().equals(Platform.OS_WIN32)) {
key = key.toUpperCase();
}
String value = envStr.substring(pos + 1); String value = envStr.substring(pos + 1);
fEnvironment.put(key, value); fEnvironment.put(key, value);
} }

View file

@ -101,11 +101,5 @@ public interface IEnvironmentVariableManager {
*/ */
public String getDefaultDelimiter(); public String getDefaultDelimiter();
/**
* @return true if the OS supports case sensitive variables (Unix-like systems) or false
* if it does not (Win32 systems)
*/
public boolean isVariableCaseSensitive();
public IContributedEnvironment getContributedEnvironment(); public IContributedEnvironment getContributedEnvironment();
} }

View file

@ -51,13 +51,10 @@ public class EnvVarCollector {
ICoreEnvironmentVariableSupplier supplier) { ICoreEnvironmentVariableSupplier supplier) {
if (vars == null) if (vars == null)
return; return;
boolean isCaseInsensitive = !EnvironmentVariableManager.getDefault().isVariableCaseSensitive();
for (int i = 0; i < vars.length; i++) { for (int i = 0; i < vars.length; i++) {
IEnvironmentVariable var = vars[i]; IEnvironmentVariable var = vars[i];
if (var != null) { if (var != null) {
String name = var.getName(); String name = var.getName();
if (isCaseInsensitive)
name = name.toUpperCase();
boolean noCheck = false; boolean noCheck = false;
@ -108,10 +105,6 @@ public class EnvVarCollector {
public EnvVarDescriptor getVariable(String name) { public EnvVarDescriptor getVariable(String name) {
if (fMap == null) if (fMap == null)
return null; return null;
if (!EnvironmentVariableManager.getDefault().isVariableCaseSensitive())
name = name.toUpperCase();
return fMap.get(name); return fMap.get(name);
} }

View file

@ -365,11 +365,6 @@ public class EnvironmentVariableManager implements IEnvironmentVariableManager {
return isWin32() ? DELIMITER_WIN32 : DELIMITER_UNIX; return isWin32() ? DELIMITER_WIN32 : DELIMITER_UNIX;
} }
@Override
public boolean isVariableCaseSensitive() {
return !isWin32();
}
public ICoreEnvironmentVariableSupplier[] getSuppliers(Object level) { public ICoreEnvironmentVariableSupplier[] getSuppliers(Object level) {
IEnvironmentContextInfo info = getContextInfo(level); IEnvironmentContextInfo info = getContextInfo(level);
if (info != null) if (info != null)

View file

@ -19,7 +19,6 @@ import java.util.List;
import org.eclipse.cdt.core.envvar.EnvironmentVariable; import org.eclipse.cdt.core.envvar.EnvironmentVariable;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable; import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.internal.core.envvar.EnvironmentVariableManager;
/** /**
* This is an utility class that implements environment variable operations * This is an utility class that implements environment variable operations
@ -225,7 +224,6 @@ public class EnvVarOperationProcessor {
/** /**
* normalizes the variable name. That is: removes prepended and appended spaces * normalizes the variable name. That is: removes prepended and appended spaces
* and converts the name to upper-case for Win32 systems
* @return the normalized name or <code>null</code> in case the name is not valid * @return the normalized name or <code>null</code> in case the name is not valid
*/ */
static public String normalizeName(String name) { static public String normalizeName(String name) {
@ -233,8 +231,6 @@ public class EnvVarOperationProcessor {
return null; return null;
if ("".equals(name = name.trim())) //$NON-NLS-1$ if ("".equals(name = name.trim())) //$NON-NLS-1$
return null; return null;
if (!EnvironmentVariableManager.getDefault().isVariableCaseSensitive())
name = name.toUpperCase();
return name; return name;
} }

View file

@ -20,7 +20,6 @@ import java.util.Map;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable; import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.cdt.internal.core.envvar.EnvironmentVariableManager;
import org.eclipse.cdt.internal.core.settings.model.ExceptionFactory; import org.eclipse.cdt.internal.core.settings.model.ExceptionFactory;
import org.eclipse.cdt.utils.envvar.StorableEnvironmentLoader.ISerializeInfo; import org.eclipse.cdt.utils.envvar.StorableEnvironmentLoader.ISerializeInfo;
@ -315,8 +314,6 @@ public class StorableEnvironment {
String getNameForMap(String name) { String getNameForMap(String name) {
if (name == null || (name = name.trim()).length() == 0) if (name == null || (name = name.trim()).length() == 0)
return null; return null;
if (!EnvironmentVariableManager.getDefault().isVariableCaseSensitive())
return name.toUpperCase();
return name; return name;
} }

View file

@ -63,9 +63,7 @@ public class CrossEnvironmentVariableSupplier implements IConfigurationEnvironme
} }
public static boolean isVar(String name) { public static boolean isVar(String name) {
// Windows has case insensitive env var names return name.equals(PathEnvironmentVariable.name);
return Platform.getOS().equals(Platform.OS_WIN32) ? name.equalsIgnoreCase(PathEnvironmentVariable.name)
: name.equals(PathEnvironmentVariable.name);
} }
@Override @Override

View file

@ -45,6 +45,7 @@
<li><a href="#optionsAPI">Removal of CDT Core Options API.</a></li> <li><a href="#optionsAPI">Removal of CDT Core Options API.</a></li>
<li><a href="#terminal">TM Terminal has major changes to support new color and preference functionality.</a></li> <li><a href="#terminal">TM Terminal has major changes to support new color and preference functionality.</a></li>
<li><a href="#pathutil">Remove org.eclipse.cdt.core.browser.PathUtil.</a></li> <li><a href="#pathutil">Remove org.eclipse.cdt.core.browser.PathUtil.</a></li>
<li><a href="#casesensitive">Environment Variables are always case sensitive in CDT.</a></li>
</ol> </ol>
<p> <p>
Planned Removals after June 2022 Planned Removals after June 2022
@ -260,9 +261,23 @@
<h3>13. <a name="pathutil">Remove org.eclipse.cdt.core.browser.PathUtil.</a></h3> <h3>13. <a name="pathutil">Remove org.eclipse.cdt.core.browser.PathUtil.</a></h3>
<p> <p>
The deprecated class org.eclipse.cdt.core.browser.PathUtil has been removed. Use The deprecated class org.eclipse.cdt.core.browser.PathUtil has been removed. Use
org.eclipse.cdt.utils.PathUtil instead. org.eclipse.cdt.utils.PathUtil instead. See <a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=564123" target="_blank">Bug 564123</a>.
</p> </p>
<h3>14. <a name="casesensitive">Environment Variables are always case sensitive in CDT.</a></h3>
<p>
The handling of environment and build variables in CDT has changed to being case sensitive. This means
some API changes to remove methods such as isVariableCaseSensitive (see full list below). The PATH and
dome other special environment variables in CDT are always uppercased, such as Path. See <a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=564123" target="_blank">Bug 564123</a>.
</p>
<ul>
<li>org.eclipse.cdt.managedbuilder.core.IBuilder.isVariableCaseSensitive() removed.</li>
<li>org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider.isVariableCaseSensitive() removed.</li>
<li>org.eclipse.cdt.core.envvar.IEnvironmentVariableManager.isVariableCaseSensitive() removed.</li></li>
</ul>
<hr> <hr>
<h2>Future Deletions</h2> <h2>Future Deletions</h2>

View file

@ -85,7 +85,8 @@ public class Env {
//This is supposed to be a straight copy (no modifications) //This is supposed to be a straight copy (no modifications)
//except for making getEnvVars private to avoid errors/warnings //except for making getEnvVars private to avoid errors/warnings
private static Properties envVars; private static Properties envVars;
private static List<String> toUppercaseEnvironmentVars = Arrays.asList("PATH"); //$NON-NLS-1$ @SuppressWarnings("nls")
private static List<String> toUppercaseEnvironmentVars = Arrays.asList("PATH", "CYGWIN_HOME", "LANG");
static { static {
boolean isWindows = Platform.OS_WIN32.equals(Platform.getOS()); boolean isWindows = Platform.OS_WIN32.equals(Platform.getOS());