Re: [OpenMap Users] FilterSupport problems

From: Don Dietrick <dietrick@bbn.com>
Date: Fri Jul 11 2003 - 10:52:23 EDT

Hi Julie,

On Wednesday, July 9, 2003, at 04:37 PM, Julie Tittler wrote:

> I seem to be getting the following error upon applying a filter to a
> FilterSupport object. I have no idea what this means, or why it's
> happening.
>
> -----------------------------------------------------------------------
> -
> java.lang.StackOverflowError
>
> at java.util.AbstractCollection.<init>(AbstractCollection.java:44)
>
> at java.util.AbstractList.<init>(AbstractList.java:56)
>
> at java.util.ArrayList.<init>(ArrayList.java:104)
>
> at com.bbn.openmap.omGraphics.OMGraphicList.<init>(Unknown Source)
>
> at com.bbn.openmap.omGraphics.OMGraphicList.<init>(Unknown Source)
>
> at com.bbn.openmap.omGraphics.FilterSupport.filterList(Unknown Source)
>
> at com.bbn.openmap.omGraphics.FilterSupport.filterList(Unknown Source)
>

This error usually occurs when you get into some kind of recursive
loop. This is also the second similar report we've had with the
FilterSupport object. The code has been modified and refined for the
next version of OpenMap - have you tried the beta release to see if you
have the same problem?

> -----------------------------------------------------------------------
> -
>
> The OMGraphicsList I pass to the constructor of the FilterSupport
> doesn't seem to be null when I step through the code, so I'm a little
> confused. The OMGraphic I'm using as a filter, "poly", also seems to
> be valid. Here's a snippet of the code:
>
> /////////////////////
> public Vector getFacilitiesInPoly(OMGraphic poly)
> {
> if(poly == null)
> return null;
>
> OMGraphicList facList = this.getFacilitiesGraphicList();
> if(facList == null)
> return null;
> else if(facList.isEmpty())
> return null;
>
> FilterSupport facFilter = new FilterSupport(facList);
>
> //The following line is the line which gives the error.
> OMGraphicList filteredList = facFilter.filter(poly.getShape());
>
> if(filteredList.isEmpty())
> return null;
> ////////////////////
>
> The interesting thing to note about the code above is that the
> OMGraphicList returned by getFacilitiesGraphicList is a subset of
> OMGraphics in the layer. Is this perhaps the reason this is happening?

No, that's the intended behavior - the FilterSupport returns a new list
with OMGraphics that pass the filter, while setting those same
OMGraphics to be visible so the original list can be used as well.

> Does a FilterSupport object have to apply to the root OMGraphicList of
> a layer?

No, it should work on any OMGraphicList.

- Don

>
> Thanks,
> Julie Tittler
>
> ------------------
> Julie Tittler
> GIS Software Engineer
> ITT Industries - AES
> ------------------
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Jul 11 10:56:36 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:36 EDT