The code is ok, but we have not resolved the problem, I have reopened the issue, and added some comments. cheers
On Friday 09 July 2010 12:35:05 pm Jody Garnett wrote: > On 09/07/2010, at 12:10 AM, Mauricio Pazos wrote: > > Hello: > > We have solved and tested this bug. > > http://jira.codehaus.org/browse/UDIG-1686 > > > > But, we did have to modify Interceptor behavior. Could someone does a > > codereview please. The modified lines are commented in the referred > > issue. > > I will review now; two months ago I modified some of the interceptor code > and asked for a code review as well. > > > We have a doubt because, right now, the unit test > > ShowViewIntercept .... looks like you are checking that the view being > returned is actually appropriate to the requestedType. > > FeatureSource<SimpleFeatureType, SimpleFeature> view = ds.getView(query); > > if (view != null) { > if (requestedType.isAssignableFrom(FeatureSource.class)) { > return view; > } else { > return null; > } > } > > So there are some problems with that - not with your code; with the > GeoTools definition of getView: - getView( Query ) - can return a > FeatureSource or a FeatureStore, or null - depending on the implementation > of the DataStore - indeed it is such a poorly defined method it has been > removed from GeoTools 2.7 - there is a DefaultView( featureSource, query ) > "wrapper" that was used by 90% of the implementations anyways - I will > update the code and ask for your review... > > > ShowViewInterceptorTest fail in testGetFeatureStore. > > It expects a resource null! > > As noted above the getView should not really be returning null; so the test > is bad. > > Jody -- Mauricio Pazos www.axios.es _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel