Index: AutopolygonEditingProvider.java
===================================================================
--- AutopolygonEditingProvider.java	(revision 1493)
+++ AutopolygonEditingProvider.java	(revision 1494)
@@ -1,4 +1,3 @@
-package org.gvsig.vectorediting.lib.prov.autopolygon;
 /**
  * gvSIG. Desktop Geographic Information System.
  *
@@ -23,40 +22,30 @@
  * at info AT gvsig.com, or visit our website www.gvsig.com.
  */
 
+package org.gvsig.vectorediting.lib.prov.autopolygon;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.cresques.cts.IProjection;
 
 import org.gvsig.fmap.dal.exception.DataException;
-import org.gvsig.fmap.dal.feature.EditableFeature;
 import org.gvsig.fmap.dal.feature.Feature;
 import org.gvsig.fmap.dal.feature.FeatureQuery;
-import org.gvsig.fmap.dal.feature.FeatureSelection;
 import org.gvsig.fmap.dal.feature.FeatureSet;
 import org.gvsig.fmap.dal.feature.FeatureStore;
 import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.GeometryLocator;
-import org.gvsig.fmap.geom.GeometryManager;
-import org.gvsig.fmap.geom.Geometry.SUBTYPES;
-import org.gvsig.fmap.geom.Geometry.TYPES;
 import org.gvsig.fmap.geom.aggregate.MultiSurface;
-import org.gvsig.fmap.geom.exception.CreateGeometryException;
-import org.gvsig.fmap.geom.primitive.Circle;
-import org.gvsig.fmap.geom.primitive.Ellipse;
 import org.gvsig.fmap.geom.primitive.Point;
 import org.gvsig.fmap.geom.primitive.Surface;
 import org.gvsig.fmap.geom.type.GeometryType;
-import org.gvsig.fmap.mapcontext.layers.vectorial.IntersectsGeometryEvaluator;
+import org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory;
 import org.gvsig.tools.dispose.DisposableIterator;
 import org.gvsig.tools.dynobject.DynObject;
-import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.evaluator.Evaluator;
 import org.gvsig.tools.service.spi.ProviderServices;
-import org.gvsig.tools.visitor.Visitor;
 import org.gvsig.vectorediting.lib.api.DrawingStatus;
 import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
 import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
@@ -71,12 +60,13 @@
 import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
 import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
 
+@SuppressWarnings("UseSpecificCatch")
 public class AutopolygonEditingProvider extends AbstractEditingProvider
     implements EditingProvider {
 
-    private EditingServiceParameter geometryParameter;
+    private final EditingServiceParameter geometryParameter;
 
-    private FeatureStore featureStore;
+    private final FeatureStore featureStore;
 
     private Geometry geometryValue;
 
@@ -110,8 +100,7 @@
     }
 
     public List<EditingServiceParameter> getParameters() {
-        List<EditingServiceParameter> list =
-            new ArrayList<EditingServiceParameter>();
+        List<EditingServiceParameter> list = new ArrayList<>();
         list.add(geometryParameter);
         return list;
     }
@@ -125,7 +114,7 @@
         Object value) throws InvalidEntryException {
 
         if (param == geometryParameter) {
-            if (value instanceof Geometry && value != null) {
+            if (value instanceof Geometry ) {
                 Geometry geometry = (Geometry)value;
                 GeometryType geometryType = geometry.getGeometryType();
                 if (geometryType.isTypeOf(Geometry.TYPES.MULTISURFACE) ||
@@ -151,7 +140,7 @@
             (EditingProviderServices) getProviderServices();
 
         Geometry geometry = geometryValue.cloneGeometry();
-        FeatureQuery query = null;
+        FeatureQuery query;
         try {
             query = queryByGeometry(geometry);
             if (query != null) {
@@ -178,7 +167,7 @@
             }
 
         } catch (Exception e) {
-            new FinishServiceException(e);
+            throw new FinishServiceException(e);
         }
         return geometry;
     }
@@ -198,9 +187,11 @@
         featureQuery.setFeatureType(featureType);
 
         IProjection query_proj = featureType.getDefaultSRS();
-        IntersectsGeometryEvaluator iee =
-            new IntersectsGeometryEvaluator(geometry, query_proj,
-                featureType, geomName);
+        Evaluator iee = SpatialEvaluatorsFactory.getInstance().intersects(
+            geometry, 
+            query_proj, 
+            featureStore
+        );
         featureQuery.setFilter(iee);
         featureQuery.setAttributeNames(null);
         return featureQuery;
