Skip to content

Commit 2477bf2

Browse files
committed
Fix #1023
1 parent 0c83508 commit 2477bf2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ JSON library.
2121
(reported by Chris R)
2222
#1003: Add FastDoubleParser section to `NOTICE`
2323
#1014: Increase default max allowed String value length from 5 megs to 20 megs
24+
#1023: Problem with `FilteringGeneratorDelegate` wrt `TokenFilter.Inclusion.INCLUDE_NON_NULL`
25+
(reported by @honhimW)
2426

2527
2.15.0 (23-Apr-2023)
2628

src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java

+8
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ public void writeStartArray(Object forValue) throws IOException
254254
_checkParentPath();
255255
_filterContext = _filterContext.createChildArrayContext(_itemFilter, true);
256256
delegate.writeStartArray(forValue);
257+
} else if (_itemFilter != null && _inclusion == Inclusion.INCLUDE_NON_NULL) {
258+
_checkParentPath(false /* isMatch */);
259+
_filterContext = _filterContext.createChildArrayContext(_itemFilter, true);
260+
delegate.writeStartArray(forValue);
257261
} else {
258262
_filterContext = _filterContext.createChildArrayContext(_itemFilter, false);
259263
}
@@ -283,6 +287,10 @@ public void writeStartArray(Object forValue, int size) throws IOException
283287
_checkParentPath();
284288
_filterContext = _filterContext.createChildArrayContext(_itemFilter, true);
285289
delegate.writeStartArray(forValue, size);
290+
} else if (_itemFilter != null && _inclusion == Inclusion.INCLUDE_NON_NULL) {
291+
_checkParentPath(false /* isMatch */);
292+
_filterContext = _filterContext.createChildArrayContext(_itemFilter, true);
293+
delegate.writeStartArray(forValue, size);
286294
} else {
287295
_filterContext = _filterContext.createChildArrayContext(_itemFilter, false);
288296
}

0 commit comments

Comments
 (0)