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:30 UTC
(commons-lang) 04/16: Add Checkstyle DefaultComesLast
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">