mbien commented on code in PR #5160:
URL: https://github.com/apache/netbeans/pull/5160#discussion_r1059139606


##########
enterprise/tomcat5/src/org/netbeans/modules/tomcat5/deploy/TomcatManagerImpl.java:
##########
@@ -333,7 +333,7 @@ private static String encodePath(String str) {
             }
             StringBuilder result = new StringBuilder();
             while (st.hasMoreTokens()) {
-                result.append("/").append(URLEncoder.encode(st.nextToken(), 
StandardCharsets.UTF_8)); // NOI18N
+                result.append("/").append(URLEncoder.encode(st.nextToken(), 
"UTF-8")); // NOI18N

Review Comment:
   I am sometimes using `StandardCharsets.UTF_8.name()` to make it explicit 
that the exception can't occur. But this is ok too of course since everyone 
knows that UTF is standard.
   
   Maybe instead of catching `Exception` and rethrowing it as RT ex, it would 
be better to catch `UnsupportedEncodingException` a few lines down?



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

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to