[Schmitzm-commits] r825 - trunk/src/schmitzm/geotools/feature

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 5 15:23:19 CEST 2010


Author: alfonx
Date: 2010-05-05 15:23:18 +0200 (Wed, 05 May 2010)
New Revision: 825

Modified:
   trunk/src/schmitzm/geotools/feature/FeatureCollectionReader.java
Log:
try finally  um den FeatureIterator zu schliessen


		FeatureIteratorImpl<SimpleFeature> featureIteratorImpl = new FeatureIteratorImpl<SimpleFeature>(
				fc);
		try {

			this.featureType = featureIteratorImpl.next().getType();
		} finally {
			fc.close(featureIteratorImpl);
		}

Modified: trunk/src/schmitzm/geotools/feature/FeatureCollectionReader.java
===================================================================
--- trunk/src/schmitzm/geotools/feature/FeatureCollectionReader.java	2010-05-05 10:44:01 UTC (rev 824)
+++ trunk/src/schmitzm/geotools/feature/FeatureCollectionReader.java	2010-05-05 13:23:18 UTC (rev 825)
@@ -71,8 +71,14 @@
 					"FeatureCollection must contain at least one SimpleFeature!");
 		this.fc = fc;
 
-		this.featureType = new FeatureIteratorImpl<SimpleFeature>(fc).next()
-				.getType();
+		FeatureIteratorImpl<SimpleFeature> featureIteratorImpl = new FeatureIteratorImpl<SimpleFeature>(
+				fc);
+		try {
+
+			this.featureType = featureIteratorImpl.next().getType();
+		} finally {
+			fc.close(featureIteratorImpl);
+		}
 		reset();
 	}
 



More information about the Schmitzm-commits mailing list