diff src/java/de/intevation/mxd/reader/FeatureLayerReader.java @ 135:a4ab239509f1

Updated the default values and reader error handling.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 22 Jun 2011 13:55:22 +0200
parents 6b80d2c7536e
children f3a91cd7440b
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/FeatureLayerReader.java	Wed Jun 22 12:01:28 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/FeatureLayerReader.java	Wed Jun 22 13:55:22 2011 +0200
@@ -75,9 +75,9 @@
         }
         catch(IOException ioe) {
             logger.warn(
-                "Could not read name." +
-                " Setting name to \"default-layer\"");
-            layerElement.setAttribute("name", "default-layer");
+                "Could not read layer name." +
+                " Stopped reading layer.");
+            throw new IOException("Error reading layer name.");
         }
 
         try {
@@ -85,10 +85,7 @@
                 String.valueOf(layer.getMinimumScale()));
         }
         catch(IOException ioe) {
-            logger.warn(
-                "Could not read minimum scale." +
-                " Setting minimum scale to 0.");
-            layerElement.setAttribute("min_scale", "0");
+            logger.warn("Could not read minimum scale.");
         }
 
         try {
@@ -97,9 +94,7 @@
         }
         catch(IOException ioe) {
             logger.warn(
-                "Could not read maximum scale." +
-                " Setting maximum scale to 0.");
-            layerElement.setAttribute("max_scale", "0");
+                "Could not read maximum scale.");
         }
 
         try {
@@ -122,10 +117,8 @@
             type = layer.getShapeType();
         }
         catch(IOException ioe) {
-            logger.warn(
-                "Could not read shape type." +
-                " Setting shape type to \"none\".");
-            type = 0;
+            logger.warn("Could not read shape type.");
+            throw new IOException("Error reading shape type.");
         }
         switch (type) {
             case 0: layerElement.setAttribute("type", "none"); break;
@@ -140,9 +133,7 @@
         }
         catch(IOException ioe) {
             logger.warn(
-                "Could not read definition query." +
-                " Setting empty definition query.");
-            layerElement.setAttribute("definition_query", "");
+                "Could not read definition query.");
         }
         try {
             IName fcn = layer.getDataSourceName();
@@ -230,7 +221,7 @@
                 "Could not read layer datasource." +
                 " Stopped reading layer " + layer.getName() + ".");
             util.removeLayer(layerElement);
-            return null;            
+            return null;
         }
         return layerElement;
     }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)