From aaead182634cb583dfcd79ad11d808d1bb9ee1c7 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Wed, 11 Jun 2025 12:16:56 +0300 Subject: [PATCH] Fixed case sensitive matcher --- .../org/thingsboard/server/edqs/util/RepositoryUtils.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/edqs/src/main/java/org/thingsboard/server/edqs/util/RepositoryUtils.java b/common/edqs/src/main/java/org/thingsboard/server/edqs/util/RepositoryUtils.java index 1a47c4814f..1550c1df30 100644 --- a/common/edqs/src/main/java/org/thingsboard/server/edqs/util/RepositoryUtils.java +++ b/common/edqs/src/main/java/org/thingsboard/server/edqs/util/RepositoryUtils.java @@ -54,7 +54,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; -import java.util.Optional; import java.util.regex.Pattern; import java.util.stream.Stream; @@ -338,7 +337,7 @@ public class RepositoryUtils { return toSqlLikePattern(filter, ".*", "$"); } - private static Pattern toSqlLikePattern(String value, String prefix, String suffix ) { + private static Pattern toSqlLikePattern(String value, String prefix, String suffix) { if (value.contains("%") || value.contains("_")) { String regexValue = value .replace("_", ".") @@ -351,9 +350,9 @@ public class RepositoryUtils { } else { regex = (regexValue.startsWith(".*") ? "" : ".*") + regexValue + (regexValue.endsWith(".*") ? "" : ".*"); } - return Pattern.compile(regex, Pattern.CASE_INSENSITIVE); + return Pattern.compile(regex); } else { - return Pattern.compile(prefix + Pattern.quote(value) + suffix, Pattern.CASE_INSENSITIVE); + return Pattern.compile(prefix + Pattern.quote(value) + suffix); } }