diff flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java @ 3608:53aa395a29e0

FLYSArtifactCollection: Prevent another NPE. Removed dead code. flys-artifacts/trunk@5237 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 22 Aug 2012 13:47:26 +0000
parents 2b308a5d5281
children a5f65e8983be
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Wed Aug 22 13:38:51 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Wed Aug 22 13:47:26 2012 +0000
@@ -454,21 +454,20 @@
 
         FLYSContext flysContext = FLYSUtils.getFlysContext(context);
         StateEngine engine = (StateEngine) flysContext.get(
-                FLYSContext.STATE_ENGINE_KEY);
+            FLYSContext.STATE_ENGINE_KEY);
+
+        if (engine == null) {
+            log.error("buildOutAttributes: engine == null");
+            return null;
+        }
 
         FLYSArtifact masterArtifact = getMasterArtifact(context);
 
-        if(masterArtifact == null) {
+        if (masterArtifact == null) {
             log.debug("buildOutAttributes: masterArtifact == null");
             return null;
         }
 
-        // FIXME: ec is not used?
-        XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
-            doc,
-            ArtifactNamespaceContext.NAMESPACE_URI,
-            ArtifactNamespaceContext.NAMESPACE_PREFIX);
-
         OutputParser oParser = new OutputParser(db, context);
 
         if (uuids != null) {
@@ -484,10 +483,6 @@
 
         aParser.parse();
 
-        if(engine == null) {
-            log.debug("buildOutAttributes: engine == null");
-        }
-
         AttributeWriter aWriter = new AttributeWriter(
             db,
             aParser.getCollectionAttribute(),

http://dive4elements.wald.intevation.org