jmuehlner commented on a change in pull request #689:
URL: https://github.com/apache/guacamole-client/pull/689#discussion_r792304584



##########
File path: 
guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java
##########
@@ -273,6 +347,34 @@ public void filterValues(Map<?, String> map) {
             String value = entry.getValue();
             if (value != null)
                 entry.setValue(filter(value));
+
+        }
+
+    }
+
+    /**
+     * Given an arbitrary map containing String values, replace each non-null
+     * value with the corresponding filtered value. If any token in any string
+     * has no defined value within this TokenFilter, a
+     * GuacamoleTokenUndefinedException will be thrown.
+     *
+     * @param map
+     *     The map whose values should be filtered.
+     *
+     * @throws GuacamoleTokenUndefinedException
+     *     If at least one token in at least one string has no corresponding
+     *     value.
+     */
+    public void filterValuesStrict(Map<?, String> map)

Review comment:
       I think this API might be a little more straightforward if there were a 
1 and 2 argument version each of `filterValue` and `filterValues`, with the 
1-argument version passing `false` for the `strict` parameter. That would also 
reduce the duplicated iteration code in this function.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to