Skip to content

Commit

Permalink
Interceptors should decide whether a value should be mapped to null, …
Browse files Browse the repository at this point in the history
…not the MapTraverser.
  • Loading branch information
Skaar, Bjørn-Andre committed Apr 4, 2024
1 parent b619682 commit 74598bc
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/no/ssb/dlp/pseudo/core/map/MapTraverser.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,7 @@ else if (node instanceof Collection) {

static Object processValue(Object value, String path, ValueInterceptor interceptor) {
String newValue = interceptor.apply(new FieldDescriptor(path), (value == null) ? null : String.valueOf(value));
if (newValue != null) {
return (value == null)
? newValue
: FromString.convert(newValue, value.getClass());
}

return value;
return (value == null) ? newValue : FromString.convert(newValue, value.getClass());
}

private static boolean isTraversable(Object o) {
Expand Down

0 comments on commit 74598bc

Please sign in to comment.