I admit it was an oversite but I will take responsibility - it was an 
oversite in the API. Checking the result of something null and 
Filter.NONE is a bit error prone.

I would like to change the idiom to:
if( Filter.NONE.equals( postFilter ) ){
    ...
}

> Shaun Forbes wrote:
>
>   
>> I've noticed in the JDBCFeatureSource.count(Query query, Transaction 
>> transaction) method may have an incorrect check in it that's disabling 
>> the use of an optimization to calculate the record count.
>>
>> The count method is checking that the PostQueryFilter is not null, but 
>> I believe that it should also be checking that it's not Filter.NONE, 
>> as the JDBCFeatureCollection.aggregate(String aggregate, Expression 
>> expression) method does.
>>
>> JDBCFeatureSource is:
>>
>>         if (sqlBuilder.getPostQueryFilter(query.getFilter()) != null) {
>>             // this would require postprocessing the filter
>>             // so we cannot optimize
>>             return -1;
>>         }
>>
>> whereas JDBCFeatureCollection is:
>>
>>         Filter postFilter = 
>> sqlBuilder.getPostQueryFilter(query.getFilter());
>>         if (postFilter != null && postFilter != Filter.NONE) {
>>             // this would require postprocessing the filter
>>             // so we cannot optimize
>>             return null;
>>         }
>>
>>     
> Thanks Shaun,
>
> This is clearly an oversight -- i'll create a JIRA and apply the patch.
>
> Cheers,
> Cory.
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>   


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to