diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java index 59492261564..645b8970d6b 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/EnvironmentVariableManager.java @@ -47,7 +47,7 @@ public class EnvironmentVariableManager implements private static EnvironmentVariableManager fInstance = null; - private EnvVarVariableSubstitutor fVariableSubstitutor; +// private EnvVarVariableSubstitutor fVariableSubstitutor; public static final UserDefinedEnvironmentSupplier fUserSupplier = new UserDefinedEnvironmentSupplier(); public static final BuildSustemEnvironmentSupplier fExternalSupplier = new BuildSustemEnvironmentSupplier(); @@ -404,18 +404,19 @@ public class EnvironmentVariableManager implements } public IVariableSubstitutor getVariableSubstitutor(IVariableContextInfo info, String inexistentMacroValue, String listDelimiter){ - if(fVariableSubstitutor == null) - fVariableSubstitutor = new EnvVarVariableSubstitutor(info,inexistentMacroValue,listDelimiter); - else { - try { - fVariableSubstitutor.setMacroContextInfo(info); - fVariableSubstitutor.setInexistentMacroValue(inexistentMacroValue); - fVariableSubstitutor.setListDelimiter(listDelimiter); - } catch (CdtVariableException e){ - fVariableSubstitutor = new EnvVarVariableSubstitutor(info,inexistentMacroValue,listDelimiter); - } - } - return fVariableSubstitutor; + return new EnvVarVariableSubstitutor(info,inexistentMacroValue,listDelimiter); +// if(fVariableSubstitutor == null) +// fVariableSubstitutor = new EnvVarVariableSubstitutor(info,inexistentMacroValue,listDelimiter); +// else { +// try { +// fVariableSubstitutor.setMacroContextInfo(info); +// fVariableSubstitutor.setInexistentMacroValue(inexistentMacroValue); +// fVariableSubstitutor.setListDelimiter(listDelimiter); +// } catch (CdtVariableException e){ +// fVariableSubstitutor = new EnvVarVariableSubstitutor(info,inexistentMacroValue,listDelimiter); +// } +// } +// return fVariableSubstitutor; } public IContributedEnvironment getContributedEnvironment() { diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java index 2b6d9b9fe7e..0fa60266ac8 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/cdtvariables/SupplierBasedCdtVariableSubstitutor.java @@ -377,9 +377,9 @@ public class SupplierBasedCdtVariableSubstitutor implements IVariableSubstitutor String name = des.fName; ResolvedMacro value = (ResolvedMacro)fResolvedMacros.get(name); if(value == null){ - if(fMacrosUnderResolution.add(name)) + if(fMacrosUnderResolution.add(name)) { fMacroDescriptors.push(des); - else { + } else { // the macro of the specified name is referenced from the other macros that // are referenced by the given macro // e.g. ${macro1}="...${macro2}...", ${macro2}="...${macro1}..." @@ -392,13 +392,13 @@ public class SupplierBasedCdtVariableSubstitutor implements IVariableSubstitutor // In the above example the ${macro1} reference will be expanded to the value of the ${macro1} macro of the // parent context or to an empty string if there is no such macro defined in the parent contexts MacroDescriptor last = (MacroDescriptor)fMacroDescriptors.lastElement(); - if(last != null && last.fName.equals(name)){ + if(last != null && last.fName.equals(name)) { value = resolveParentMacro(last); if(value == null) value = new ResolvedMacro(name,EMPTY_STRING,false); - }else if(fIncorrectlyReferencedMacroValue != null) + } else if(fIncorrectlyReferencedMacroValue != null) { value = new ResolvedMacro(name,fIncorrectlyReferencedMacroValue,false); - else{ + } else{ ICdtVariableStatus status = new SupplierBasedCdtVariableStatus(ICdtVariableStatus.TYPE_MACRO_REFERENCE_INCORRECT, (String)null, null,