This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/main by this push:
new 4e37167 Mask Field Action: Better handling of prexistent values
4e37167 is described below
commit 4e371672cf5927364445f21bf6de08258a6f0548
Author: Andrea Cosentino <[email protected]>
AuthorDate: Thu May 6 07:45:22 2021 +0200
Mask Field Action: Better handling of prexistent values
---
.../java/org/apache/camel/kamelets/utils/transform/MaskField.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/transform/MaskField.java
b/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/transform/MaskField.java
index cf94e5b..58a563f 100644
---
a/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/transform/MaskField.java
+++
b/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/transform/MaskField.java
@@ -79,10 +79,8 @@ public class MaskField {
for (Map.Entry entry:
body.entrySet()) {
final String fieldName = (String) entry.getKey();
- if (filterNames(fieldName, splittedFields)) {
- final Object fieldValue = entry.getValue();
- updatedBody.put(entry.getKey(), masked(fieldValue,
replacement));
- }
+ final Object origFieldValue = entry.getValue();
+ updatedBody.put(fieldName, filterNames(fieldName, splittedFields)
? masked(origFieldValue, replacement) : origFieldValue);
}
if (!updatedBody.isEmpty()) {
return updatedBody;