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-Devel@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-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to