summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormhussein2012-05-14 03:56:04 (EDT)
committer Doug Schaefer2012-05-14 09:18:23 (EDT)
commitbd57216cbf569a93a99d9f7140032d6ecaff6d6d (patch)
tree17167b0280599208e4d5ebdf22776f02358ce325
parent12d73e274c63c399fc42fbc92b2bb776ee1a65fd (diff)
downloadorg.eclipse.cdt-bd57216cbf569a93a99d9f7140032d6ecaff6d6d.zip
org.eclipse.cdt-bd57216cbf569a93a99d9f7140032d6ecaff6d6d.tar.gz
org.eclipse.cdt-bd57216cbf569a93a99d9f7140032d6ecaff6d6d.tar.bz2
Fix Unit test for bug 365718
make getTreeRoot correctly throw an exception if called for non tree nodes. Change-Id: Ief34c469c504cddc0212750bf98f4823774d1990 Reviewed-on: https://git.eclipse.org/r/5969 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com>
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
index 07d69fe..ea8df26 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
@@ -2975,6 +2975,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
@Override
public ITreeRoot getTreeRoot() throws BuildException {
+ if (getValueType() != TREE) {
+ throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
+ }
if (treeRoot == null) {
if (superClass != null) {
return superClass.getTreeRoot();
@@ -2982,9 +2985,6 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return null;
}
}
- if (getValueType() != TREE) {
- throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
- }
return treeRoot;
}