From 2b37dc22a030c78c9196c50e22200f36cc861876 Mon Sep 17 00:00:00 2001 From: Diego Krupitza Date: Sat, 4 Dec 2021 09:18:30 +0100 Subject: [PATCH] Removed deprecated function call in `JpaQueryMethod`. The method `assertParameterNamesInAnnotatedQuery()` used the deprecated function `StringUtils.isEmpty(String)`. This has been changed to a function call that is not deprecated and has the same logic. Original pull request #2375 --- .../data/jpa/repository/query/JpaQueryMethod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java b/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java index 37a3cbdce..f8eaebb5d 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/JpaQueryMethod.java @@ -165,7 +165,7 @@ public class JpaQueryMethod extends QueryMethod { continue; } - if (StringUtils.isEmpty(annotatedQuery) + if (!StringUtils.hasText(annotatedQuery) || !annotatedQuery.contains(String.format(":%s", parameter.getName().get())) && !annotatedQuery.contains(String.format("#%s", parameter.getName().get()))) { throw new IllegalStateException(