Skip to content

Commit

Permalink
Fix #1373: change return type of TreeNode.propertyNames() (#1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored Dec 31, 2024
1 parent 7d46097 commit 7315d0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/java/tools/jackson/core/TreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package tools.jackson.core;

import java.util.Collection;
import java.util.Iterator;
import java.util.Spliterator;
import java.util.Spliterators;
Expand Down Expand Up @@ -227,7 +228,7 @@ public interface TreeNode
* @return An iterator for traversing names of all properties this Object node
* has (if Object node); empty {@link Iterator} otherwise (never {@code null}).
*/
Iterator<String> propertyNames();
Collection<String> propertyNames();

/**
* Method for accessing names of all properties for this node via a {@code Spliterator} ,
Expand All @@ -239,7 +240,7 @@ public interface TreeNode
* @since 3.0
*/
default Spliterator<String> propertyNameSpliterator() {
return Spliterators.spliteratorUnknownSize(propertyNames(), Spliterator.ORDERED);
return propertyNames().spliterator();
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/tools/jackson/core/util/DelegatesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Iterator;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -92,7 +93,7 @@ public TreeNode path(int index) {
}

@Override
public Iterator<String> propertyNames() {
public Collection<String> propertyNames() {
return null;
}

Expand Down

0 comments on commit 7315d0b

Please sign in to comment.