OFoverlay statistics test improvement
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / statistics / flowcache / FlowCacheKeys.java
old mode 100644 (file)
new mode 100755 (executable)
index 3761b25..7a59d10
@@ -39,8 +39,21 @@ public final class FlowCacheKeys {
             return values;
         }
 
+        /**
+         * Sets FlowCache's "key" values by copying {@code String}s from {@code values},
+         * to avoid immutable list put as a parameter.
+         * {@code null}s are omitted.
+         *
+         * @param values List of String
+         * @return FlowCacheKeysBuilder
+         */
         public FlowCacheKeysBuilder setValues(List<String> values) {
-            this.values = Preconditions.checkNotNull(values);
+            Preconditions.checkNotNull(values);
+            for (String value : values) {
+                if (value != null) {
+                    this.values.add(value);
+                }
+            }
             return this;
         }