1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00

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>
This commit is contained in:
mhussein 2012-05-14 10:56:04 +03:00 committed by Doug Schaefer
parent 12d73e274c
commit bd57216cbf

View file

@ -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;
}