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/10/13 18:22:32 UTC

[lang] Update checkstyle to version 8.13

Repository: commons-lang
Updated Branches:
  refs/heads/master e99b0dde8 -> 46ea7e5e9


Update checkstyle to version 8.13


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

Branch: refs/heads/master
Commit: 46ea7e5e963b09b63d6a54cddd7fe391d0d5b6f4
Parents: e99b0dd
Author: pascalschumacher <pa...@gmx.net>
Authored: Sat Oct 13 20:22:23 2018 +0200
Committer: pascalschumacher <pa...@gmx.net>
Committed: Sat Oct 13 20:22:23 2018 +0200

----------------------------------------------------------------------
 pom.xml                                         |  9 ++++++
 .../commons/lang3/RandomStringUtilsTest.java    | 33 +++++++++++++-------
 2 files changed, 31 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/46ea7e5e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6875f8b..affe7f7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -618,6 +618,8 @@
     <commons.encoding>utf-8</commons.encoding>
 
     <checkstyle.plugin.version>3.0.0</checkstyle.plugin.version>
+    <checkstyle.version>8.13</checkstyle.version>
+
     <spotbugs.plugin.version>3.1.6</spotbugs.plugin.version>
     <japicmp.skip>false</japicmp.skip>
 
@@ -734,6 +736,13 @@
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <enableRulesSummary>false</enableRulesSummary>
         </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>${checkstyle.version}</version>
+          </dependency>
+        </dependencies>
       </plugin>
       <plugin>
         <groupId>com.github.spotbugs</groupId>

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/46ea7e5e/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java b/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java
index 6ab3cec..270ab6a 100644
--- a/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java
@@ -474,18 +474,29 @@ public class RandomStringUtilsTest {
         final String set = "abc";
         final char[] chars = set.toCharArray();
         String gen = "";
-        final int[] counts = {0,0,0};
-        final int[] expected = {200,200,200};
+        final int[] counts = {0, 0, 0};
+        final int[] expected = {200, 200, 200};
         for (int i = 0; i< 100; i++) {
-           gen = RandomStringUtils.random(6,chars);
-           for (int j = 0; j < 6; j++) {
-               switch (gen.charAt(j)) {
-                   case 'a': {counts[0]++; break;}
-                   case 'b': {counts[1]++; break;}
-                   case 'c': {counts[2]++; break;}
-                   default: {fail("generated character not in set");}
-               }
-           }
+            gen = RandomStringUtils.random(6,chars);
+            for (int j = 0; j < 6; j++) {
+                switch (gen.charAt(j)) {
+                    case 'a': {
+                        counts[0]++;
+                        break;
+                    }
+                    case 'b': {
+                        counts[1]++;
+                        break;
+                    }
+                    case 'c': {
+                        counts[2]++;
+                        break;
+                    }
+                    default: {
+                        fail("generated character not in set");
+                    }
+                }
+            }
         }
         // Perform chi-square test with df = 3-1 = 2, testing at .001 level
         assertTrue(chiSquare(expected,counts) < 13.82, "test homogeneity -- will fail about 1 in 1000 times");