You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/12/29 20:54:24 UTC

[GitHub] [netbeans] mbien commented on a diff in pull request #5160: tomcat5: Enable usage of javac release and remove internal class use (fix JDK8 and JDK17+)

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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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