Revision: 5040
          http://sourceforge.net/p/jump-pilot/code/5040
Author:   michaudm
Date:     2016-10-03 21:09:00 +0000 (Mon, 03 Oct 2016)
Log Message:
-----------
Make RemoveSpikePlugIn more robust

Modified Paths:
--------------
    core/trunk/ChangeLog
    core/trunk/src/org/openjump/core/ui/plugin/tools/RemoveSpikePlugIn.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2016-10-02 11:51:41 UTC (rev 5039)
+++ core/trunk/ChangeLog        2016-10-03 21:09:00 UTC (rev 5040)
@@ -3,6 +3,9 @@
 # 2. make sure that lines break at 80 chars for constricted display situations
 #<-------------------------------- 80 chars 
---------------------------------->#
 
+2016-10-03 mmichaud <m.michael.mich...@orange.fr>
+  * Make RemoveSpikePlugIn more robust
+
 2016-10-01 mmichaud <m.michael.mich...@orange.fr>
   * Dxf writer has been broken for a while. It is fixed with 0.8.1
     but it can no more save several files at a time

Modified: 
core/trunk/src/org/openjump/core/ui/plugin/tools/RemoveSpikePlugIn.java
===================================================================
--- core/trunk/src/org/openjump/core/ui/plugin/tools/RemoveSpikePlugIn.java     
2016-10-02 11:51:41 UTC (rev 5039)
+++ core/trunk/src/org/openjump/core/ui/plugin/tools/RemoveSpikePlugIn.java     
2016-10-03 21:09:00 UTC (rev 5040)
@@ -109,7 +109,6 @@
             Feature feature = ((Feature)o).clone(true, true);
             List<Geometry> spikes = new ArrayList<Geometry>();
             Geometry newGeom = null;
-            Feature spike = new BasicFeature(spikeSchema);
             if (feature.getGeometry() instanceof GeometryCollection) {
                 newGeom = removeSpike((GeometryCollection) 
feature.getGeometry(),
                         distTolerance, angleTolerance, spikes);
@@ -118,7 +117,7 @@
                         distTolerance, angleTolerance, spikes);
             }
             boolean isValid = false;
-            if (newGeom.isValid()) {
+            if (newGeom != null && newGeom.isValid()) {
                 feature.setGeometry(newGeom);
                 isValid = true;
             }
@@ -160,7 +159,7 @@
         for (int i = 0 ; i < poly.getNumInteriorRing() ; i++) {
             holes[i] = removeSpike((LinearRing)poly.getInteriorRingN(i), 
distTolerance, angleTolerance, spikes);
         }
-        return poly.getFactory().createPolygon(shell,  holes);
+        return poly.getFactory().createPolygon(shell, holes);
     }
 
 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to