This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/main by this push:
new 4e96ab320f remove unused StringUtils#diff()
4e96ab320f is described below
commit 4e96ab320fb1ff25a0b9d4116562b871d5a82b79
Author: Alexey Markevich <[email protected]>
AuthorDate: Mon Mar 24 11:54:55 2025 +0100
remove unused StringUtils#diff()
---
core/src/main/java/org/apache/cxf/common/util/StringUtils.java | 8 --------
.../test/java/org/apache/cxf/common/util/StringUtilsTest.java | 10 ----------
2 files changed, 18 deletions(-)
diff --git a/core/src/main/java/org/apache/cxf/common/util/StringUtils.java
b/core/src/main/java/org/apache/cxf/common/util/StringUtils.java
index 9f7c012f69..e65a7c8e9a 100644
--- a/core/src/main/java/org/apache/cxf/common/util/StringUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/StringUtils.java
@@ -60,14 +60,6 @@ public final class StringUtils {
return list.size() == 1 && isEmpty(list.get(0));
}
- public static String diff(String str1, String str2) {
- int index = str1.lastIndexOf(str2);
- if (index > -1) {
- return str1.substring(str2.length());
- }
- return str1;
- }
-
public static String getFirstFound(String contents, String regex) {
if (isEmpty(regex) || isEmpty(contents)) {
return null;
diff --git a/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
b/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
index e699dbede4..fc243c6744 100644
--- a/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java
@@ -27,16 +27,6 @@ import static org.junit.Assert.assertTrue;
public class StringUtilsTest {
- @Test
- public void testDiff() throws Exception {
- String str1 = "http://local/SoapContext/SoapPort/greetMe/me/CXF";
- String str2 = "http://local/SoapContext/SoapPort";
- String str3 = "http://local/SoapContext/SoapPort/";
- assertEquals("/greetMe/me/CXF", StringUtils.diff(str1, str2));
- assertEquals("greetMe/me/CXF", StringUtils.diff(str1, str3));
- assertEquals("http://local/SoapContext/SoapPort/",
StringUtils.diff(str3, str1));
- }
-
@Test
public void testGetFirstFound() throws Exception {
String regex = "velocity-\\d+\\.\\d+\\.jar";