org.geotools.feature.collection.DelegateFeatureIterator delegates actions to
java.util.Iterator that is actually org.geotools.data.store.
FeatureReaderIterator.
DelegateFeatureIterator must close internal iterator, but no ways to cast it
to FeatureReaderIterator because of "package" visibility of the last one.
Because of this at least four places in UDIG lead to unclosed shapefile
readers and locking in READ mode forever.
What's the real need of delegation of iteration.. It is not enough to close
iterator internally inside of hasNext() method as it is in
FeatureReaderIterator because sometimes only first feature is needed to be
read and internally it is not closed automatically inside of hasNext() while
more features are there, but implicitly it is impossible to close
DelegateFeatureIterator because of empty close() method..
I'm confused with that mess of different iterators, etc..
Solution: Let's make org.geotools.data.store.FeatureReaderIterator as a
public and inside of org.geotools.feature.collection.DelegateFeatureIterator
the method close() looks like:
public void close() {
if(delegate != null){
if(delegate instanceof FeatureReaderIterator)
((FeatureReaderIterator)delegate).close();
}
delegate = null;
}
Or refactor DelegateFeatureIterator into org.geotools.data.store package
while keeping FeatureReaderIterator with "package" visibility..
Isn't it preferable to decrease the number of different iterators, etc..?
Vitali.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel