You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/02/09 21:50:26 UTC
(commons-lang) branch master updated (acafe0be6 -> 19c1b7bb1)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
from acafe0be6 Bump github/codeql-action from 3.28.8 to 3.28.9 (#1348)
new 6c7f783a7 Sort Checkstyle entries
new 364905651 Add Checkstyle rule for Javadoc author tags
new 419e8db16 Add Checkstyle CovariantEquals
new 411fe1352 Add Checkstyle DefaultComesLast
new 3970bf8ae Add Checkstyle EmptyBlock
new d21109a7d Add Checkstyle EqualsHashCode
new 61f9be3c3 Add Checkstyle ExplicitInitialization
new 2423f22aa Add Checkstyle FallThrough
new 10a1734b3 Add Checkstyle FinalLocalVariable
new 8899ebe03 Add Checkstyle IllegalInstantiation
new 44dd43eb5 Add Checkstyle MultipleVariableDeclarations
new b1158ce16 Add Checkstyle SimplifyBooleanExpression
new 618e56441 Add Checkstyle SimplifyBooleanReturn
new 007b80663 Add Checkstyle StringLiteralEquality
new 3ae3b126d Add Checkstyle SuperFinalize
new 19c1b7bb1 Add Checkstyle UnnecessaryParentheses
The 16 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:
.../java/org/apache/commons/lang3/StringUtils.java | 6 +--
.../org/apache/commons/lang3/math/Fraction.java | 3 +-
.../org/apache/commons/lang3/math/NumberUtils.java | 4 +-
.../commons/lang3/text/ExtendedMessageFormat.java | 4 +-
.../org/apache/commons/lang3/time/DateUtils.java | 6 +--
.../apache/commons/lang3/time/FastDateParser.java | 7 +--
.../apache/commons/lang3/time/FastDatePrinter.java | 3 ++
src/site/resources/checkstyle/checkstyle.xml | 59 +++++++++++++++-------
.../org/apache/commons/lang3/ArrayUtilsTest.java | 5 ++
.../commons/lang3/RandomStringUtilsTest.java | 9 ++--
.../java/org/apache/commons/lang3/StreamsTest.java | 2 +-
.../lang3/StringUtilsEqualsIndexOfTest.java | 4 +-
.../org/apache/commons/lang3/ThreadUtilsTest.java | 4 +-
.../lang3/builder/CompareToBuilderTest.java | 9 ++++
.../commons/lang3/builder/EqualsBuilderTest.java | 5 ++
.../commons/lang3/builder/HashCodeBuilderTest.java | 12 +++++
.../concurrent/MultiBackgroundInitializerTest.java | 5 ++
.../apache/commons/lang3/stream/StreamsTest.java | 2 +-
.../lang3/text/ExtendedMessageFormatTest.java | 2 +-
.../commons/lang3/time/DateUtilsRoundingTest.java | 55 +++++++++-----------
.../commons/lang3/util/FluentBitSetTest.java | 7 ++-
21 files changed, 132 insertions(+), 81 deletions(-)
(commons-lang) 16/16: Add Checkstyle UnnecessaryParentheses
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 19c1b7bb1e92e3da937ffd86ff7dd05d5c3075d4
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:49:46 2025 -0500
Add Checkstyle UnnecessaryParentheses
---
src/main/java/org/apache/commons/lang3/StringUtils.java | 6 +++---
src/site/resources/checkstyle/checkstyle.xml | 1 +
src/test/java/org/apache/commons/lang3/StreamsTest.java | 2 +-
src/test/java/org/apache/commons/lang3/stream/StreamsTest.java | 2 +-
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/StringUtils.java b/src/main/java/org/apache/commons/lang3/StringUtils.java
index abd8a68ce..2bf8d64bd 100644
--- a/src/main/java/org/apache/commons/lang3/StringUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringUtils.java
@@ -1041,7 +1041,7 @@ public static boolean containsAny(final CharSequence cs, final char... searchCha
final char ch = cs.charAt(i);
for (int j = 0; j < searchLength; j++) {
if (searchChars[j] == ch) {
- if (!Character.isHighSurrogate(ch) || (j == searchLast) || (i < csLast && searchChars[j + 1] == cs.charAt(i + 1))) {
+ if (!Character.isHighSurrogate(ch) || j == searchLast || i < csLast && searchChars[j + 1] == cs.charAt(i + 1)) {
return true;
}
}
@@ -1213,7 +1213,7 @@ public static boolean containsNone(final CharSequence cs, final char... searchCh
final char ch = cs.charAt(i);
for (int j = 0; j < searchLen; j++) {
if (searchChars[j] == ch) {
- if (!Character.isHighSurrogate(ch) || (j == searchLast) || (i < csLast && searchChars[j + 1] == cs.charAt(i + 1))) {
+ if (!Character.isHighSurrogate(ch) || j == searchLast || i < csLast && searchChars[j + 1] == cs.charAt(i + 1)) {
return false;
}
}
@@ -2704,7 +2704,7 @@ public static int indexOfAny(final CharSequence cs, final char... searchChars) {
for (int j = 0; j < searchLen; j++) {
if (searchChars[j] == ch) {
// ch is a supplementary character
- if (i >= csLast || j >= searchLast || !Character.isHighSurrogate(ch) || (searchChars[j + 1] == cs.charAt(i + 1))) {
+ if (i >= csLast || j >= searchLast || !Character.isHighSurrogate(ch) || searchChars[j + 1] == cs.charAt(i + 1)) {
return i;
}
}
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index b660558bc..d64a90397 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -80,6 +80,7 @@ limitations under the License.
<!-- <module name="SuperClone" /> -->
<module name="SuperFinalize" />
<module name="TypecastParenPad" />
+ <module name="UnnecessaryParentheses" />
<module name="UnusedImports"/>
<module name="UpperEll" />
<module name="WhitespaceAfter"/>
diff --git a/src/test/java/org/apache/commons/lang3/StreamsTest.java b/src/test/java/org/apache/commons/lang3/StreamsTest.java
index 0896fd9b8..f12163cb6 100644
--- a/src/test/java/org/apache/commons/lang3/StreamsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StreamsTest.java
@@ -141,7 +141,7 @@ public void testSimpleStreamFilter() {
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");
final List<Integer> output = Functions.stream(input)
.map(Integer::valueOf)
- .filter(i -> (i.intValue() % 2 == 0))
+ .filter(i -> i.intValue() % 2 == 0)
.collect(Collectors.toList());
assertEvenNumbers(output);
}
diff --git a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
index 4dd7b171d..5ee16b32b 100644
--- a/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
+++ b/src/test/java/org/apache/commons/lang3/stream/StreamsTest.java
@@ -212,7 +212,7 @@ public void testOfIteratorNull() {
@Test
public void testSimpleStreamFilter() {
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");
- final List<Integer> output = Failable.stream(input).map(Integer::valueOf).filter(i -> (i.intValue() % 2 == 0)).collect(Collectors.toList());
+ final List<Integer> output = Failable.stream(input).map(Integer::valueOf).filter(i -> i.intValue() % 2 == 0).collect(Collectors.toList());
assertEvenNumbers(output);
}
(commons-lang) 14/16: Add Checkstyle StringLiteralEquality
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 007b80663fe4795bde0b099453a9bf1bf319d595
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:42:00 2025 -0500
Add Checkstyle StringLiteralEquality
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 8739fa322..3db72a256 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -76,6 +76,7 @@ limitations under the License.
<module name="RightCurly"/>
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
+ <module name="StringLiteralEquality" />
<module name="TypecastParenPad" />
<module name="UnusedImports"/>
<module name="UpperEll" />
(commons-lang) 02/16: Add Checkstyle rule for Javadoc author tags
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 36490565124c498da3ff4b37e4128202c230a052
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 15:47:56 2025 -0500
Add Checkstyle rule for Javadoc author tags
---
src/site/resources/checkstyle/checkstyle.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 5394eba85..6732f234e 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -25,6 +25,12 @@ limitations under the License.
<property name="fileExtensions" value="java,xml"/>
</module>
<module name="JavadocPackage"/>
+ <module name="RegexpSingleline">
+ <property name="format" value="^\s+\*\s+@author\s" />
+ <property name="message" value="Deprecated @author tag" />
+ <property name="fileExtensions" value="java" />
+ <property name="severity" value="warning" />
+ </module>
<module name="RegexpSingleline">
<!-- \s matches whitespace character, $ matches end of line. -->
<property name="format" value="\s+$"/>
(commons-lang) 03/16: Add Checkstyle CovariantEquals
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 419e8db16b8038fe35f309a21dd0fed04780d52b
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 15:48:31 2025 -0500
Add Checkstyle CovariantEquals
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 6732f234e..e2800ab70 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -42,6 +42,7 @@ limitations under the License.
<module name="TreeWalker">
<module name="ArrayTypeStyle"/>
<module name="AvoidStarImport"/>
+ <module name="CovariantEquals" />
<module name="ExplicitInitializationCheck" />
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
(commons-lang) 09/16: Add Checkstyle FinalLocalVariable
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 10a1734b3c0904ee344418ad2f7a4246a3825c59
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:32:59 2025 -0500
Add Checkstyle FinalLocalVariable
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
.../java/org/apache/commons/lang3/RandomStringUtilsTest.java | 9 +++------
src/test/java/org/apache/commons/lang3/ThreadUtilsTest.java | 4 ++--
.../org/apache/commons/lang3/text/ExtendedMessageFormatTest.java | 2 +-
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index dffd64c8c..3dba720dc 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -51,6 +51,7 @@ limitations under the License.
<module name="EqualsHashCode" />
<module name="ExplicitInitialization" />
<module name="FallThrough" />
+ <module name="FinalLocalVariable" />
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
diff --git a/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java b/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java
index 4616c6605..8dad154a4 100644
--- a/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/RandomStringUtilsTest.java
@@ -788,20 +788,17 @@ public void testRandomPrintRange(final RandomStringUtils rsu) {
@MethodSource("randomProvider")
public void testRandomWithChars(final RandomStringUtils rsu) {
final char[] digitChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
-
- String r1, r2, r3;
-
- r1 = rsu.next(50, 0, 0, true, true, digitChars);
+ final String r1 = rsu.next(50, 0, 0, true, true, digitChars);
assertEquals(50, r1.length(), "randomNumeric(50)");
for (int i = 0; i < r1.length(); i++) {
assertTrue(
Character.isDigit(r1.charAt(i)) && !Character.isLetter(r1.charAt(i)),
"r1 contains numeric");
}
- r2 = rsu.nextNumeric(50);
+ final String r2 = rsu.nextNumeric(50);
assertNotEquals(r1, r2);
- r3 = rsu.next(50, 0, 0, true, true, digitChars);
+ final String r3 = rsu.next(50, 0, 0, true, true, digitChars);
assertNotEquals(r1, r3);
assertNotEquals(r2, r3);
}
diff --git a/src/test/java/org/apache/commons/lang3/ThreadUtilsTest.java b/src/test/java/org/apache/commons/lang3/ThreadUtilsTest.java
index 7c922480e..b81221f38 100644
--- a/src/test/java/org/apache/commons/lang3/ThreadUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/ThreadUtilsTest.java
@@ -155,10 +155,10 @@ public void testConstructor() {
@Test
public void testDepreacted() {
assertNotNull(ThreadUtils.ALWAYS_TRUE_PREDICATE);
- ThreadPredicate tp = ThreadUtils.ALWAYS_TRUE_PREDICATE;
+ final ThreadPredicate tp = ThreadUtils.ALWAYS_TRUE_PREDICATE;
assertTrue(tp.test(null));
assertTrue(tp.test(new Thread()));
- ThreadGroupPredicate tgp = ThreadUtils.ALWAYS_TRUE_PREDICATE;
+ final ThreadGroupPredicate tgp = ThreadUtils.ALWAYS_TRUE_PREDICATE;
assertTrue(tgp.test(null));
assertTrue(tgp.test(new ThreadGroup("")));
}
diff --git a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
index 06de86509..ce285d936 100644
--- a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
@@ -199,7 +199,7 @@ private void checkBuiltInFormat(final String pattern, final Map<String, ?> regis
buffer.append(locale);
buffer.append("]");
final MessageFormat mf = createMessageFormat(pattern, locale);
- ExtendedMessageFormat emf;
+ final ExtendedMessageFormat emf;
if (locale == null) {
emf = new ExtendedMessageFormat(pattern);
} else {
(commons-lang) 05/16: Add Checkstyle EmptyBlock
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 3970bf8ae93d88417ca8386303bb48aa299d5fa1
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 15:52:24 2025 -0500
Add Checkstyle EmptyBlock
---
src/site/resources/checkstyle/checkstyle.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index b4227d028..4fa3c3045 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -45,6 +45,9 @@ limitations under the License.
<module name="CovariantEquals" />
<module name="ExplicitInitializationCheck" />
<module name="DefaultComesLast" />
+ <module name="EmptyBlock">
+ <property name="option" value="text" />
+ </module>
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
(commons-lang) 06/16: Add Checkstyle EqualsHashCode
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit d21109a7d79c4a1d5b1b3f5b168127455f1eec5a
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:25:45 2025 -0500
Add Checkstyle EqualsHashCode
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java | 5 +++++
.../apache/commons/lang3/builder/CompareToBuilderTest.java | 9 +++++++++
.../org/apache/commons/lang3/builder/EqualsBuilderTest.java | 5 +++++
.../apache/commons/lang3/builder/HashCodeBuilderTest.java | 12 ++++++++++++
.../lang3/concurrent/MultiBackgroundInitializerTest.java | 5 +++++
6 files changed, 37 insertions(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 4fa3c3045..6bfd82fc5 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -48,6 +48,7 @@ limitations under the License.
<module name="EmptyBlock">
<property name="option" value="text" />
</module>
+ <module name="EqualsHashCode" />
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
diff --git a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java
index 24572b474..2e4edff85 100644
--- a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java
@@ -242,6 +242,11 @@ class LANG1261ParentObject {
public boolean equals(final Object o) {
return true;
}
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
}
final class LANG1261ChildObject extends LANG1261ParentObject {
diff --git a/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java
index eb698ce04..d187ee5c4 100644
--- a/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/CompareToBuilderTest.java
@@ -21,6 +21,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.math.BigInteger;
+import java.util.Objects;
import org.apache.commons.lang3.AbstractLangTest;
import org.junit.jupiter.api.Test;
@@ -67,13 +68,16 @@ public void setA(final int a) {
static class TestSubObject extends TestObject {
private int b;
+
TestSubObject() {
super(0);
}
+
TestSubObject(final int a, final int b) {
super(a);
this.b = b;
}
+
@Override
public boolean equals(final Object o) {
if (o == this) {
@@ -85,6 +89,11 @@ public boolean equals(final Object o) {
final TestSubObject rhs = (TestSubObject) o;
return super.equals(o) && b == rhs.b;
}
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getA(), b);
+ }
}
static class TestTransientSubObject extends TestObject {
diff --git a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java
index 983fac38b..041299b16 100644
--- a/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java
@@ -180,6 +180,11 @@ public boolean equals(final Object obj) {
return EqualsBuilder.reflectionEquals(this, obj);
}
+ @Override
+ public int hashCode() {
+ return one.hashCode();
+ }
+
public void setObjectReference(final TestObjectReference reference) {
this.reference = reference;
}
diff --git a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java
index a43d27995..528d42bd4 100644
--- a/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java
+++ b/src/test/java/org/apache/commons/lang3/builder/HashCodeBuilderTest.java
@@ -36,6 +36,12 @@ public class HashCodeBuilderTest extends AbstractLangTest {
static class ReflectionTestCycleA {
ReflectionTestCycleB b;
+ @Override
+ public boolean equals(final Object o) {
+ // Pairs with hashCode()
+ return super.equals(o);
+ }
+
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
@@ -48,6 +54,12 @@ public int hashCode() {
static class ReflectionTestCycleB {
ReflectionTestCycleA a;
+ @Override
+ public boolean equals(final Object o) {
+ // Pairs with hashCode()
+ return super.equals(o);
+ }
+
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java b/src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java
index e5b63a8d9..849fd01a3 100644
--- a/src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java
+++ b/src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java
@@ -121,6 +121,11 @@ public int getInitializeCalls() {
return initializeCalls;
}
+ @Override
+ public int hashCode() {
+ return initializeCalls;
+ }
+
public CloseableCounter increment() {
initializeCalls++;
return this;
(commons-lang) 12/16: Add Checkstyle SimplifyBooleanExpression
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit b1158ce16402d7f67f751548c210b1268e2743e6
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:41:16 2025 -0500
Add Checkstyle SimplifyBooleanExpression
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 361f54832..cd52ad4a8 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -74,6 +74,7 @@ limitations under the License.
<module name="RedundantImport"/>
<module name="RedundantModifier"/>
<module name="RightCurly"/>
+ <module name="SimplifyBooleanExpression" />
<module name="TypecastParenPad" />
<module name="UnusedImports"/>
<module name="UpperEll" />
(commons-lang) 11/16: Add Checkstyle MultipleVariableDeclarations
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 44dd43eb5c7a41350d0947080a9d16e65b7581d7
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:39:26 2025 -0500
Add Checkstyle MultipleVariableDeclarations
---
.../org/apache/commons/lang3/math/Fraction.java | 3 +-
src/site/resources/checkstyle/checkstyle.xml | 3 +-
.../lang3/StringUtilsEqualsIndexOfTest.java | 4 +-
.../commons/lang3/time/DateUtilsRoundingTest.java | 55 +++++++++-------------
.../commons/lang3/util/FluentBitSetTest.java | 7 ++-
5 files changed, 33 insertions(+), 39 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/math/Fraction.java b/src/main/java/org/apache/commons/lang3/math/Fraction.java
index 414069e9e..0f608b59e 100644
--- a/src/main/java/org/apache/commons/lang3/math/Fraction.java
+++ b/src/main/java/org/apache/commons/lang3/math/Fraction.java
@@ -141,7 +141,8 @@ public static Fraction getFraction(double value) {
double x2;
double y1 = value - a1;
double y2;
- double delta1, delta2 = Double.MAX_VALUE;
+ double delta1;
+ double delta2 = Double.MAX_VALUE;
double fraction;
int i = 1;
do {
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 068e467aa..361f54832 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -65,8 +65,9 @@ limitations under the License.
<property name="accessModifiers" value="public" />
</module>
<module name="LeftCurly"/>
- <module name="ModifierOrder"/>
<module name="MissingOverride"/>
+ <module name="ModifierOrder"/>
+ <module name="MultipleVariableDeclarations" />
<module name="NeedBraces"/>
<module name="NoWhitespaceBefore"/>
<module name="ParenPad"/>
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
index 583146af1..514deee94 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
@@ -195,7 +195,9 @@ public void testCustomCharSequence() {
@Test
public void testEquals() {
- final CharSequence fooCs = new StringBuilder(FOO), barCs = new StringBuilder(BAR), foobarCs = new StringBuilder(FOOBAR);
+ final CharSequence fooCs = new StringBuilder(FOO);
+ final CharSequence barCs = new StringBuilder(BAR);
+ final CharSequence foobarCs = new StringBuilder(FOOBAR);
assertTrue(StringUtils.equals(null, null));
assertTrue(StringUtils.equals(fooCs, fooCs));
assertTrue(StringUtils.equals(fooCs, new StringBuilder(FOO)));
diff --git a/src/test/java/org/apache/commons/lang3/time/DateUtilsRoundingTest.java b/src/test/java/org/apache/commons/lang3/time/DateUtilsRoundingTest.java
index 750e409ed..dd838ebd0 100644
--- a/src/test/java/org/apache/commons/lang3/time/DateUtilsRoundingTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/DateUtilsRoundingTest.java
@@ -46,8 +46,12 @@ public class DateUtilsRoundingTest extends AbstractLangTest {
Date januaryOneDate;
Date targetYearDate;
//No targetMonths, these must be tested for every type of month(28-31 days)
- Date targetDateDate, targetDayOfMonthDate, targetAmDate, targetPmDate;
- Date targetHourOfDayDate, targetHourDate;
+ Date targetDateDate;
+ Date targetDayOfMonthDate;
+ Date targetAmDate;
+ Date targetPmDate;
+ Date targetHourOfDayDate;
+ Date targetHourDate;
Date targetMinuteDate;
Date targetSecondDate;
Date targetMilliSecondDate;
@@ -229,14 +233,10 @@ public void setUp() throws Exception {
@Test
public void testRoundAmPm() throws Exception {
final int calendarField = Calendar.AM_PM;
- Date roundedUpDate, roundedDownDate, lastRoundedDownDate;
- final Date minDate;
- final Date maxDate;
-
// AM
- roundedUpDate = dateTimeParser.parse("June 1, 2008 12:00:00.000");
- roundedDownDate = targetAmDate;
- lastRoundedDownDate = dateTimeParser.parse("June 1, 2008 5:59:59.999");
+ Date roundedUpDate = dateTimeParser.parse("June 1, 2008 12:00:00.000");
+ Date roundedDownDate = targetAmDate;
+ Date lastRoundedDownDate = dateTimeParser.parse("June 1, 2008 5:59:59.999");
baseRoundTest(roundedUpDate, roundedDownDate, lastRoundedDownDate, calendarField);
// PM
@@ -246,8 +246,8 @@ public void testRoundAmPm() throws Exception {
baseRoundTest(roundedUpDate, roundedDownDate, lastRoundedDownDate, calendarField);
// round to January 1
- minDate = dateTimeParser.parse("December 31, 2007 18:00:00.000");
- maxDate = dateTimeParser.parse("January 1, 2008 5:59:59.999");
+ final Date minDate = dateTimeParser.parse("December 31, 2007 18:00:00.000");
+ final Date maxDate = dateTimeParser.parse("January 1, 2008 5:59:59.999");
roundToJanuaryFirst(minDate, maxDate, calendarField);
}
@@ -421,14 +421,11 @@ public void testRoundMinute() throws Exception {
@Test
public void testRoundMonth() throws Exception {
final int calendarField = Calendar.MONTH;
- Date roundedUpDate, roundedDownDate, lastRoundedDownDate;
- final Date minDate;
- final Date maxDate;
// month with 28 days
- roundedUpDate = dateTimeParser.parse("March 1, 2007 0:00:00.000");
- roundedDownDate = dateTimeParser.parse("February 1, 2007 0:00:00.000");
- lastRoundedDownDate = dateTimeParser.parse("February 14, 2007 23:59:59.999");
+ Date roundedUpDate = dateTimeParser.parse("March 1, 2007 0:00:00.000");
+ Date roundedDownDate = dateTimeParser.parse("February 1, 2007 0:00:00.000");
+ Date lastRoundedDownDate = dateTimeParser.parse("February 14, 2007 23:59:59.999");
baseRoundTest(roundedUpDate, roundedDownDate, lastRoundedDownDate, calendarField);
// month with 29 days
@@ -450,8 +447,8 @@ public void testRoundMonth() throws Exception {
baseRoundTest(roundedUpDate, roundedDownDate, lastRoundedDownDate, calendarField);
// round to January 1
- minDate = dateTimeParser.parse("December 17, 2007 00:00:00.000");
- maxDate = dateTimeParser.parse("January 16, 2008 23:59:59.999");
+ final Date minDate = dateTimeParser.parse("December 17, 2007 00:00:00.000");
+ final Date maxDate = dateTimeParser.parse("January 16, 2008 23:59:59.999");
roundToJanuaryFirst(minDate, maxDate, calendarField);
}
@@ -492,14 +489,10 @@ public void testRoundSecond() throws Exception {
@Test
public void testRoundSemiMonth() throws Exception {
final int calendarField = DateUtils.SEMI_MONTH;
- Date roundedUpDate, roundedDownDate, lastRoundedDownDate;
- final Date minDate;
- final Date maxDate;
-
// month with 28 days (1)
- roundedUpDate = dateTimeParser.parse("February 16, 2007 0:00:00.000");
- roundedDownDate = dateTimeParser.parse("February 1, 2007 0:00:00.000");
- lastRoundedDownDate = dateTimeParser.parse("February 8, 2007 23:59:59.999");
+ Date roundedUpDate = dateTimeParser.parse("February 16, 2007 0:00:00.000");
+ Date roundedDownDate = dateTimeParser.parse("February 1, 2007 0:00:00.000");
+ Date lastRoundedDownDate = dateTimeParser.parse("February 8, 2007 23:59:59.999");
baseRoundTest(roundedUpDate, roundedDownDate, lastRoundedDownDate, calendarField);
// month with 28 days (2)
@@ -545,8 +538,8 @@ public void testRoundSemiMonth() throws Exception {
baseRoundTest(roundedUpDate, roundedDownDate, lastRoundedDownDate, calendarField);
// round to January 1
- minDate = dateTimeParser.parse("December 24, 2007 00:00:00.000");
- maxDate = dateTimeParser.parse("January 8, 2008 23:59:59.999");
+ final Date minDate = dateTimeParser.parse("December 24, 2007 00:00:00.000");
+ final Date maxDate = dateTimeParser.parse("January 8, 2008 23:59:59.999");
roundToJanuaryFirst(minDate, maxDate, calendarField);
}
@@ -684,11 +677,9 @@ public void testTruncateSecond() throws Exception {
@Test
public void testTruncateSemiMonth() throws Exception {
final int calendarField = DateUtils.SEMI_MONTH;
- Date truncatedDate, lastTruncateDate;
-
// month with 28 days (1)
- truncatedDate = dateTimeParser.parse("February 1, 2007 0:00:00.000");
- lastTruncateDate = dateTimeParser.parse("February 15, 2007 23:59:59.999");
+ Date truncatedDate = dateTimeParser.parse("February 1, 2007 0:00:00.000");
+ Date lastTruncateDate = dateTimeParser.parse("February 15, 2007 23:59:59.999");
baseTruncateTest(truncatedDate, lastTruncateDate, calendarField);
// month with 28 days (2)
diff --git a/src/test/java/org/apache/commons/lang3/util/FluentBitSetTest.java b/src/test/java/org/apache/commons/lang3/util/FluentBitSetTest.java
index 6f3699023..ef1c10983 100644
--- a/src/test/java/org/apache/commons/lang3/util/FluentBitSetTest.java
+++ b/src/test/java/org/apache/commons/lang3/util/FluentBitSetTest.java
@@ -801,8 +801,7 @@ public void test_getII() {
bitset.get(3, 3);
// Test for method boolean java.util.BitSet.get(int, int)
- FluentBitSet bs, resultbs, correctbs;
- bs = newInstance(512);
+ FluentBitSet bs = newInstance(512);
bs.set(3, 9);
bs.set(10, 20);
bs.set(60, 75);
@@ -810,8 +809,8 @@ public void test_getII() {
bs.set(130, 140);
// pos1 and pos2 are in the same bitset element, at index0
- resultbs = bs.get(3, 6);
- correctbs = newInstance(3);
+ FluentBitSet resultbs = bs.get(3, 6);
+ FluentBitSet correctbs = newInstance(3);
correctbs.set(0, 3);
assertEquals(correctbs, resultbs, "Test1: Returned incorrect BitSet");
(commons-lang) 04/16: Add Checkstyle DefaultComesLast
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 411fe135211a2342cefa32c88c069f89060c11aa
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 15:51:51 2025 -0500
Add Checkstyle DefaultComesLast
---
src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 4 ++--
src/site/resources/checkstyle/checkstyle.xml | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
index ff0ad34dc..c420c6fe8 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
@@ -898,8 +898,6 @@ public String getPattern() {
*/
private Strategy getStrategy(final char f, final int width, final Calendar definingCalendar) {
switch (f) {
- default:
- throw new IllegalArgumentException("Format '" + f + "' not supported");
case 'D':
return DAY_OF_YEAR_STRATEGY;
case 'E':
@@ -947,6 +945,8 @@ private Strategy getStrategy(final char f, final int width, final Calendar defin
//$FALL-THROUGH$
case 'z':
return getLocaleSpecificStrategy(Calendar.ZONE_OFFSET, definingCalendar);
+ default:
+ throw new IllegalArgumentException("Format '" + f + "' not supported");
}
}
/*
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index e2800ab70..b4227d028 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -44,6 +44,7 @@ limitations under the License.
<module name="AvoidStarImport"/>
<module name="CovariantEquals" />
<module name="ExplicitInitializationCheck" />
+ <module name="DefaultComesLast" />
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
(commons-lang) 10/16: Add Checkstyle IllegalInstantiation
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 8899ebe032e1888ca8933ed7b9e46361a1c12816
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:34:04 2025 -0500
Add Checkstyle IllegalInstantiation
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 3dba720dc..068e467aa 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -54,6 +54,7 @@ limitations under the License.
<module name="FinalLocalVariable" />
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
+ <module name="IllegalInstantiation" />
<module name="ImportOrder">
<property name="option" value="top"/>
<property name="groups" value="java,javax,org"/>
(commons-lang) 13/16: Add Checkstyle SimplifyBooleanReturn
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 618e56441372a3421d994ff0df89744f11061c55
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:41:37 2025 -0500
Add Checkstyle SimplifyBooleanReturn
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index cd52ad4a8..8739fa322 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -75,6 +75,7 @@ limitations under the License.
<module name="RedundantModifier"/>
<module name="RightCurly"/>
<module name="SimplifyBooleanExpression" />
+ <module name="SimplifyBooleanReturn" />
<module name="TypecastParenPad" />
<module name="UnusedImports"/>
<module name="UpperEll" />
(commons-lang) 08/16: Add Checkstyle FallThrough
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 2423f22aad022445dd8e7868f7076b3bc90c2c3e
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:30:52 2025 -0500
Add Checkstyle FallThrough
---
src/main/java/org/apache/commons/lang3/math/NumberUtils.java | 4 ++--
.../java/org/apache/commons/lang3/text/ExtendedMessageFormat.java | 4 ++--
src/main/java/org/apache/commons/lang3/time/DateUtils.java | 6 +++---
src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 3 ++-
src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java | 3 +++
src/site/resources/checkstyle/checkstyle.xml | 1 +
6 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
index fd667c542..3f12e3564 100644
--- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
+++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
@@ -423,7 +423,7 @@ public static Number createNumber(final String str) {
} catch (final NumberFormatException ignored) {
// ignore the bad number
}
- //$FALL-THROUGH$
+ // falls-through
case 'd' :
case 'D' :
try {
@@ -439,7 +439,7 @@ public static Number createNumber(final String str) {
} catch (final NumberFormatException ignored) {
// ignore the bad number
}
- //$FALL-THROUGH$
+ // falls-through
default :
throw new NumberFormatException(str + " is not a valid number.");
diff --git a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
index c21bfb8f2..92332e8ff 100644
--- a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
+++ b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
@@ -220,7 +220,7 @@ public final void applyPattern(final String pattern) {
throw new IllegalArgumentException(
"Unreadable format element at position " + start);
}
- //$FALL-THROUGH$
+ // falls-through
default:
stripCustom.append(c[pos.getIndex()]);
next(pos);
@@ -361,7 +361,7 @@ private String insertFormats(final String pattern, final ArrayList<String> custo
break;
case END_FE:
depth--;
- //$FALL-THROUGH$
+ // falls-through
default:
sb.append(c);
next(pos);
diff --git a/src/main/java/org/apache/commons/lang3/time/DateUtils.java b/src/main/java/org/apache/commons/lang3/time/DateUtils.java
index 7db53628c..7ba125706 100644
--- a/src/main/java/org/apache/commons/lang3/time/DateUtils.java
+++ b/src/main/java/org/apache/commons/lang3/time/DateUtils.java
@@ -431,13 +431,13 @@ private static long getFragment(final Calendar calendar, final int fragment, fin
case Calendar.DAY_OF_YEAR:
case Calendar.DATE:
result += unit.convert(calendar.get(Calendar.HOUR_OF_DAY), TimeUnit.HOURS);
- //$FALL-THROUGH$
+ // falls-through
case Calendar.HOUR_OF_DAY:
result += unit.convert(calendar.get(Calendar.MINUTE), TimeUnit.MINUTES);
- //$FALL-THROUGH$
+ // falls-through
case Calendar.MINUTE:
result += unit.convert(calendar.get(Calendar.SECOND), TimeUnit.SECONDS);
- //$FALL-THROUGH$
+ // falls-through
case Calendar.SECOND:
result += unit.convert(calendar.get(Calendar.MILLISECOND), TimeUnit.MILLISECONDS);
break;
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
index c420c6fe8..c9f4d6c99 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
@@ -753,6 +753,7 @@ private static StringBuilder simpleQuote(final StringBuilder sb, final String va
case '[':
case '{':
sb.append('\\');
+ // falls-through
default:
sb.append(c);
}
@@ -942,7 +943,7 @@ private Strategy getStrategy(final char f, final int width, final Calendar defin
if (width == 2) {
return ISO8601TimeZoneStrategy.ISO_8601_3_STRATEGY;
}
- //$FALL-THROUGH$
+ // falls-through
case 'z':
return getLocaleSpecificStrategy(Calendar.ZONE_OFFSET, definingCalendar);
default:
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
index 1132e5d79..134b5e47c 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
@@ -947,6 +947,7 @@ private static void appendFullDigits(final Appendable buffer, int value, int min
case 4:
buffer.append((char) (value / 1000 + '0'));
value %= 1000;
+ // falls-through
case 3:
if (value >= 100) {
buffer.append((char) (value / 100 + '0'));
@@ -954,6 +955,7 @@ private static void appendFullDigits(final Appendable buffer, int value, int min
} else {
buffer.append('0');
}
+ // falls-through
case 2:
if (value >= 10) {
buffer.append((char) (value / 10 + '0'));
@@ -961,6 +963,7 @@ private static void appendFullDigits(final Appendable buffer, int value, int min
} else {
buffer.append('0');
}
+ // falls-through
case 1:
buffer.append((char) (value + '0'));
}
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index c5a5aab67..dffd64c8c 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -50,6 +50,7 @@ limitations under the License.
</module>
<module name="EqualsHashCode" />
<module name="ExplicitInitialization" />
+ <module name="FallThrough" />
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
<module name="ImportOrder">
(commons-lang) 01/16: Sort Checkstyle entries
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 6c7f783a7595158611316d879cadc4e2878652b6
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 15:46:44 2025 -0500
Sort Checkstyle entries
Remove duplicate modules
---
src/site/resources/checkstyle/checkstyle.xml | 38 +++++++++++++---------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 165b2f74b..5394eba85 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -21,10 +21,10 @@ limitations under the License.
<!-- Apache Commons Lang customization of default Checkstyle behavior -->
<module name="Checker">
<property name="localeLanguage" value="en"/>
- <module name="JavadocPackage"/>
<module name="FileTabCharacter">
<property name="fileExtensions" value="java,xml"/>
</module>
+ <module name="JavadocPackage"/>
<module name="RegexpSingleline">
<!-- \s matches whitespace character, $ matches end of line. -->
<property name="format" value="\s+$"/>
@@ -34,35 +34,33 @@ limitations under the License.
<property name="file" value="src/site/resources/checkstyle/checkstyle-suppressions.xml"/>
</module>
<module name="TreeWalker">
- <module name="ExplicitInitializationCheck" />
+ <module name="ArrayTypeStyle"/>
<module name="AvoidStarImport"/>
- <module name="IllegalImport"/>
- <module name="RedundantImport"/>
- <module name="UnusedImports"/>
- <module name="NeedBraces"/>
- <module name="JavadocMethod">
- <property name="accessModifiers" value="public" />
- </module>
- <module name="ModifierOrder"/>
- <module name="RedundantModifier"/>
- <module name="UpperEll" />
- <module name="LeftCurly"/>
- <module name="NeedBraces"/>
- <module name="ParenPad"/>
- <module name="RightCurly"/>
+ <module name="ExplicitInitializationCheck" />
<module name="GenericWhitespace"/>
- <module name="WhitespaceAfter"/>
- <module name="WhitespaceAround"/>
- <module name="NoWhitespaceBefore"/>
+ <module name="IllegalImport"/>
<module name="ImportOrder">
<property name="option" value="top"/>
<property name="groups" value="java,javax,org"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>
+ <module name="JavadocMethod">
+ <property name="accessModifiers" value="public" />
+ </module>
+ <module name="LeftCurly"/>
+ <module name="ModifierOrder"/>
<module name="MissingOverride"/>
- <module name="ArrayTypeStyle"/>
+ <module name="NeedBraces"/>
+ <module name="NoWhitespaceBefore"/>
<module name="ParenPad"/>
+ <module name="RedundantImport"/>
+ <module name="RedundantModifier"/>
+ <module name="RightCurly"/>
<module name="TypecastParenPad" />
+ <module name="UnusedImports"/>
+ <module name="UpperEll" />
+ <module name="WhitespaceAfter"/>
+ <module name="WhitespaceAround"/>
</module>
</module>
(commons-lang) 15/16: Add Checkstyle SuperFinalize
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 3ae3b126d8e57096e1a9b1bb61d43845590fb495
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:44:09 2025 -0500
Add Checkstyle SuperFinalize
---
src/site/resources/checkstyle/checkstyle.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 3db72a256..b660558bc 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -77,6 +77,8 @@ limitations under the License.
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
+ <!-- <module name="SuperClone" /> -->
+ <module name="SuperFinalize" />
<module name="TypecastParenPad" />
<module name="UnusedImports"/>
<module name="UpperEll" />
(commons-lang) 07/16: Add Checkstyle ExplicitInitialization
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 61f9be3c3d36cfee86acd2a32640384c0f70fdc0
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 9 16:26:18 2025 -0500
Add Checkstyle ExplicitInitialization
---
src/site/resources/checkstyle/checkstyle.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/site/resources/checkstyle/checkstyle.xml b/src/site/resources/checkstyle/checkstyle.xml
index 6bfd82fc5..c5a5aab67 100644
--- a/src/site/resources/checkstyle/checkstyle.xml
+++ b/src/site/resources/checkstyle/checkstyle.xml
@@ -49,6 +49,7 @@ limitations under the License.
<property name="option" value="text" />
</module>
<module name="EqualsHashCode" />
+ <module name="ExplicitInitialization" />
<module name="GenericWhitespace"/>
<module name="IllegalImport"/>
<module name="ImportOrder">