Skip to content

Commit

Permalink
Fix #4875: remove JsonNode.fields() (#4877)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored Dec 31, 2024
1 parent 80f2c10 commit 6fbc98e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Versions: 3.x (for earlier see VERSION-2.x)
#4840: Increase minimum Android SDK required to 34 for Jackson 3.0
#4865: Add spliterator support in `JsonNode`
(contributed by @pjfanning)
#4875: Remove `JsonNode.fields()` from 3.0
- Remove `MappingJsonFactory`
- Add context parameter for `TypeSerializer` contextualization (`forProperty()`)
- Default for `JsonNodeFeature.STRIP_TRAILING_BIGDECIMAL_ZEROES` changed to `false` for 3.0
16 changes: 0 additions & 16 deletions src/main/java/tools/jackson/databind/JsonNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -1059,30 +1059,14 @@ public Spliterator<JsonNode> valueSpliterator() {
return values().spliterator();
}

/**
* NOTE: This method is deprecated, use {@link #properties()} instead.
*
* @return Iterator that can be used to traverse all key/value pairs for
* object nodes; empty iterator (no contents) for other types
*
* @deprecated As of 2.19, replaced by {@link #properties()}
*/
@Deprecated // since 2.19
public Iterator<Map.Entry<String, JsonNode>> fields() {
return properties().iterator();
}

/**
* Accessor that will return properties of {@code ObjectNode}
* similar to how {@link Map#entrySet()} works;
* for other node types will return empty {@link java.util.Set}.
* Replacement for {@link JsonNode#fields()}.
*
* @return Set of properties, if this node is an {@code ObjectNode}
* ({@link JsonNode#isObject()} returns {@code true}); empty
* {@link java.util.Set} otherwise.
*
* @since 2.15
*/
public Set<Map.Entry<String, JsonNode>> properties() {
return Collections.emptySet();
Expand Down

0 comments on commit 6fbc98e

Please sign in to comment.