Skip to content

Commit

Permalink
Fix #4956
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 7, 2025
1 parent b72dd81 commit 4ac1ee9
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Versions: 3.x (for earlier see VERSION-2.x)
#4879: Rename `TextNode` as `StringNode`; `JsonNode.xxxTextYyy()` (mostly) as
`JsonNode.xxxStringYyy()` [JSTEP-3]
#4891: Change 3.0 to use `module-info.java` directly for build (instead of via Moditect)
#4956: Rename `JsonNode.isContainerNode()` as `isContainerNode()`
- Remove `MappingJsonFactory`
- Add context parameter for `TypeSerializer` contextualization (`forProperty()`)
- Default for `JsonNodeFeature.STRIP_TRAILING_BIGDECIMAL_ZEROES` changed to `false` for 3.0
2 changes: 1 addition & 1 deletion src/main/java/tools/jackson/databind/JsonNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public final boolean isValueNode()
}

@Override
public boolean isContainerNode() {
public boolean isContainer() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected boolean _withXxxMayReplace(JsonNode node, OverwriteMode overwriteMode)
case NULLS:
return node.isNull();
case SCALARS:
return !node.isContainerNode();
return !node.isContainer();
default:
case ALL:
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected ContainerNode(JsonNodeFactory nc) {
protected ContainerNode() { _nodeFactory = null; } // only for JDK ser

@Override
public boolean isContainerNode() {
public boolean isContainer() {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package tools.jackson.databind.deser.jdk;

import java.io.IOException;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/tools/jackson/databind/misc/TestBlocking.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package tools.jackson.databind.misc;

import java.io.IOException;

import org.junit.jupiter.api.Test;

import tools.jackson.core.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void testDirectCreation() throws Exception
assertFalse(n.canConvertToExactIntegral());
assertTrue(n.isArray());
assertFalse(n.isObject());
assertTrue(n.isContainerNode());
assertTrue(n.isContainer());

assertStandardEquals(n);
assertFalse(n.values().iterator().hasNext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void testMissingViaMapper() throws Exception
String JSON = "[ { }, [ ] ]";
JsonNode result = objectMapper().readTree(new StringReader(JSON));

assertTrue(result.isContainerNode());
assertTrue(result.isContainer());
assertTrue(result.isArray());
assertEquals(2, result.size());

Expand All @@ -58,7 +58,7 @@ public void testMissingViaMapper() throws Exception
Iterator<JsonNode> it = result.iterator();

JsonNode onode = it.next();
assertTrue(onode.isContainerNode());
assertTrue(onode.isContainer());
assertTrue(onode.isObject());
assertEquals(0, onode.size());
assertFalse(onode.isMissingNode()); // real node
Expand All @@ -83,7 +83,7 @@ public void testMissingViaMapper() throws Exception
// and same for the array node

JsonNode anode = it.next();
assertTrue(anode.isContainerNode());
assertTrue(anode.isContainer());
assertTrue(anode.isArray());
assertFalse(anode.isMissingNode()); // real node
assertEquals(0, anode.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void testBasicsWithNullNode() throws Exception
NullNode n = NullNode.instance;

// basic properties
assertFalse(n.isContainerNode());
assertFalse(n.isContainer());
assertFalse(n.isBigDecimal());
assertFalse(n.isBigInteger());
assertFalse(n.isBinary());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void testSimpleObject() throws Exception

// basic properties first:
assertFalse(root.isValueNode());
assertTrue(root.isContainerNode());
assertTrue(root.isContainer());
assertFalse(root.isArray());
assertTrue(root.isObject());
assertEquals(2, root.size());
Expand Down

0 comments on commit 4ac1ee9

Please sign in to comment.