Skip to content

Commit a097edb

Browse files
valery1707mp911de
authored andcommitted
Convert Vavr Seq to list with asJava method.
asJava(…) creates a read-only view instead of copying elements into a new List. Closes spring-projects#2217 Original pull request: spring-projects#287
1 parent 47ee922 commit a097edb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/springframework/data/repository/util/VavrCollections.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public WrapperType getWrapperType() {
6060
public Object convert(Object source) {
6161

6262
if (source instanceof io.vavr.collection.Seq) {
63-
return ((io.vavr.collection.Seq<?>) source).toJavaList();
63+
return ((io.vavr.collection.Seq<?>) source).asJava();
6464
}
6565

6666
if (source instanceof io.vavr.collection.Map) {
@@ -71,7 +71,7 @@ public Object convert(Object source) {
7171
return ((io.vavr.collection.Set<?>) source).toJavaSet();
7272
}
7373

74-
throw new IllegalArgumentException("Unsupported Javaslang collection " + source.getClass());
74+
throw new IllegalArgumentException("Unsupported Vavr collection " + source.getClass());
7575
}
7676
}
7777

0 commit comments

Comments
 (0)