From 013869fae3f4acf453d54de67d6202e9847fe4a4 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Wed, 10 Jul 2024 06:39:45 +0530 Subject: [PATCH] chore: Remove unused `regexMatchIgnoreCase` (#34824) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This method isn't used anywhere, EE included, and we don't want it to be used either. There's specialized methods for things this was used in the past, `searchIgnoreCase` and `inIgnoresCase`, and should be preferred instead of this. If a new need comes up that needs regex, we'll come up with a specialized query method again. **/test sanity** > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 7b4eef3f04e81ec96c4f88b8c3e354dae95e92b3 > Cypress dashboard. > Tags: `@tag.Sanity` > Spec: >
Tue, 09 Jul 2024 14:13:55 UTC ## Summary by CodeRabbit - **Refactor** - Removed deprecated `regexMatchIgnoreCase` method for cleaner and more maintainable code. - Updated `equal` method to improve flexibility by accepting `int` values without the `@NonNull` annotation. --- .../java/com/appsmith/server/helpers/ce/bridge/Bridge.java | 5 ----- .../com/appsmith/server/helpers/ce/bridge/BridgeQuery.java | 7 +------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/Bridge.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/Bridge.java index 78d0814156..f97f72f6b3 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/Bridge.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/Bridge.java @@ -79,11 +79,6 @@ public final class Bridge { return Bridge.query().equal(key, value); } - @Deprecated - public static BridgeQuery regexMatchIgnoreCase(@NonNull String key, String regexPattern) { - return Bridge.query().regexMatchIgnoreCase(key, regexPattern); - } - public static BridgeQuery searchIgnoreCase(@NonNull String key, @NonNull String needle) { return Bridge.query().searchIgnoreCase(key, needle); } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/BridgeQuery.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/BridgeQuery.java index 39edfa938d..931b2edbe9 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/BridgeQuery.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/bridge/BridgeQuery.java @@ -22,7 +22,7 @@ public final class BridgeQuery extends Criteria { return this; } - public BridgeQuery equal(@NonNull String key, @NonNull int value) { + public BridgeQuery equal(@NonNull String key, int value) { checks.add(Criteria.where(key).is(value)); return this; } @@ -58,11 +58,6 @@ public final class BridgeQuery extends Criteria { return this; } - public BridgeQuery regexMatchIgnoreCase(@NonNull String key, @NonNull String regexPattern) { - checks.add(Criteria.where(key).regex(regexPattern, "i")); - return this; - } - public BridgeQuery searchIgnoreCase(@NonNull String key, @NonNull String needle) { if (key.contains(".")) { throw new UnsupportedOperationException("Search-ignore-case is not supported for nested fields");