garydgregory commented on code in PR #383:
URL: https://github.com/apache/commons-validator/pull/383#discussion_r3379975440
##########
src/main/java/org/apache/commons/validator/routines/UrlValidator.java:
##########
@@ -476,6 +479,14 @@ protected boolean isValidFragment(final String fragment) {
return isOff(NO_FRAGMENTS);
}
+ private String decodePath(final String path) {
+ try {
+ return URLDecoder.decode(path, StandardCharsets.UTF_8.name());
+ } catch (final UnsupportedEncodingException e) {
+ throw new RuntimeException(e); // UTF-8 is always supported
Review Comment:
Throwing RE is an anti-pattern, IAE is better here IMO. There's also
UncheckedIOException if the IO aspect is more important.
--
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]