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 2023/08/10 18:10:48 UTC

[commons-lang] branch master updated: Add invariant check in StrategyAndWidth constructor

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


The following commit(s) were added to refs/heads/master by this push:
     new 861d19150 Add invariant check in StrategyAndWidth constructor
861d19150 is described below

commit 861d191505180f1c7b9b7f1239b08cf06a251909
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Aug 10 14:10:43 2023 -0400

    Add invariant check in StrategyAndWidth constructor
---
 src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 56907f01f..6851a4dc4 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
@@ -194,7 +194,7 @@ public class FastDateParser implements DateParser, Serializable {
         final int width;
 
         StrategyAndWidth(final Strategy strategy, final int width) {
-            this.strategy = strategy;
+            this.strategy = Objects.requireNonNull(strategy, "strategy");
             this.width = width;
         }