[
https://issues.apache.org/jira/browse/WICKET-6794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896296#comment-17896296
]
ASF GitHub Bot commented on WICKET-6794:
----------------------------------------
dougdonohoe commented on code in PR #436:
URL: https://github.com/apache/wicket/pull/436#discussion_r1832612700
##########
wicket-util/src/main/java/org/apache/wicket/util/encoding/UrlEncoder.java:
##########
@@ -16,58 +16,139 @@
*/
package org.apache.wicket.util.encoding;
-import java.io.CharArrayWriter;
+import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
-import java.util.BitSet;
import org.apache.wicket.util.lang.Args;
/**
- * Adapted from java.net.URLEncoder, but defines instances for query string
encoding versus URL path
+ * Adapted from Spring Framework's UriUtils class, but defines instances for
query string encoding versus URL path
* component encoding.
* <p/>
* The difference is important because a space is encoded as a + in a query
string, but this is a
* valid value in a path component (and is therefore not decode back to a
space).
- *
- * @author Doug Donohoe
- * @see java.net.URLEncoder
+ *
+ * @author Thomas Heigl
Review Comment:
I happened to be looking at Wicket source code again and noticed this
change. I'm the original author of the UrlDecode, originating back in 2008 in
https://issues.apache.org/jira/browse/WICKET-1627.
This @author change is not cool. It should at least be:
```
@author Doug Donohoe
@author Thomas Heigl
```
CC: @theigl
> Improve performance of UrlEncoder and UrlDecoder
> ------------------------------------------------
>
> Key: WICKET-6794
> URL: https://issues.apache.org/jira/browse/WICKET-6794
> Project: Wicket
> Issue Type: Improvement
> Components: wicket-core
> Affects Versions: 9.0.0-M5
> Reporter: Thomas Heigl
> Assignee: Thomas Heigl
> Priority: Minor
> Fix For: 9.0.0
>
>
> Wicket's {{UrlEncoder}} and {{UrlDecoder}} are customized versions of
> {{java.net.URLEncoder}} adapted to support conditional encoding of space for
> paths vs queries.
> The implementation of {{java.net.URLEncoder}} is far from optimal and
> frameworks such as Spring and Apache HttpClient use their own, much faster
> implementations.
> Since both of these classes showed up prominently in my production profiler,
> I would suggest to replace the current implementation with the quite elegant
> one in Spring's {{UriUtils}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)