lbownik commented on code in PR #5530:
URL: https://github.com/apache/netbeans/pull/5530#discussion_r1117956163


##########
ide/httpserver/src/org/netbeans/modules/httpserver/HttpServerURLMapper.java:
##########
@@ -82,7 +90,12 @@ private URL decodeURL(String path) {
                 newPath.append(tok);
             } else {
                 try {
-                    newPath.append(URLDecoder.decode(tok, "UTF-8")); // NOI18N
+                    String decodedToken = URLDecoder.decode(tok, "UTF-8"); // 
NOI18N
+                    if(decodedToken.startsWith("/") && 
decodedToken.endsWith("/")) { // NOI18N
+                        newPath.append(decodedToken.substring(1, 
decodedToken.length() - 1));

Review Comment:
   who about
   newPath.append(decodedToken, 1, decodedTocken.length() b -1) ;
   
   it avoids sub-string allocation and a loop
   turning newPath into StringBuilder  in line 86 would also improve 
performance a bit.



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