Skip to content

Commit 4e96ab3

Browse files
authored
remove unused StringUtils#diff()
1 parent 6f73778 commit 4e96ab3

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

core/src/main/java/org/apache/cxf/common/util/StringUtils.java

-8
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ public static boolean isEmpty(List<String> list) {
6060
return list.size() == 1 && isEmpty(list.get(0));
6161
}
6262

63-
public static String diff(String str1, String str2) {
64-
int index = str1.lastIndexOf(str2);
65-
if (index > -1) {
66-
return str1.substring(str2.length());
67-
}
68-
return str1;
69-
}
70-
7163
public static String getFirstFound(String contents, String regex) {
7264
if (isEmpty(regex) || isEmpty(contents)) {
7365
return null;

core/src/test/java/org/apache/cxf/common/util/StringUtilsTest.java

-10
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@
2727

2828
public class StringUtilsTest {
2929

30-
@Test
31-
public void testDiff() throws Exception {
32-
String str1 = "http://local/SoapContext/SoapPort/greetMe/me/CXF";
33-
String str2 = "http://local/SoapContext/SoapPort";
34-
String str3 = "http://local/SoapContext/SoapPort/";
35-
assertEquals("/greetMe/me/CXF", StringUtils.diff(str1, str2));
36-
assertEquals("greetMe/me/CXF", StringUtils.diff(str1, str3));
37-
assertEquals("http://local/SoapContext/SoapPort/", StringUtils.diff(str3, str1));
38-
}
39-
4030
@Test
4131
public void testGetFirstFound() throws Exception {
4232
String regex = "velocity-\\d+\\.\\d+\\.jar";

0 commit comments

Comments
 (0)