Skip to content

Commit cd15988

Browse files
committed
Fix #1373: change return type of TreeNode.propertyNames()
1 parent 7d46097 commit cd15988

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/tools/jackson/core/TreeNode.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package tools.jackson.core;
77

8+
import java.util.Collection;
89
import java.util.Iterator;
910
import java.util.Spliterator;
1011
import java.util.Spliterators;
@@ -227,7 +228,7 @@ public interface TreeNode
227228
* @return An iterator for traversing names of all properties this Object node
228229
* has (if Object node); empty {@link Iterator} otherwise (never {@code null}).
229230
*/
230-
Iterator<String> propertyNames();
231+
Collection<String> propertyNames();
231232

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

245246
/**

src/test/java/tools/jackson/core/util/DelegatesTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.*;
44
import java.math.BigDecimal;
55
import java.math.BigInteger;
6+
import java.util.Collection;
67
import java.util.Iterator;
78

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

9495
@Override
95-
public Iterator<String> propertyNames() {
96+
public Collection<String> propertyNames() {
9697
return null;
9798
}
9899

0 commit comments

Comments
 (0)