Skip to content

Commit

Permalink
ObjectNode does not implement Iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Nov 15, 2024
1 parent 3de51fd commit 6d9aec4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.jetbrains.annotations.NotNull;

class GenericNodeBuilder implements NodeBuilder {
private static final GenericNodeBuilder INSTANCE = new GenericNodeBuilder();
Expand Down Expand Up @@ -276,7 +275,7 @@ public String toString() {
}
}

static final class ObjectNode extends NodeSkeleton implements Iterable<Node.KeyValue> {
static final class ObjectNode extends NodeSkeleton {
private final Map<String, Object> jsonObject;
private final NodeBuilder nodeBuilder;

Expand Down Expand Up @@ -317,11 +316,6 @@ public boolean isObject() {
return true;
}

@Override
public @NotNull Iterator<KeyValue> iterator() {
return fields();
}

@Override
public Node get(String key) {
if (jsonObject.containsKey(key)) {
Expand All @@ -344,7 +338,7 @@ public NodeType getNodeType() {
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("{");
Iterator<Node.KeyValue> entries = this.iterator();
Iterator<Node.KeyValue> entries = this.fields();
while (entries.hasNext()) {
Node.KeyValue entry = entries.next();
builder.append('"')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ protected void shouldEqualNumberInObject() {
// ignored, no support of object serialization neither
}


@Override
@Test
protected void objectFieldsShouldBeKeptInOrder() {
Expand Down

0 comments on commit 6d9aec4

Please sign in to comment.