From e0f6b384f58b6904691f596601572e1bc87af469 Mon Sep 17 00:00:00 2001 From: Stephen Crawford Date: Thu, 9 Nov 2023 16:57:10 -0500 Subject: [PATCH] spotless Signed-off-by: Stephen Crawford --- .../src/main/java/org/opensearch/common/regex/Regex.java | 1 - .../test/java/org/opensearch/common/regex/RegexTests.java | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/common/regex/Regex.java b/server/src/main/java/org/opensearch/common/regex/Regex.java index 22337e7130f76..323b460af62df 100644 --- a/server/src/main/java/org/opensearch/common/regex/Regex.java +++ b/server/src/main/java/org/opensearch/common/regex/Regex.java @@ -160,7 +160,6 @@ private static boolean simpleMatchWithNormalizedStrings(String pattern, String s return pIdx == pattern.length(); } - /** * Match a String against the given patterns, supporting the following simple * pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an diff --git a/server/src/test/java/org/opensearch/common/regex/RegexTests.java b/server/src/test/java/org/opensearch/common/regex/RegexTests.java index 524a101158067..4a3772b77fde7 100644 --- a/server/src/test/java/org/opensearch/common/regex/RegexTests.java +++ b/server/src/test/java/org/opensearch/common/regex/RegexTests.java @@ -105,7 +105,13 @@ public void testDoubleWildcardMatch() { assertFalse(Regex.simpleMatch("***xxxxxabcdxxxxx***", "xxxxxABCDxxxxx", false)); assertTrue(Regex.simpleMatch("***xxxxxabcdxxxxx***", "xxxxxABCDxxxxx", true)); assertTrue(Regex.simpleMatch("**stephenIsSuperCool**", "ItIsTrueThatStephenIsSuperCoolSoYouShouldLetThisIn", true)); - assertTrue(Regex.simpleMatch("**w**X**y**Z**", "abcdeFGHIJKLMNOPqrstuvwabcdeFGHIJKLMNOPqrstuvwXabcdeFGHIJKLMNOPqrstuvwXyabcdeFGHIJKLMNOPqrstuvwXyZ", false)); + assertTrue( + Regex.simpleMatch( + "**w**X**y**Z**", + "abcdeFGHIJKLMNOPqrstuvwabcdeFGHIJKLMNOPqrstuvwXabcdeFGHIJKLMNOPqrstuvwXyabcdeFGHIJKLMNOPqrstuvwXyZ", + false + ) + ); } public void testSimpleMatch() {