theshoeshiner commented on code in PR #1062:
URL: https://github.com/apache/commons-lang/pull/1062#discussion_r1258159570


##########
src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java:
##########
@@ -48,6 +48,13 @@
  * Token values are printed using decimal digits.
  * A token character can be repeated to ensure that the field occupies a 
certain minimum
  * size. Values will be left-padded with 0 unless padding is disabled in the 
method invocation.
+ * <br>
+ * Tokens can be marked as optional by surrounding them with brackets [ ]. 
These tokens will 
+ * only be printed if the token value is non-zero. Any literals within 
optional blocks will only be 
+ * printed if the nearest prior non-literal token value was non-zero.

Review Comment:
   Also - not sure how you guys prefer to handle constructor collisions. But 
this change required a Token constructor method which collides with the 
Token(int,int) constructor that is used by unit tests. The addition of a 
boolean parameter to the new constructor resolves this. The boolean parameter 
function is clear and reasonable, but code could be refactored to remove it 
(were it not for the collision).



-- 
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]

Reply via email to