You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2020/09/04 11:40:43 UTC

[commons-codec] branch master updated (ea6058c -> ae667e0)

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git.


    from ea6058c  Update binary compatibility version
     new 738b50d  Improve variable name to describe the bug in Codec 101.
     new e2eb50c  Remove unused import
     new 316fb26  Fix checkstyle for test sources
     new ae667e0  Add test sources to checkstyle:check

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 checkstyle-suppressions.xml                        |   7 ++
 pom.xml                                            |   2 +
 .../apache/commons/codec/binary/Base32Test.java    |   3 +-
 .../codec/binary/Base64InputStreamTest.java        |   4 +-
 .../apache/commons/codec/binary/Base64Test.java    |  38 ++++----
 .../commons/codec/binary/Base64TestData.java       | 100 +++++++++++----------
 .../commons/codec/binary/BaseNCodecTest.java       |   3 +-
 .../apache/commons/codec/digest/HmacUtilsTest.java |   8 +-
 .../commons/codec/digest/PureJavaCrc32Test.java    |  29 +++---
 .../commons/codec/digest/XXHash32OverflowTest.java |  26 +++---
 .../apache/commons/codec/digest/XXHash32Test.java  |  26 +++---
 .../language/MatchRatingApproachEncoderTest.java   |   2 +-
 .../codec/language/bm/BeiderMorseEncoderTest.java  |   6 +-
 13 files changed, 130 insertions(+), 124 deletions(-)


[commons-codec] 01/04: Improve variable name to describe the bug in Codec 101.

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git

commit 738b50de4d72083a93b8ff57c83b112f5ecd882f
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Sep 4 12:14:50 2020 +0100

    Improve variable name to describe the bug in Codec 101.
---
 .../java/org/apache/commons/codec/binary/Base64InputStreamTest.java | 4 ++--
 src/test/java/org/apache/commons/codec/binary/Base64TestData.java   | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java b/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java
index 1e80dde..c65d155 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java
@@ -91,7 +91,7 @@ public class Base64InputStreamTest {
      */
     @Test
     public void testCodec101() throws Exception {
-        final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_MULTIPLE_OF_3);
+        final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_INPUT_LENGTH_IS_MULTIPLE_OF_3);
         final ByteArrayInputStream bais = new ByteArrayInputStream(codec101);
         try (final Base64InputStream in = new Base64InputStream(bais)) {
             final byte[] result = new byte[8192];
@@ -120,7 +120,7 @@ public class Base64InputStreamTest {
      */
     @Test
     public void testInputStreamReader() throws Exception {
-        final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_MULTIPLE_OF_3);
+        final byte[] codec101 = StringUtils.getBytesUtf8(Base64TestData.CODEC_101_INPUT_LENGTH_IS_MULTIPLE_OF_3);
         final ByteArrayInputStream bais = new ByteArrayInputStream(codec101);
         final Base64InputStream in = new Base64InputStream(bais);
         final InputStreamReader isr = new InputStreamReader(in);
diff --git a/src/test/java/org/apache/commons/codec/binary/Base64TestData.java b/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
index 5e45860..d99f3c2 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
@@ -28,7 +28,11 @@ import java.util.Random;
  */
 public class Base64TestData {
 
-    public static final String CODEC_101_MULTIPLE_OF_3 = "124";
+    /**
+     * A valid base 64 encoding that has a length that is a multiple of 3.
+     * @see <a href="https://issues.apache.org/jira/browse/CODEC-101">Codec 101</a>
+     */
+    public static final String CODEC_101_INPUT_LENGTH_IS_MULTIPLE_OF_3 = "124";
 
     public static final String CODEC_98_NPE
         = "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM";


[commons-codec] 03/04: Fix checkstyle for test sources

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git

commit 316fb263de53a58deba557971784c702ebce3aee
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Sep 4 12:40:11 2020 +0100

    Fix checkstyle for test sources
---
 .../apache/commons/codec/binary/Base32Test.java    |  3 +-
 .../apache/commons/codec/binary/Base64Test.java    | 38 ++++-----
 .../commons/codec/binary/Base64TestData.java       | 92 +++++++++++-----------
 .../commons/codec/binary/BaseNCodecTest.java       |  3 +-
 .../apache/commons/codec/digest/HmacUtilsTest.java |  8 +-
 .../commons/codec/digest/PureJavaCrc32Test.java    | 29 ++++---
 .../commons/codec/digest/XXHash32OverflowTest.java | 26 +++---
 .../apache/commons/codec/digest/XXHash32Test.java  | 26 +++---
 .../language/MatchRatingApproachEncoderTest.java   |  2 +-
 .../codec/language/bm/BeiderMorseEncoderTest.java  |  6 +-
 10 files changed, 114 insertions(+), 119 deletions(-)

diff --git a/src/test/java/org/apache/commons/codec/binary/Base32Test.java b/src/test/java/org/apache/commons/codec/binary/Base32Test.java
index f8ada64..068f5f8 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base32Test.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base32Test.java
@@ -6,14 +6,13 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 
 package org.apache.commons.codec.binary;
diff --git a/src/test/java/org/apache/commons/codec/binary/Base64Test.java b/src/test/java/org/apache/commons/codec/binary/Base64Test.java
index 448d633..a6e834b 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64Test.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64Test.java
@@ -225,11 +225,12 @@ public class Base64Test {
 
     @Test
     public void testCodeInteger3() {
-        final String encodedInt3 = "FKIhdgaG5LGKiEtF1vHy4f3y700zaD6QwDS3IrNVGzNp2"
-                + "rY+1LFWTK6D44AyiC1n8uWz1itkYMZF0/aKDK0Yjg==";
+        final String encodedInt3 = "FKIhdgaG5LGKiEtF1vHy4f3y700zaD6QwDS3IrNVGzNp2" +
+            "rY+1LFWTK6D44AyiC1n8uWz1itkYMZF0/aKDK0Yjg==";
         final BigInteger bigInt3 = new BigInteger(
-                "10806548154093873461951748545" + "1196989136416448805819079363524309897749044958112417136240557"
-                        + "4495062430572478766856090958495998158114332651671116876320938126");
+            "10806548154093873461951748545" +
+            "1196989136416448805819079363524309897749044958112417136240557" +
+            "4495062430572478766856090958495998158114332651671116876320938126");
 
         assertEquals(encodedInt3, new String(Base64.encodeInteger(bigInt3)));
         assertEquals(bigInt3, Base64.decodeInteger(encodedInt3.getBytes(CHARSET_UTF8)));
@@ -237,15 +238,16 @@ public class Base64Test {
 
     @Test
     public void testCodeInteger4() {
-        final String encodedInt4 = "ctA8YGxrtngg/zKVvqEOefnwmViFztcnPBYPlJsvh6yKI"
-                + "4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJtgJAEto0xAs+Mehuq1DkSFEpP3o"
-                + "DzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LVlMdwZNFNNJoqMcT2ZfCPrfvYv" + "Q0=";
-        final BigInteger bigInt4 = new BigInteger(
-                "80624726256040348115552042320" + "6968135001872753709424419772586693950232350200555646471175944"
-                        + "519297087885987040810778908507262272892702303774422853675597"
-                        + "748008534040890923814202286633163248086055216976551456088015"
-                        + "338880713818192088877057717530169381044092839402438015097654"
-                        + "53542091716518238707344493641683483917");
+        final String encodedInt4 = "ctA8YGxrtngg/zKVvqEOefnwmViFztcnPBYPlJsvh6yKI" +
+            "4iDm68fnp4Mi3RrJ6bZAygFrUIQLxLjV+OJtgJAEto0xAs+Mehuq1DkSFEpP3o" +
+            "DzCTOsrOiS1DwQe4oIb7zVk/9l7aPtJMHW0LVlMdwZNFNNJoqMcT2ZfCPrfvYv" +
+            "Q0=";
+        final BigInteger bigInt4 = new BigInteger("80624726256040348115552042320" +
+            "6968135001872753709424419772586693950232350200555646471175944" +
+            "519297087885987040810778908507262272892702303774422853675597" +
+            "748008534040890923814202286633163248086055216976551456088015" +
+            "338880713818192088877057717530169381044092839402438015097654" +
+            "53542091716518238707344493641683483917");
 
         assertEquals(encodedInt4, new String(Base64.encodeInteger(bigInt4)));
         assertEquals(bigInt4, Base64.decodeInteger(encodedInt4.getBytes(CHARSET_UTF8)));
@@ -545,12 +547,12 @@ public class Base64Test {
             final Base64 b64 = new Base64();
             final byte[] result = b64.decode(bArray);
 
-            assertEquals("The result should be empty as the test encoded content did "
-                    + "not contain any valid base 64 characters", 0, result.length);
+            assertEquals("The result should be empty as the test encoded content did " +
+                "not contain any valid base 64 characters", 0, result.length);
         } catch (final Exception e) {
-            fail("Exception was thrown when trying to decode "
-                    + "invalid base64 encoded data - RFC 2045 requires that all "
-                    + "non base64 character be discarded, an exception should not" + " have been thrown");
+            fail("Exception was thrown when trying to decode " +
+                "invalid base64 encoded data - RFC 2045 requires that all " +
+                "non base64 character be discarded, an exception should not" + " have been thrown");
         }
     }
 
diff --git a/src/test/java/org/apache/commons/codec/binary/Base64TestData.java b/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
index 0dbdb55..f1e3f1b 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
@@ -32,56 +32,56 @@ public class Base64TestData {
      */
     public static final String CODEC_101_INPUT_LENGTH_IS_MULTIPLE_OF_3 = "124";
 
-    public static final String CODEC_98_NPE
-        = "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM";
+    public static final String CODEC_98_NPE =
+        "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM";
 
-    public static final String CODEC_98_NPE_DECODED
-        = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123";
+    public static final String CODEC_98_NPE_DECODED =
+        "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123";
 
 
     // OpenSSL doesn't include the final \n, but it would be annoying beyond belief
     // to further parameterize commons-codec to support this pointless variation.
-    final static String ENCODED_64_CHARS_PER_LINE
-            = "9IPNKwUvdLiIAp6ctz12SiQmOGstWyYvSPeevufDhrzaws65voykKjbIj33YWTa9\n"
-            + "xA7c/FHypWclrZhQ7onfc3JE93BJ5fT4R9zAEdjbjy1hv4ZYNnET4WJeXMLJ/5p+\n"
-            + "qBpTsPpepW8DNVYy1c02/1wyC+kgA6CvRUd9cSr/lt88AEdsTV4GMCn1+EwuAiYd\n"
-            + "ivxuzn+cLM8q2jewqlI52tP9J7Cs8vqG71s6+WAELKvm/UovvyaOi+OdMUfjQ0JL\n"
-            + "iLkHu6p9OwUgvQqiDKzEv/Augo0dTPZzYGEyCP5GVrle3QQdgciIHnpdd4VUTPGR\n"
-            + "UbXeKbh++U3fbJIng/sQXM3IYByMZ7xt9HWS1LUcRdQ7Prwn/IlQWxOMeq+KZJSo\n"
-            + "AviWtdserXyHbIEa//hmr4p/j80k0g9q35hq1ayGM9984ALTSaZ8WeyFbZx1CxC/\n"
-            + "Qoqf92UH/ylBRnSJNn4sS0oa3uUbNvOnpkB4D9V7Ut9atinCJrw+wiJcMl+9kp25\n"
-            + "1IUxBGA4cUxh0eaxk3ODWnwI95EktmWOKwCSP0xjWwIMxDjygwAG5R8fk9H9bVi1\n"
-            + "thMavm4nDc4vaNoSE1RnZNYwbiUVlVPM9EclvJWTWd6igWeA0MxHAA8iOM5Vnmqp\n"
-            + "/WGM7UDq59rBIdNQCoeTJaAkEtAuLL5zogOa5e+MzVjvB5MYQlOlaaTtQrRApXa5\n"
-            + "Z4VfEanu9UK2fi1T8jJPFC2PmXebxp0bnO+VW+bgyEdIIkIQCaZq1MKWC3KuiOS9\n"
-            + "BJ1t7O0A2JKJKvoE4UNulzV2TGCC+KAnmjRqQBqXlJmgjHQAoHNZKOma/uIQOsvf\n"
-            + "DnqicYdDmfyCYuV89HjA1H8tiDJ85VfsrFHdcbPAoNCpi65awJSHfdPO1NDONOK+\n"
-            + "+S7Y0VXUgoYYrBV4Y7YbC8wg/nqcimr3lm3tRyp+QsgKzdREbfNRk0F5PLyLfsUE\n"
-            + "lepjs1QdV3fEV1LJtiywA3ubVNQJRxhbYxa/C/Xy2qxpm6vvdL92l3q1ccev35Ic\n"
-            + "aOiSx7Im+/GxV2lVKdaOvYVGDD1zBRe6Y2CwQb9p088l3/93qGR5593NCiuPPWcs\n"
-            + "DWwUShM1EyW0FNX1F8bnzHnYijoyE/jf4s/l9bBd7yJdRWRCyih2WcypAiOIEkBs\n"
-            + "H+dCTgalu8sRDoMh4ZIBBdgHfoZUycLqReQFLZZ4Sl4zSmzt5vQxQFhEKb9+ff/4\n"
-            + "rb1KAo6wifengxVfIsa2b5ljXzAqXs7JkPvmC6fa7X4ZZndRokaxYlu3cg8OV+uG\n"
-            + "/6YAHZilo8at0OpkkNdNFuhwuGlkBqrZKNUj/gSiYYc06gF/r/z6iWAjpXJRW1qq\n"
-            + "3CLZXdZFZ/VrqXeVjtOAu2A=\n";
+    final static String ENCODED_64_CHARS_PER_LINE =
+        "9IPNKwUvdLiIAp6ctz12SiQmOGstWyYvSPeevufDhrzaws65voykKjbIj33YWTa9\n" +
+        "xA7c/FHypWclrZhQ7onfc3JE93BJ5fT4R9zAEdjbjy1hv4ZYNnET4WJeXMLJ/5p+\n" +
+        "qBpTsPpepW8DNVYy1c02/1wyC+kgA6CvRUd9cSr/lt88AEdsTV4GMCn1+EwuAiYd\n" +
+        "ivxuzn+cLM8q2jewqlI52tP9J7Cs8vqG71s6+WAELKvm/UovvyaOi+OdMUfjQ0JL\n" +
+        "iLkHu6p9OwUgvQqiDKzEv/Augo0dTPZzYGEyCP5GVrle3QQdgciIHnpdd4VUTPGR\n" +
+        "UbXeKbh++U3fbJIng/sQXM3IYByMZ7xt9HWS1LUcRdQ7Prwn/IlQWxOMeq+KZJSo\n" +
+        "AviWtdserXyHbIEa//hmr4p/j80k0g9q35hq1ayGM9984ALTSaZ8WeyFbZx1CxC/\n" +
+        "Qoqf92UH/ylBRnSJNn4sS0oa3uUbNvOnpkB4D9V7Ut9atinCJrw+wiJcMl+9kp25\n" +
+        "1IUxBGA4cUxh0eaxk3ODWnwI95EktmWOKwCSP0xjWwIMxDjygwAG5R8fk9H9bVi1\n" +
+        "thMavm4nDc4vaNoSE1RnZNYwbiUVlVPM9EclvJWTWd6igWeA0MxHAA8iOM5Vnmqp\n" +
+        "/WGM7UDq59rBIdNQCoeTJaAkEtAuLL5zogOa5e+MzVjvB5MYQlOlaaTtQrRApXa5\n" +
+        "Z4VfEanu9UK2fi1T8jJPFC2PmXebxp0bnO+VW+bgyEdIIkIQCaZq1MKWC3KuiOS9\n" +
+        "BJ1t7O0A2JKJKvoE4UNulzV2TGCC+KAnmjRqQBqXlJmgjHQAoHNZKOma/uIQOsvf\n" +
+        "DnqicYdDmfyCYuV89HjA1H8tiDJ85VfsrFHdcbPAoNCpi65awJSHfdPO1NDONOK+\n" +
+        "+S7Y0VXUgoYYrBV4Y7YbC8wg/nqcimr3lm3tRyp+QsgKzdREbfNRk0F5PLyLfsUE\n" +
+        "lepjs1QdV3fEV1LJtiywA3ubVNQJRxhbYxa/C/Xy2qxpm6vvdL92l3q1ccev35Ic\n" +
+        "aOiSx7Im+/GxV2lVKdaOvYVGDD1zBRe6Y2CwQb9p088l3/93qGR5593NCiuPPWcs\n" +
+        "DWwUShM1EyW0FNX1F8bnzHnYijoyE/jf4s/l9bBd7yJdRWRCyih2WcypAiOIEkBs\n" +
+        "H+dCTgalu8sRDoMh4ZIBBdgHfoZUycLqReQFLZZ4Sl4zSmzt5vQxQFhEKb9+ff/4\n" +
+        "rb1KAo6wifengxVfIsa2b5ljXzAqXs7JkPvmC6fa7X4ZZndRokaxYlu3cg8OV+uG\n" +
+        "/6YAHZilo8at0OpkkNdNFuhwuGlkBqrZKNUj/gSiYYc06gF/r/z6iWAjpXJRW1qq\n" +
+        "3CLZXdZFZ/VrqXeVjtOAu2A=\n";
 
-    final static String ENCODED_76_CHARS_PER_LINE
-            = "9IPNKwUvdLiIAp6ctz12SiQmOGstWyYvSPeevufDhrzaws65voykKjbIj33YWTa9xA7c/FHypWcl\n"
-            + "rZhQ7onfc3JE93BJ5fT4R9zAEdjbjy1hv4ZYNnET4WJeXMLJ/5p+qBpTsPpepW8DNVYy1c02/1wy\n"
-            + "C+kgA6CvRUd9cSr/lt88AEdsTV4GMCn1+EwuAiYdivxuzn+cLM8q2jewqlI52tP9J7Cs8vqG71s6\n"
-            + "+WAELKvm/UovvyaOi+OdMUfjQ0JLiLkHu6p9OwUgvQqiDKzEv/Augo0dTPZzYGEyCP5GVrle3QQd\n"
-            + "gciIHnpdd4VUTPGRUbXeKbh++U3fbJIng/sQXM3IYByMZ7xt9HWS1LUcRdQ7Prwn/IlQWxOMeq+K\n"
-            + "ZJSoAviWtdserXyHbIEa//hmr4p/j80k0g9q35hq1ayGM9984ALTSaZ8WeyFbZx1CxC/Qoqf92UH\n"
-            + "/ylBRnSJNn4sS0oa3uUbNvOnpkB4D9V7Ut9atinCJrw+wiJcMl+9kp251IUxBGA4cUxh0eaxk3OD\n"
-            + "WnwI95EktmWOKwCSP0xjWwIMxDjygwAG5R8fk9H9bVi1thMavm4nDc4vaNoSE1RnZNYwbiUVlVPM\n"
-            + "9EclvJWTWd6igWeA0MxHAA8iOM5Vnmqp/WGM7UDq59rBIdNQCoeTJaAkEtAuLL5zogOa5e+MzVjv\n"
-            + "B5MYQlOlaaTtQrRApXa5Z4VfEanu9UK2fi1T8jJPFC2PmXebxp0bnO+VW+bgyEdIIkIQCaZq1MKW\n"
-            + "C3KuiOS9BJ1t7O0A2JKJKvoE4UNulzV2TGCC+KAnmjRqQBqXlJmgjHQAoHNZKOma/uIQOsvfDnqi\n"
-            + "cYdDmfyCYuV89HjA1H8tiDJ85VfsrFHdcbPAoNCpi65awJSHfdPO1NDONOK++S7Y0VXUgoYYrBV4\n"
-            + "Y7YbC8wg/nqcimr3lm3tRyp+QsgKzdREbfNRk0F5PLyLfsUElepjs1QdV3fEV1LJtiywA3ubVNQJ\n"
-            + "RxhbYxa/C/Xy2qxpm6vvdL92l3q1ccev35IcaOiSx7Im+/GxV2lVKdaOvYVGDD1zBRe6Y2CwQb9p\n"
-            + "088l3/93qGR5593NCiuPPWcsDWwUShM1EyW0FNX1F8bnzHnYijoyE/jf4s/l9bBd7yJdRWRCyih2\n"
-            + "WcypAiOIEkBsH+dCTgalu8sRDoMh4ZIBBdgHfoZUycLqReQFLZZ4Sl4zSmzt5vQxQFhEKb9+ff/4\n"
-            + "rb1KAo6wifengxVfIsa2b5ljXzAqXs7JkPvmC6fa7X4ZZndRokaxYlu3cg8OV+uG/6YAHZilo8at\n"
-            + "0OpkkNdNFuhwuGlkBqrZKNUj/gSiYYc06gF/r/z6iWAjpXJRW1qq3CLZXdZFZ/VrqXeVjtOAu2A=\n";
+    final static String ENCODED_76_CHARS_PER_LINE =
+        "9IPNKwUvdLiIAp6ctz12SiQmOGstWyYvSPeevufDhrzaws65voykKjbIj33YWTa9xA7c/FHypWcl\n" +
+        "rZhQ7onfc3JE93BJ5fT4R9zAEdjbjy1hv4ZYNnET4WJeXMLJ/5p+qBpTsPpepW8DNVYy1c02/1wy\n" +
+        "C+kgA6CvRUd9cSr/lt88AEdsTV4GMCn1+EwuAiYdivxuzn+cLM8q2jewqlI52tP9J7Cs8vqG71s6\n" +
+        "+WAELKvm/UovvyaOi+OdMUfjQ0JLiLkHu6p9OwUgvQqiDKzEv/Augo0dTPZzYGEyCP5GVrle3QQd\n" +
+        "gciIHnpdd4VUTPGRUbXeKbh++U3fbJIng/sQXM3IYByMZ7xt9HWS1LUcRdQ7Prwn/IlQWxOMeq+K\n" +
+        "ZJSoAviWtdserXyHbIEa//hmr4p/j80k0g9q35hq1ayGM9984ALTSaZ8WeyFbZx1CxC/Qoqf92UH\n" +
+        "/ylBRnSJNn4sS0oa3uUbNvOnpkB4D9V7Ut9atinCJrw+wiJcMl+9kp251IUxBGA4cUxh0eaxk3OD\n" +
+        "WnwI95EktmWOKwCSP0xjWwIMxDjygwAG5R8fk9H9bVi1thMavm4nDc4vaNoSE1RnZNYwbiUVlVPM\n" +
+        "9EclvJWTWd6igWeA0MxHAA8iOM5Vnmqp/WGM7UDq59rBIdNQCoeTJaAkEtAuLL5zogOa5e+MzVjv\n" +
+        "B5MYQlOlaaTtQrRApXa5Z4VfEanu9UK2fi1T8jJPFC2PmXebxp0bnO+VW+bgyEdIIkIQCaZq1MKW\n" +
+        "C3KuiOS9BJ1t7O0A2JKJKvoE4UNulzV2TGCC+KAnmjRqQBqXlJmgjHQAoHNZKOma/uIQOsvfDnqi\n" +
+        "cYdDmfyCYuV89HjA1H8tiDJ85VfsrFHdcbPAoNCpi65awJSHfdPO1NDONOK++S7Y0VXUgoYYrBV4\n" +
+        "Y7YbC8wg/nqcimr3lm3tRyp+QsgKzdREbfNRk0F5PLyLfsUElepjs1QdV3fEV1LJtiywA3ubVNQJ\n" +
+        "RxhbYxa/C/Xy2qxpm6vvdL92l3q1ccev35IcaOiSx7Im+/GxV2lVKdaOvYVGDD1zBRe6Y2CwQb9p\n" +
+        "088l3/93qGR5593NCiuPPWcsDWwUShM1EyW0FNX1F8bnzHnYijoyE/jf4s/l9bBd7yJdRWRCyih2\n" +
+        "WcypAiOIEkBsH+dCTgalu8sRDoMh4ZIBBdgHfoZUycLqReQFLZZ4Sl4zSmzt5vQxQFhEKb9+ff/4\n" +
+        "rb1KAo6wifengxVfIsa2b5ljXzAqXs7JkPvmC6fa7X4ZZndRokaxYlu3cg8OV+uG/6YAHZilo8at\n" +
+        "0OpkkNdNFuhwuGlkBqrZKNUj/gSiYYc06gF/r/z6iWAjpXJRW1qq3CLZXdZFZ/VrqXeVjtOAu2A=\n";
 }
diff --git a/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java b/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java
index 3b0800b..2a02762 100644
--- a/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java
+++ b/src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java
@@ -6,14 +6,13 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 
 package org.apache.commons.codec.binary;
diff --git a/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java b/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java
index 0fb8374..aa9d11e 100644
--- a/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java
+++ b/src/test/java/org/apache/commons/codec/digest/HmacUtilsTest.java
@@ -1,12 +1,12 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -260,4 +260,4 @@ public class HmacUtilsTest {
     public void testSha512HMacFail() {
         HmacUtils.hmacSha512((byte[]) null, HmacAlgorithmsTest.STANDARD_PHRASE_BYTES);
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java b/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
index df78d86..192ed45 100644
--- a/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
+++ b/src/test/java/org/apache/commons/codec/digest/PureJavaCrc32Test.java
@@ -1,13 +1,12 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -76,8 +75,8 @@ public class PureJavaCrc32Test {
     }
 
     if (print) {
-      System.out.println("theirs:\t" + Long.toHexString(theirs.getValue())
-                         + "\nours:\t" + Long.toHexString(ours.getValue()));
+      System.out.println("theirs:\t" + Long.toHexString(theirs.getValue()) +
+                         "\nours:\t" + Long.toHexString(ours.getValue()));
     }
 
     theirs.reset();
@@ -86,8 +85,8 @@ public class PureJavaCrc32Test {
     ours.update(bytes, 0, bytes.length);
     theirs.update(bytes, 0, bytes.length);
     if (print) {
-      System.out.println("theirs:\t" + Long.toHexString(theirs.getValue())
-                         + "\nours:\t" + Long.toHexString(ours.getValue()));
+      System.out.println("theirs:\t" + Long.toHexString(theirs.getValue()) +
+                         "\nours:\t" + Long.toHexString(ours.getValue()));
     }
 
     checkSame();
@@ -293,8 +292,8 @@ public class PureJavaCrc32Test {
           if(c == zip) {
             expected = result;
           } else if (expected == null) {
-            throw new RuntimeException("The first class is "
-                + c.getName() + " but not " + zip.getName());
+            throw new RuntimeException("The first class is " +
+                c.getName() + " but not " + zip.getName());
           } else if (result.value != expected.value) {
             throw new RuntimeException(c + " has bugs!");
           }
diff --git a/src/test/java/org/apache/commons/codec/digest/XXHash32OverflowTest.java b/src/test/java/org/apache/commons/codec/digest/XXHash32OverflowTest.java
index d8be05a..889785e 100644
--- a/src/test/java/org/apache/commons/codec/digest/XXHash32OverflowTest.java
+++ b/src/test/java/org/apache/commons/codec/digest/XXHash32OverflowTest.java
@@ -1,20 +1,18 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.codec.digest;
 
diff --git a/src/test/java/org/apache/commons/codec/digest/XXHash32Test.java b/src/test/java/org/apache/commons/codec/digest/XXHash32Test.java
index 07babfd..e2f9b95 100644
--- a/src/test/java/org/apache/commons/codec/digest/XXHash32Test.java
+++ b/src/test/java/org/apache/commons/codec/digest/XXHash32Test.java
@@ -1,20 +1,18 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.commons.codec.digest;
 
diff --git a/src/test/java/org/apache/commons/codec/language/MatchRatingApproachEncoderTest.java b/src/test/java/org/apache/commons/codec/language/MatchRatingApproachEncoderTest.java
index 3a937f9..c955b18 100644
--- a/src/test/java/org/apache/commons/codec/language/MatchRatingApproachEncoderTest.java
+++ b/src/test/java/org/apache/commons/codec/language/MatchRatingApproachEncoderTest.java
@@ -6,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java b/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
index 306bbc3..ee6444a 100644
--- a/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
+++ b/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
@@ -137,9 +137,9 @@ public class BeiderMorseEncoderTest extends StringEncoderAbstractTest<StringEnco
 
     @Test
     public void testOOM() throws EncoderException {
-        final String phrase = "200697900'-->&#1913348150;</  bceaeef >aadaabcf\"aedfbff<!--\'-->?>cae"
-                + "cfaaa><?&#<!--</script>&lang&fc;aadeaf?>>&bdquo<    cc =\"abff\"    /></   afe  >"
-                + "<script><!-- f(';<    cf aefbeef = \"bfabadcf\" ebbfeedd = fccabeb >";
+        final String phrase = "200697900'-->&#1913348150;</  bceaeef >aadaabcf\"aedfbff<!--\'-->?>cae" +
+            "cfaaa><?&#<!--</script>&lang&fc;aadeaf?>>&bdquo<    cc =\"abff\"    /></   afe  >" +
+            "<script><!-- f(';<    cf aefbeef = \"bfabadcf\" ebbfeedd = fccabeb >";
 
         final BeiderMorseEncoder encoder = new BeiderMorseEncoder();
         encoder.setNameType(NameType.GENERIC);


[commons-codec] 02/04: Remove unused import

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git

commit e2eb50c655264735ad9ff2f2991b0346afe4a207
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Sep 4 12:15:13 2020 +0100

    Remove unused import
---
 src/test/java/org/apache/commons/codec/binary/Base64TestData.java | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/codec/binary/Base64TestData.java b/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
index d99f3c2..0dbdb55 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64TestData.java
@@ -17,8 +17,6 @@
 
 package org.apache.commons.codec.binary;
 
-import java.util.Random;
-
 /**
  * This random data was encoded by OpenSSL. Java had nothing to do with it. This data helps us test interop between
  * Commons-Codec and OpenSSL. Notice that OpenSSL creates 64 character lines instead of the 76 of Commons-Codec.


[commons-codec] 04/04: Add test sources to checkstyle:check

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git

commit ae667e0803fb96ae502bbc279ccd236dc1654631
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Sep 4 12:40:38 2020 +0100

    Add test sources to checkstyle:check
---
 checkstyle-suppressions.xml | 7 +++++++
 pom.xml                     | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
index 4796ea0..f0400ca 100644
--- a/checkstyle-suppressions.xml
+++ b/checkstyle-suppressions.xml
@@ -24,4 +24,11 @@ limitations under the License.
 <suppressions>
     <suppress checks="Header" files="LICENSE.txt"/>
     <suppress checks="Header" files="NOTICE.txt"/>
+    <!-- Be more lenient on tests. -->
+    <suppress checks="Javadoc" files=".*[/\\]test[/\\].*" />
+    <suppress checks="MultipleStringLiterals" files=".*[/\\]test[/\\].*" />
+    <suppress checks="DesignForExtension" files=".*[/\\]test[/\\].*" />
+    <suppress checks="LineLength" files=".*[/\\]test[/\\].*" />
+    <suppress checks="IllegalCatch" files=".*[/\\]test[/\\].*" />
+    <suppress checks="MethodLength" files="(MersenneTwister64|Well44497[ab]|MultiplyWithCarry256)Test" />
 </suppressions>
diff --git a/pom.xml b/pom.xml
index fcf0685..91b1276 100644
--- a/pom.xml
+++ b/pom.xml
@@ -332,6 +332,7 @@ limitations under the License.
           <configLocation>${basedir}/checkstyle.xml</configLocation>
           <enableRulesSummary>false</enableRulesSummary>
           <headerFile>${basedir}/LICENSE-header.txt</headerFile>
+          <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <resourceExcludes>NOTICE.txt,LICENSE.txt,**/pom.properties,**/sha512.properties</resourceExcludes>
         </configuration>
       </plugin>
@@ -367,6 +368,7 @@ limitations under the License.
           <configLocation>${basedir}/checkstyle.xml</configLocation>
           <enableRulesSummary>false</enableRulesSummary>
           <headerFile>${basedir}/LICENSE-header.txt</headerFile>
+          <includeTestSourceDirectory>true</includeTestSourceDirectory>
         </configuration>
         <!-- We need to specify reportSets because 2.9.1 creates two reports -->
         <reportSets>