From 46ea7e5e963b09b63d6a54cddd7fe391d0d5b6f4 Mon Sep 17 00:00:00 2001 From: pascalschumacher Date: Sat, 13 Oct 2018 20:22:23 +0200 Subject: [PATCH] Update checkstyle to version 8.13 --- pom.xml | 9 +++++ .../commons/lang3/RandomStringUtilsTest.java | 33 ++++++++++++------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 6875f8bcd..affe7f7b1 100644 --- a/pom.xml +++ b/pom.xml @@ -618,6 +618,8 @@ utf-8 3.0.0 + 8.13 + 3.1.6 false @@ -734,6 +736,13 @@ true false + + + com.puppycrawl.tools + checkstyle + ${checkstyle.version} + + com.github.spotbugs diff --git a/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java b/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java index 6ab3cec7a..270ab6aca 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");