[geos-commits] r2915 - trunk/src/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Feb 17 09:04:19 EST 2010


Author: strk
Date: 2010-02-17 09:04:18 -0500 (Wed, 17 Feb 2010)
New Revision: 2915

Modified:
   trunk/src/geom/CoordinateArraySequence.cpp
Log:
Throw an IllegalArgumentException when setOrdinate is called with unknown ordinate index

Modified: trunk/src/geom/CoordinateArraySequence.cpp
===================================================================
--- trunk/src/geom/CoordinateArraySequence.cpp	2010-02-14 14:10:48 UTC (rev 2914)
+++ trunk/src/geom/CoordinateArraySequence.cpp	2010-02-17 14:04:18 UTC (rev 2915)
@@ -18,7 +18,9 @@
 #include <geos/geom/CoordinateArraySequence.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateFilter.h>
+#include <geos/util/IllegalArgumentException.h>
 
+#include <sstream>
 #include <cassert>
 #include <algorithm>
 #include <vector>
@@ -215,8 +217,12 @@
 			(*vect)[index].z = value;
 			break;
 		default:
-			assert(0);
+		{
+			std::stringstream ss;
+			ss << "Unknown ordinate index " << index;
+			throw util::IllegalArgumentException(ss.str());
 			break;
+		}
 	}
 }
 



More information about the geos-commits mailing list