changeset 3233:7e5460d08eb0

WINFOArtifact: minor code improvement when lookup if facet should be initially active. flys-artifacts/trunk@4864 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 03 Jul 2012 13:21:11 +0000
parents cdbc457e23e2
children 1aec30e75bcb
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java
diffstat 2 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Jul 03 12:52:58 2012 +0000
+++ b/flys-artifacts/ChangeLog	Tue Jul 03 13:21:11 2012 +0000
@@ -1,3 +1,8 @@
+2012-07-03	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java:
+	  Replaced Arrays.asList(new String[] { "a", "b" }).contains("a") code.
+
 2012-07-03	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* doc/conf/themes.xml,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Tue Jul 03 12:52:58 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Tue Jul 03 13:21:11 2012 +0000
@@ -4,6 +4,10 @@
 
 import de.intevation.artifacts.CallContext;
 
+import de.intevation.artifacts.common.utils.StringUtils;
+
+import de.intevation.flys.artifacts.geom.Lines;
+
 import de.intevation.flys.artifacts.model.Calculation1;
 import de.intevation.flys.artifacts.model.Calculation2;
 import de.intevation.flys.artifacts.model.Calculation3;
@@ -24,8 +28,6 @@
 
 import de.intevation.flys.artifacts.states.LocationDistanceSelect;
 
-import de.intevation.flys.artifacts.geom.Lines;
-
 import de.intevation.flys.model.DischargeTable;
 import de.intevation.flys.model.FastCrossSectionLine;
 import de.intevation.flys.model.Gauge;
@@ -1165,10 +1167,6 @@
      */
     @Override
     public int getInitialFacetActivity(String outputName, String facetName, int index) {
-        String [] inactives = new String[] {
-                                            LONGITUDINAL_Q,
-                                            DURATION_Q
-                                           };
 
         logger.debug("WINFOArtifact.active?: "
             + outputName
@@ -1181,11 +1179,14 @@
             {
                 return 0;
             }
-        return Arrays.asList(inactives).contains(facetName)
-               ? 0
-               : 1;
+
+        return StringUtils.contains(facetName, INACTIVES) ? 0 : 1;
     }
 
+    private static final String [] INACTIVES = new String[] {
+        LONGITUDINAL_Q,
+        DURATION_Q
+    };
 
     /**
      * Returns the WstValueTable.

http://dive4elements.wald.intevation.org