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-collections.git
The following commit(s) were added to refs/heads/master by this push:
new 6b7e51a6e Add and fix Checkstyle NoWhitespaceBeforeCaseDefaultColon
6b7e51a6e is described below
commit 6b7e51a6e48e4dfb08890539d247361a459c0f70
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Oct 3 17:29:55 2024 -0400
Add and fix Checkstyle NoWhitespaceBeforeCaseDefaultColon
---
src/conf/checkstyle.xml | 1 +
.../java/org/apache/commons/collections4/list/TreeList.java | 12 ++++++------
.../commons/collections4/set/AbstractNavigableSetTest.java | 9 +++++----
.../commons/collections4/set/AbstractSortedSetTest.java | 8 ++++----
4 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml
index ed165f598..5b8d29dbf 100644
--- a/src/conf/checkstyle.xml
+++ b/src/conf/checkstyle.xml
@@ -61,6 +61,7 @@ limitations under the License.
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<module name="NoWhitespaceBefore"/>
+ <module name="NoWhitespaceBeforeCaseDefaultColon"/>
<module name="ImportOrder">
<property name="option" value="top"/>
<property name="groups" value="java,javax,junit,org,com"/>
diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java
b/src/main/java/org/apache/commons/collections4/list/TreeList.java
index 82abbe640..07d194ade 100644
--- a/src/main/java/org/apache/commons/collections4/list/TreeList.java
+++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java
@@ -277,21 +277,21 @@ public class TreeList<E> extends AbstractList<E> {
*/
private AVLNode<E> balance() {
switch (heightRightMinusLeft()) {
- case 1 :
- case 0 :
- case -1 :
+ case 1:
+ case 0:
+ case -1:
return this;
- case -2 :
+ case -2:
if (left.heightRightMinusLeft() > 0) {
setLeft(left.rotateLeft(), null);
}
return rotateRight();
- case 2 :
+ case 2:
if (right.heightRightMinusLeft() < 0) {
setRight(right.rotateRight(), null);
}
return rotateLeft();
- default :
+ default:
throw new IllegalStateException("tree inconsistent!");
}
}
diff --git
a/src/test/java/org/apache/commons/collections4/set/AbstractNavigableSetTest.java
b/src/test/java/org/apache/commons/collections4/set/AbstractNavigableSetTest.java
index 86ae38d94..18ae01c2d 100644
---
a/src/test/java/org/apache/commons/collections4/set/AbstractNavigableSetTest.java
+++
b/src/test/java/org/apache/commons/collections4/set/AbstractNavigableSetTest.java
@@ -131,16 +131,17 @@ public abstract class AbstractNavigableSetTest<E> extends
AbstractSortedSetTest<
public E[] getOtherElements() {
return otherElements;
}
+
private NavigableSet<E> getSubSet(final NavigableSet<E> set) {
final E[] elements =
AbstractNavigableSetTest.this.getFullElements();
switch (type) {
- case TYPE_SUBSET :
+ case TYPE_SUBSET:
return set.subSet(elements[lowBound], inclusive,
elements[highBound], inclusive);
- case TYPE_HEADSET :
+ case TYPE_HEADSET:
return set.headSet(elements[highBound], inclusive);
- case TYPE_TAILSET :
+ case TYPE_TAILSET:
return set.tailSet(elements[lowBound], inclusive);
- default :
+ default:
return null;
}
}
diff --git
a/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java
b/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java
index 095bc6a7d..495cf31c5 100644
---
a/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java
+++
b/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java
@@ -127,13 +127,13 @@ public abstract class AbstractSortedSetTest<E> extends
AbstractSetTest<E> {
private SortedSet<E> getSubSet(final SortedSet<E> set) {
final E[] elements = AbstractSortedSetTest.this.getFullElements();
switch (type) {
- case TYPE_SUBSET :
+ case TYPE_SUBSET:
return set.subSet(elements[lowBound], elements[highBound]);
- case TYPE_HEADSET :
+ case TYPE_HEADSET:
return set.headSet(elements[highBound]);
- case TYPE_TAILSET :
+ case TYPE_TAILSET:
return set.tailSet(elements[lowBound]);
- default :
+ default:
return null;
}
}