We should probably move this conversation over to the user list:
What does System.out.println( ECQL.toCQL( filter ) ) give you?
Jody Garnett
On Fri, Apr 25, 2014 at 12:18 AM, Andrew Hulbert <jahhulb...@gmail.com>wrote:
> Thanks for the Reply! Is the access pattern or usage of the API in this
> code incorrect then? It works for other filters but not for the id filter.
>
> public class FilterFailTest {
>
> @Test
> public void test(){
> FilterFactory ff =
> CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
> Filter filter = ff.id(
> Collections.singleton(ff.featureId("fred")));
>
> ECQL.toCQL(filter);
> }
>
> }
>
> -Andrew
>
>
>
>
> On Thu, Apr 24, 2014 at 10:15 AM, Jody Garnett <jody.garn...@gmail.com>wrote:
>
>> I think that is by design, the toCQL method is not a "visitor" but
>> instead a public utility method making it easier to call and use the
>> visitor object.
>>
>> I think we actually wrapped up all the utility methods into the CQL and
>> ECQL classes to make this stuff easier to use.
>>
>> Jody
>>
>> Jody Garnett
>>
>>
>> On Thu, Apr 24, 2014 at 11:57 PM, Andrew Hulbert <jahhulb...@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> I think I might have found a Class Cast bug where a StringBuilder is
>>> expected but in certain cases a String is returned...It appears that in
>>> org.geotools.filter.text.ecql.ECQL this method:
>>>
>>> public static String toCQL( Filter filter ){
>>> FilterToECQL toCQL = new FilterToECQL();
>>>
>>> StringBuilder output = (StringBuilder) filter.accept( toCQL,
>>> new StringBuilder() );
>>>
>>> return output.toString();
>>> }
>>>
>>> is performing a cast to StringBuilder from accept methods for filters.
>>> Almost all FilterVisitors return a String Builder except for the method in
>>> class org.geotools.filter.text.ecql.FilterToECQL
>>>
>>> public Object visit(Id filter, Object extraData) {}
>>>
>>> this method returns a String causing the case to fail when
>>> org.opengis.filter.Id is the Filter...
>>>
>>> I've attached a sample class that causes the issue.
>>>
>>> If this is not an issue let me know! If it is, how can I file a bug
>>> report?
>>>
>>> Thanks!
>>>
>>> Andrew
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Start Your Social Network Today - Download eXo Platform
>>> Build your Enterprise Intranet with eXo Platform Software
>>> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
>>> Get Started Now And Turn Your Intranet Into A Collaboration Platform
>>> http://p.sf.net/sfu/ExoPlatform
>>> _______________________________________________
>>> GeoTools-Devel mailing list
>>> geotools-de...@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>>
>>>
>>
>
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users