This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 3b649d7095d4d35f36ba3f2f95e38c3406b046d4
Author: Alexey Markevich <[email protected]>
AuthorDate: Mon Mar 24 11:54:55 2025 +0100

    remove unused StringUtils#diff()
    
    (cherry picked from commit 4e96ab320fb1ff25a0b9d4116562b871d5a82b79)
    (cherry picked from commit e17c2eae741af0af4d400cbe060109bc9ba8aa33)
---
 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";

Reply via email to