sabberworm commented on code in PR #1054:
URL: https://github.com/apache/tomcat/pull/1054#discussion_r3870943636


##########
java/org/apache/tomcat/util/http/FastHttpDateFormat.java:
##########
@@ -60,9 +61,19 @@ private FastHttpDateFormat() {
         FORMAT_RFC5322 = new ConcurrentDateFormat(DATE_RFC5322, Locale.US, tz);
         FORMAT_OBSOLETE_RFC850 = new 
ConcurrentDateFormat(DATE_OBSOLETE_RFC850, Locale.US, tz);
         FORMAT_OBSOLETE_ASCTIME = new 
ConcurrentDateFormat(DATE_OBSOLETE_ASCTIME, Locale.US, tz);
+        FORMAT_RFC9651 = dateString -> {
+            if(dateString == null || !dateString.startsWith("@")) {
+                throw new ParseException("Date " + dateString + " not in RFC 
9651 format", 0);
+            }

Review Comment:
   I don’t like the overhead of using exception handling for control flow here. 
Maybe use `-1` here too?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to