arg = text.substring(pos);
}
} else {
name = text;
}
IValueVariable valueVariable = manager.getValueVariable(name);
if (valueVariable == null) {
IDynamicVariable dynamicVariable = manager.getDynamicVariable(name);
if (dynamicVariable == null) {
// no variables with the given name
if (reportUndefinedVariables) {
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_3, new String[]{name}), null));
}
// leave as is
return getOriginalVarText(var);
}
if (resolveVariables) {
fSubs = true;
return dynamicVariable.getValue(arg);
}
//leave as is
return getOriginalVarText(var);
}
if (arg == null) {
if (resolveVariables) {
fSubs = true;
return valueVariable.getValue();
}
//leave as is
return getOriginalVarText(var);
}
// error - an argument specified for a value variable
throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{valueVariable.getName()}), null));
}