From 341b578b4fc2a85e107e7b2166cac8447cabbabf Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 3 Oct 2022 09:46:58 -0400 Subject: [PATCH] Reuse constant Format tweak --- .../java/org/apache/commons/lang3/time/FastDatePrinter.java | 2 +- .../lang3/concurrent/EventCountCircuitBreakerTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 156afd8c7..6ed587dae 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java @@ -166,7 +166,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { rules = rulesList.toArray(EMPTY_RULE_ARRAY); int len = 0; - for (int i=rules.length; --i >= 0; ) { + for (int i = rules.length; --i >= 0;) { len += rules[i].estimateLength(); } diff --git a/src/test/java/org/apache/commons/lang3/concurrent/EventCountCircuitBreakerTest.java b/src/test/java/org/apache/commons/lang3/concurrent/EventCountCircuitBreakerTest.java index b831b3178..ef9bf2561 100644 --- a/src/test/java/org/apache/commons/lang3/concurrent/EventCountCircuitBreakerTest.java +++ b/src/test/java/org/apache/commons/lang3/concurrent/EventCountCircuitBreakerTest.java @@ -30,6 +30,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.apache.commons.lang3.AbstractLangTest; +import org.apache.commons.lang3.ArrayUtils; import org.junit.jupiter.api.Test; /** @@ -407,8 +408,7 @@ public class EventCountCircuitBreakerTest extends AbstractLangTest { * @param values the expected values */ public void verify(final Boolean... values) { - assertArrayEquals(values, - changedValues.toArray(new Boolean[0])); + assertArrayEquals(values, changedValues.toArray(ArrayUtils.EMPTY_BOOLEAN_OBJECT_ARRAY)); } } }