You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2018/03/18 20:39:00 UTC
[jira] [Resolved] (CONFIGURATION-691) ExprLookup only works for
expressions that evaluate to strings
[ https://issues.apache.org/jira/browse/CONFIGURATION-691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oliver Heger resolved CONFIGURATION-691.
----------------------------------------
Resolution: Fixed
Fix Version/s: 2.3
A fix was applied in SVN revision 1827145. Non-string expression results no longer cause a ClassCastException, but are converted to strings.
The Lookup interface is indeed bound to string results. It has been designed to work with _StrSubstitutor_ from [lang], which is also string-based. Function-wise, this is not really a limitation because Commons Configuration can do many conversions to desired target data types; there may be unnecessary conversions though (from a type to string and back to the original type).
Due to backwards compatibility, the Lookup interface can only be changed in a major release.
> ExprLookup only works for expressions that evaluate to strings
> --------------------------------------------------------------
>
> Key: CONFIGURATION-691
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-691
> Project: Commons Configuration
> Issue Type: Improvement
> Components: Interpolation
> Affects Versions: 2.2
> Reporter: Steven Paligo
> Priority: Major
> Fix For: 2.3
>
>
> ExprLookup only works when the expression evaluates to a string. The doLookup(...) method casts the result to a string, which triggers a ClassCastException when it isn't.
> This is unnecessary. The Lookup interface allows for any object to be returned. Also, non-string expressions are entirely useful.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)