Skip to content

Commit 74e90b9

Browse files
Undo change to record leaking underlying Iterator
1 parent cfbd8e8 commit 74e90b9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/org/springframework/data/redis/cache/BatchStrategies.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,16 @@ public long cleanCache(RedisConnection connection, String name, byte[] pattern)
132132
*
133133
* @param <T>
134134
*/
135-
record PartitionIterator<T>(Iterator<T> iterator, int size) implements Iterator<List<T>> {
135+
static class PartitionIterator<T> implements Iterator<List<T>> {
136+
137+
private final Iterator<T> iterator;
138+
private final int size;
139+
140+
PartitionIterator(Iterator<T> iterator, int size) {
141+
142+
this.iterator = iterator;
143+
this.size = size;
144+
}
136145

137146
@Override
138147
public boolean hasNext() {

0 commit comments

Comments
 (0)