Mercurial > dive4elements > river
changeset 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 | e0f54fab55d3 |
children | a16837d73130 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java |
diffstat | 2 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Aug 22 13:38:51 2012 +0000 +++ b/flys-artifacts/ChangeLog Wed Aug 22 13:47:26 2012 +0000 @@ -1,3 +1,8 @@ +2012-08-22 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java: + Prevent another NPE. Removed dead code. + 2012-08-22 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java:
--- 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(),