Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Sennikovsky2007-02-28 10:40:47 +0000
committerMikhail Sennikovsky2007-02-28 10:40:47 +0000
commit0a1dd389926d9525c7fb5f4daefce0ee1f90d585 (patch)
tree0d0654427e138325d5eef2cfa3348fe7e0085af8
parentad84cc5f824b981f0f336340cb813caac4ca68dc (diff)
downloadorg.eclipse.cdt-0a1dd389926d9525c7fb5f4daefce0ee1f90d585.tar.gz
org.eclipse.cdt-0a1dd389926d9525c7fb5f4daefce0ee1f90d585.tar.xz
org.eclipse.cdt-0a1dd389926d9525c7fb5f4daefce0ee1f90d585.zip
fix for [Bug 175808] NullPointerException in BuildSystemVariableSupplier.getMacros
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/BuildSystemVariableSupplier.java11
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/BuildSustemEnvironmentSupplier.java4
2 files changed, 11 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/BuildSystemVariableSupplier.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/BuildSystemVariableSupplier.java
index 47def4d8277..8e522b27a65 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/BuildSystemVariableSupplier.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/BuildSystemVariableSupplier.java
@@ -11,6 +11,7 @@
package org.eclipse.cdt.internal.core.cdtvariables;
import org.eclipse.cdt.core.cdtvariables.ICdtVariable;
+import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.utils.cdtvariables.ICdtVariableSupplier;
import org.eclipse.cdt.utils.cdtvariables.IVariableContextInfo;
@@ -98,11 +99,17 @@ public class BuildSystemVariableSupplier extends CoreMacroSupplierBase {
protected ICdtVariable getMacro(String name, int type, Object data) {
ICConfigurationDescription des = (ICConfigurationDescription)data;
- return des.getBuildVariablesContributor().getVariable(name, new ExtensionMacroProvider(type, data));
+ ICdtVariablesContributor cr = des.getBuildVariablesContributor();
+ if(cr != null)
+ return cr.getVariable(name, new ExtensionMacroProvider(type, data));
+ return null;
}
protected ICdtVariable[] getMacros(int type, Object data) {
ICConfigurationDescription des = (ICConfigurationDescription)data;
- return des.getBuildVariablesContributor().getVariables(new ExtensionMacroProvider(type, data));
+ ICdtVariablesContributor cr = des.getBuildVariablesContributor();
+ if(cr != null)
+ return cr.getVariables(new ExtensionMacroProvider(type, data));
+ return new ICdtVariable[0];
}
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/BuildSustemEnvironmentSupplier.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/BuildSustemEnvironmentSupplier.java
index 413aa7a5a7c..823975253a6 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/BuildSustemEnvironmentSupplier.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/envvar/BuildSustemEnvironmentSupplier.java
@@ -169,13 +169,13 @@ public class BuildSustemEnvironmentSupplier implements
*/
public IEnvironmentVariable[] getVariables(Object context) {
if(context == null)
- return null;
+ return new IEnvironmentVariable[0];
IEnvironmentVariable variables[] = null;
if(context instanceof ICConfigurationDescription){
ICConfigurationDescription cfg = (ICConfigurationDescription)context;
IEnvironmentContributor supplier = cfg.getBuildSetting().getBuildEnvironmentContributor();
if(supplier == null)
- return null;
+ return new IEnvironmentVariable[0];
variables = supplier.getVariables(new ExtensionEnvVarProvider(context));
}

Back to the top