From a097edb07dd994c669e0d5ca6713c7cf2b2ca8e1 Mon Sep 17 00:00:00 2001 From: "Valeriy.Vyrva" Date: Thu, 19 Apr 2018 11:19:15 +0300 Subject: [PATCH] Convert Vavr Seq to list with asJava method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit asJava(…) creates a read-only view instead of copying elements into a new List. Closes #2217 Original pull request: #287 --- .../springframework/data/repository/util/VavrCollections.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/repository/util/VavrCollections.java b/src/main/java/org/springframework/data/repository/util/VavrCollections.java index e8bf180a0..87153f853 100644 --- a/src/main/java/org/springframework/data/repository/util/VavrCollections.java +++ b/src/main/java/org/springframework/data/repository/util/VavrCollections.java @@ -60,7 +60,7 @@ class VavrCollections { public Object convert(Object source) { if (source instanceof io.vavr.collection.Seq) { - return ((io.vavr.collection.Seq) source).toJavaList(); + return ((io.vavr.collection.Seq) source).asJava(); } if (source instanceof io.vavr.collection.Map) { @@ -71,7 +71,7 @@ class VavrCollections { return ((io.vavr.collection.Set) source).toJavaSet(); } - throw new IllegalArgumentException("Unsupported Javaslang collection " + source.getClass()); + throw new IllegalArgumentException("Unsupported Vavr collection " + source.getClass()); } }