Skip to content

Commit c6e17ec

Browse files
committed
Use direct access
- Javadoc - Test deprecated and not
1 parent 58e1e12 commit c6e17ec

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/main/java/org/apache/commons/text/similarity/JaroWinklerDistance.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public class JaroWinklerDistance implements EditDistance<Double> {
3636
* @param first the first string to be matched.
3737
* @param second the second string to be matched.
3838
* @return array containing: matches, half transpositions, and prefix
39-
* @deprecated Deprecated as of 1.7. This method will be removed in 2.0, and moved to a Jaro Winkler similarity class. TODO see TEXT-104.
39+
* @deprecated Deprecated as of 1.7, use {@link JaroWinklerSimilarity#matches(CharSequence, CharSequence)}. This method will be removed in 2.0. TODO see
40+
* TEXT-104.
4041
*/
4142
@Deprecated
4243
protected static int[] matches(final CharSequence first, final CharSequence second) {

src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@ void testGetJaroWinklerDistance_StringString() {
108108

109109
@Test
110110
void testMatches() {
111-
assertArrayEquals(new int[]{2, 0, 2}, distance.matches("ab", "aba"));
111+
assertArrayEquals(new int[]{2, 0, 2}, JaroWinklerSimilarity.matches("ab", "aba"));
112+
}
113+
114+
@SuppressWarnings("deprecation")
115+
@Test
116+
void testMatchesDeprecated() {
117+
assertArrayEquals(new int[]{2, 0, 2}, JaroWinklerDistance.matches("ab", "aba"));
112118
}
113119

114120
}

0 commit comments

Comments
 (0)