Skip to content

Commit 11dc483

Browse files
committed
Refactor to use a var arg method instead of private methods which are now no longer needed and removed.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1414901 13f79535-47bb-0310-9956-ffa450edef68
1 parent 6cac318 commit 11dc483

1 file changed

Lines changed: 1 addition & 58 deletions

File tree

src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -902,69 +902,12 @@ protected char charAt(String value, int index) {
902902
return value.charAt(index);
903903
}
904904

905-
/**
906-
* Shortcut method with 1 criteria.
907-
*/
908-
private static boolean contains(String value, int start, int length, String criteria) {
909-
return contains(value, start, length, new String[] { criteria });
910-
}
911-
912-
/**
913-
* Shortcut method with 2 criteria.
914-
*/
915-
private static boolean contains(String value, int start, int length,
916-
String criteria1, String criteria2) {
917-
return contains(value, start, length, new String[] { criteria1, criteria2 });
918-
}
919-
920-
/**
921-
* Shortcut method with 3 criteria.
922-
*/
923-
private static boolean contains(String value, int start, int length,
924-
String criteria1, String criteria2, String criteria3) {
925-
return contains(value, start, length, new String[] { criteria1, criteria2, criteria3 });
926-
}
927-
928-
/**
929-
* Shortcut method with 4 criteria.
930-
*/
931-
private static boolean contains(String value, int start, int length,
932-
String criteria1, String criteria2,
933-
String criteria3, String criteria4) {
934-
return contains(value, start, length,
935-
new String[] { criteria1, criteria2, criteria3, criteria4 });
936-
}
937-
938-
/**
939-
* Shortcut method with 5 criteria.
940-
*/
941-
private static boolean contains(String value, int start, int length,
942-
String criteria1, String criteria2,
943-
String criteria3, String criteria4,
944-
String criteria5) {
945-
return contains(value, start, length,
946-
new String[] { criteria1, criteria2, criteria3,
947-
criteria4, criteria5 });
948-
}
949-
950-
/**
951-
* Shortcut method with 6 criteria.
952-
*/
953-
private static boolean contains(String value, int start, int length,
954-
String criteria1, String criteria2,
955-
String criteria3, String criteria4,
956-
String criteria5, String criteria6) {
957-
return contains(value, start, length,
958-
new String[] { criteria1, criteria2, criteria3,
959-
criteria4, criteria5, criteria6 });
960-
}
961-
962905
/**
963906
* Determines whether <code>value</code> contains any of the criteria starting at index <code>start</code> and
964907
* matching up to length <code>length</code>.
965908
*/
966909
protected static boolean contains(String value, int start, int length,
967-
String[] criteria) {
910+
String... criteria) {
968911
boolean result = false;
969912
if (start >= 0 && start + length <= value.length()) {
970913
String target = value.substring(start, start + length);

0 commit comments

Comments
 (0)