commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject [05/10] [text] TEXT-62: 307 checkstyle errors now
Date Mon, 30 Jan 2017 13:05:33 GMT
TEXT-62: 307 checkstyle errors now


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

Branch: refs/heads/release
Commit: cc4df476285fb580bcb98571663e07a4558e96e9
Parents: fb65bb6
Author: Rob Tompkins <chtompki@gmail.com>
Authored: Sat Jan 28 22:40:22 2017 -0500
Committer: Rob Tompkins <chtompki@gmail.com>
Committed: Sat Jan 28 22:40:22 2017 -0500

----------------------------------------------------------------------
 checkstyle-suppressions.xml                                  | 5 +++++
 .../java/org/apache/commons/text/beta/FormattableUtils.java  | 8 ++++----
 .../apache/commons/text/beta/similarity/JaccardDistance.java | 5 ++++-
 .../commons/text/beta/similarity/JaccardSimilarity.java      | 4 ++--
 4 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/cc4df476/checkstyle-suppressions.xml
----------------------------------------------------------------------
diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
index e445f90..f02851e 100644
--- a/checkstyle-suppressions.xml
+++ b/checkstyle-suppressions.xml
@@ -26,4 +26,9 @@
   <suppress checks="HideUtilityClassConstructor" files=".+\.java" lines="0-9999" />
   <suppress checks="VisibilityModifier" files=".+\.java" lines="0-9999" />
   <suppress checks="EmptyBlock" files="ExtendedMessageFormat.java" lines="387-390" />
+  <suppress checks="LocalFinalVariableName" files="FormattableUtils.java" lines="140-146"
/>
+  <suppress checks="MagicNumber" files="JaccardDistance.java" lines="0-99999" />
+  <suppress checks="MagicNumber" files="JaccardSimilarity.java" lines="0-9999" />
+  <suppress checks="MagicNumber" files="JaroWinklerDistance.java" lines="0-9999" />
+  <suppress checks="NoWhitespaceAfter" files="JaroWinklerDistance.java" lines="0-9999"
/>
 </suppressions>

http://git-wip-us.apache.org/repos/asf/commons-text/blob/cc4df476/src/main/java/org/apache/commons/text/beta/FormattableUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/beta/FormattableUtils.java b/src/main/java/org/apache/commons/text/beta/FormattableUtils.java
index 2cd40cd..687f2a9 100644
--- a/src/main/java/org/apache/commons/text/beta/FormattableUtils.java
+++ b/src/main/java/org/apache/commons/text/beta/FormattableUtils.java
@@ -137,13 +137,13 @@ public class FormattableUtils {
         }
         final StringBuilder buf = new StringBuilder(seq);
         if (precision >= 0 && precision < seq.length()) {
-            final CharSequence normalizedEllipsis;
+            final CharSequence _ellipsis;
             if (ellipsis == null) {
-                normalizedEllipsis = "";
+                _ellipsis = "";
             } else {
-                normalizedEllipsis = ellipsis;
+                _ellipsis = ellipsis;
             }
-            buf.replace(precision - normalizedEllipsis.length(), seq.length(), normalizedEllipsis.toString());
+            buf.replace(precision - _ellipsis.length(), seq.length(), _ellipsis.toString());
         }
         final boolean leftJustify = (flags & LEFT_JUSTIFY) == LEFT_JUSTIFY;
         for (int i = buf.length(); i < width; i++) {

http://git-wip-us.apache.org/repos/asf/commons-text/blob/cc4df476/src/main/java/org/apache/commons/text/beta/similarity/JaccardDistance.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/beta/similarity/JaccardDistance.java b/src/main/java/org/apache/commons/text/beta/similarity/JaccardDistance.java
index 515830d..6dcfbd4 100644
--- a/src/main/java/org/apache/commons/text/beta/similarity/JaccardDistance.java
+++ b/src/main/java/org/apache/commons/text/beta/similarity/JaccardDistance.java
@@ -30,12 +30,15 @@ package org.apache.commons.text.beta.similarity;
  */
 public class JaccardDistance implements EditDistance<Double> {
 
+    /**
+     * We normalize the jaccardSimilarity for the purpose of computing the distance.
+     */
     private final JaccardSimilarity jaccardSimilarity = new JaccardSimilarity();
 
     /**
      * Calculates Jaccard distance of two set character sequence passed as
      * input. Calculates Jaccard similarity and returns the complement of it.
-     * 
+     *
      * @param left first character sequence
      * @param right second character sequence
      * @return index

http://git-wip-us.apache.org/repos/asf/commons-text/blob/cc4df476/src/main/java/org/apache/commons/text/beta/similarity/JaccardSimilarity.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/beta/similarity/JaccardSimilarity.java
b/src/main/java/org/apache/commons/text/beta/similarity/JaccardSimilarity.java
index db3e08d..42da85d 100644
--- a/src/main/java/org/apache/commons/text/beta/similarity/JaccardSimilarity.java
+++ b/src/main/java/org/apache/commons/text/beta/similarity/JaccardSimilarity.java
@@ -36,7 +36,7 @@ public class JaccardSimilarity implements SimilarityScore<Double>
{
     /**
      * Calculates Jaccard Similarity of two set character sequence passed as
      * input.
-     * 
+     *
      * @param left first character sequence
      * @param right second character sequence
      * @return index
@@ -56,7 +56,7 @@ public class JaccardSimilarity implements SimilarityScore<Double>
{
      * input. Does the calculation by identifying the union (characters in at
      * least one of the two sets) of the two sets and intersection (characters
      * which are present in set one which are present in set two)
-     * 
+     *
      * @param left first character sequence
      * @param right second character sequence
      * @return index


Mime
View raw message