You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pa...@apache.org on 2018/04/04 15:26:09 UTC

[text] Similarity package: do not mention Strings in IllegalArgumentException messages and javadoc when parameters are CharSequences

Repository: commons-text
Updated Branches:
  refs/heads/master ea1765e01 -> 51e22754a


Similarity package: do not mention Strings in IllegalArgumentException messages and javadoc when parameters are CharSequences


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/51e22754
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/51e22754
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/51e22754

Branch: refs/heads/master
Commit: 51e22754a685519b80fd16d5c24c43f1b73863e7
Parents: ea1765e
Author: Pascal Schumacher <pa...@gmx.net>
Authored: Wed Apr 4 17:26:02 2018 +0200
Committer: Pascal Schumacher <pa...@gmx.net>
Committed: Wed Apr 4 17:26:02 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/text/similarity/FuzzyScore.java  | 5 ++---
 .../apache/commons/text/similarity/LevenshteinDistance.java  | 8 ++++----
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/51e22754/src/main/java/org/apache/commons/text/similarity/FuzzyScore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/similarity/FuzzyScore.java b/src/main/java/org/apache/commons/text/similarity/FuzzyScore.java
index 8356960..48ea059 100644
--- a/src/main/java/org/apache/commons/text/similarity/FuzzyScore.java
+++ b/src/main/java/org/apache/commons/text/similarity/FuzzyScore.java
@@ -77,12 +77,11 @@ public class FuzzyScore {
      * @param query the query that will be matched against a term, must not be
      *            null
      * @return result score
-     * @throws IllegalArgumentException if either String input {@code null} or
-     *             Locale input {@code null}
+     * @throws IllegalArgumentException if either CharSequence input is {@code null}
      */
     public Integer fuzzyScore(final CharSequence term, final CharSequence query) {
         if (term == null || query == null) {
-            throw new IllegalArgumentException("Strings must not be null");
+            throw new IllegalArgumentException("CharSequences must not be null");
         }
 
         // fuzzy logic is case insensitive. We normalize the Strings to lower

http://git-wip-us.apache.org/repos/asf/commons-text/blob/51e22754/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java b/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java
index 1b1e903..68c13cb 100644
--- a/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java
+++ b/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java
@@ -328,14 +328,14 @@ public class LevenshteinDistance implements EditDistance<Integer> {
      * unlimitedCompare("hello", "hallo")    = 1
      * </pre>
      *
-     * @param left the first String, must not be null
-     * @param right the second String, must not be null
+     * @param left the first CharSequence, must not be null
+     * @param right the second CharSequence, must not be null
      * @return result distance, or -1
-     * @throws IllegalArgumentException if either String input {@code null}
+     * @throws IllegalArgumentException if either CharSequence input is {@code null}
      */
     private static int unlimitedCompare(CharSequence left, CharSequence right) {
         if (left == null || right == null) {
-            throw new IllegalArgumentException("Strings must not be null");
+            throw new IllegalArgumentException("CharSequences must not be null");
         }
 
         /*