[ 
http://jira.codehaus.org/browse/GEOT-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Aime reopened GEOT-3435:
-------------------------------


The test keeps on failing on the nightly build, I think I've found the reason, 
there is a logic inversion in the test, if you want to check the target is a 
number you should use Number.isAssignableFrom(target), so the patch would be:

{code}



diff --git 
a/modules/library/jdbc/src/main/java/org/geotools/data/jdbc/FilterToSQL.java 
b/modules/library/jdbc/src/main/java/org/geotools/data/jdbc/FilterToS
index 09c44a7..470a127 100644
--- a/modules/library/jdbc/src/main/java/org/geotools/data/jdbc/FilterToSQL.java
+++ b/modules/library/jdbc/src/main/java/org/geotools/data/jdbc/FilterToSQL.java
@@ -976,7 +976,7 @@ public class FilterToSQL implements FilterVisitor, 
ExpressionVisitor {
         // JD: the above is no longer true, so instead do a safe conversion
         if(target != null) {
             // use the target type
-            if (target.isAssignableFrom(Number.class)) {
+            if (Number.class.isAssignableFrom(target)) {
                 literal = Converters.convert(expression.evaluate(null), 
target, 
                         new Hints(ConverterFactory.SAFE_CONVERSION, true));    
             }
{code}

With this patch the CITE test passes for me

> FilterToSQL.evaluateLiteral() depends on old AttributeExpression conversion 
> behaviour
> -------------------------------------------------------------------------------------
>
>                 Key: GEOT-3435
>                 URL: http://jira.codehaus.org/browse/GEOT-3435
>             Project: GeoTools
>          Issue Type: Bug
>          Components: data jdbc
>    Affects Versions: 2.8-M1
>            Reporter: Justin Deoliveira
>            Assignee: Justin Deoliveira
>             Fix For: 2.8-M1
>
>         Attachments: GEOT-3435.patch
>
>
> One of the wfs cite tests uses a filter like this:
> {code}
>     <ogc:Filter>
>          <ogc:PropertyIsEqualTo>
>             <ogc:PropertyName>sf:decimalProperty</ogc:PropertyName>
>             <ogc:Sub>
>                <ogc:PropertyName>sf:intProperty</ogc:PropertyName>
>                <ogc:Literal>149.98</ogc:Literal>
>             </ogc:Sub>
>          </ogc:PropertyIsEqualTo>
>       </ogc:Filter>
> {code}
> Which to run properly relied on the conversion logic of turning strings to 
> numbers that used to live on AttributeExpression. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to