|
From: Andrea A. <aa...@op...> - 2006-12-28 14:16:41
|
Hi all, I have a few questions about a bug I've spotted in JDBC land. First thing is, why are there two ways to compare FeatureTypes for equality? The first one is FeatureType.equals(xxx), the second one is DataUtilities.compare(ft1, ft2). Some places use the first, others the second, maybe in the same algorithm (bad idea...). Second, why DefaultAttributeType.equals(...) does not take into account the restriction when evaluating equality? Finally, the bug. If I invoke getFeatureReader(FeatureType requestedType, Filter filter, Transaction t) on a JDBC data store and requestedType is a subset of the datastore's schema, I'm guaranteed to get an exception from the ReTypeFeatureReader, since the method builds a query that already extracts the requested attributes but... there is a but in my opinion. What if the requested type had different restrictions on attributes? Would it be ok to return a feature reader sporting a feature type that's different (restrictions wise) from the one requested? Depending on the application, the answer may well be no, because the coder expects restrictions to operate on the returned features as requested, no? Cheers Andrea PS: PostgisDataStore overwrites the method inherited from JDBC1DataStore, yet it does not seem to make any significant change to it, seems more like an unmantained copy than something with a purpose. |