garydgregory commented on a change in pull request #440: Fix static code issues
URL: https://github.com/apache/commons-lang/pull/440#discussion_r315399082
##########
File path: src/main/java/org/apache/commons/lang3/StringUtils.java
##########
@@ -6378,8 +6378,8 @@ private static String replace(final String text, String
searchString, final Stri
}
final int replLength = searchString.length();
int increase = replacement.length() - replLength;
- increase = increase < 0 ? 0 : increase;
- increase *= max < 0 ? 16 : max > 64 ? 64 : max;
+ increase = Math.max(increase, 0);
+ increase *= Math.min(max, 0);
Review comment:
How can this be correct when the bounds above are 16 and 64?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services