darkma773r commented on PR #182: URL: https://github.com/apache/commons-configuration/pull/182#issuecomment-1133766346
> Maybe the isSingleVariable method should document that this is only a simple attempt at optimization? Unfortunately, this isn't just an optimization, but affects the return value. If the value to interpolate consists of just a single variable, then the variable is looked up and returned with its original type. If it is not a single variable or if the single variable lookup does not return a result, then `StringSubstitutor` is used and the result is a string, regardless of the type of the resolved variable(s). So, it is important to catch as many cases of single variable references as possible so that the expected type can be returned. However, the parsing used by `ConfigurationInterpolator` in the single variable case is not nearly as sophisticated as that used in `StringSubstitutor` -- there is no such thing as default values or escaping in the `ConfigurationInterpolator` logic. This may mean that we're not losing any existing functionality here but I'll need think about this a bit more... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
