You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/07/01 14:06:34 UTC
[I] StringUtils leftPad/rightPad throw ArithmeticException with empty delimiter [maven-shared-utils]
elharo opened a new issue, #408:
URL: https://github.com/apache/maven-shared-utils/issues/408
`StringUtils.leftPad` and `rightPad` with a `size` parameter and empty `delim` string cause `ArithmeticException` (division by zero) at lines 1116 and 1150.
Even with the documented `@throws ArithmeticException if delim is the empty String`, this is poor API behavior. An empty delimiter should simply result in no padding rather than crashing.
Fix: return `str` unchanged when `delim.isEmpty()`.
--
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: issues-unsubscribe@maven.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] StringUtils leftPad/rightPad throw ArithmeticException with empty delimiter [maven-shared-utils]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo closed issue #408: StringUtils leftPad/rightPad throw ArithmeticException with empty delimiter
URL: https://github.com/apache/maven-shared-utils/issues/408
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org