[Xulu-commits] r23 - trunk/src/edu/bonn/xulu/plugin/model/ca/reservoir

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Mar 28 17:42:16 CET 2009


Author: alfonx
Date: 2009-03-28 17:42:16 +0100 (Sat, 28 Mar 2009)
New Revision: 23

Modified:
   trunk/src/edu/bonn/xulu/plugin/model/ca/reservoir/SmallReservoirModelContentManager.java
Log:
The old code must have been a mistake, because it would have led to a NullPointerException. Eclipse showed me these...

Old:
    if ( sfc != null || sfc.getFeatureCollection().size() > 0 ) {
      FeatureCollection fc = sfc.getFeatureCollection();

New:
    if ( sfc != null && sfc.getFeatureCollection().size() > 0 ) {
      FeatureCollection fc = sfc.getFeatureCollection();


Modified: trunk/src/edu/bonn/xulu/plugin/model/ca/reservoir/SmallReservoirModelContentManager.java
===================================================================
--- trunk/src/edu/bonn/xulu/plugin/model/ca/reservoir/SmallReservoirModelContentManager.java	2009-03-11 12:29:25 UTC (rev 22)
+++ trunk/src/edu/bonn/xulu/plugin/model/ca/reservoir/SmallReservoirModelContentManager.java	2009-03-28 16:42:16 UTC (rev 23)
@@ -137,7 +137,7 @@
 
     // Pruefen, ob FeatureCollection "eine Linie" enthaelt
     SingleFeatureCollection sfc = (SingleFeatureCollection)getResource(1).getData();
-    if ( sfc != null || sfc.getFeatureCollection().size() > 0 ) {
+    if ( sfc != null && sfc.getFeatureCollection().size() > 0 ) {
       FeatureCollection fc = sfc.getFeatureCollection();
       FeatureIterator   fi = fc.features();
       Geometry          g  = null;



More information about the Xulu-commits mailing list