ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject Re: svn commit: r357737 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
Date Tue, 20 Dec 2005 03:48:15 GMT
Hello Matt,

1) were your optimizations regarding StringBuffer in Locator#encodeURI()
really necessary ?  With the changes introduced  recently, this method
is rarely called
if you run ant with JDK >= 1.4. On top of that, we could change it to
shortcut it to URLEncoder.encode("UTF-8") under JDK 1.5.

2) the part of your commit where you encode the URI sounds wrong. The
method that you have changed is called fromURI.
What would happen if the input does contain some % characters ?

Cheers,

Antoine

mbenson@apache.org wrote:

>Author: mbenson
>Date: Mon Dec 19 09:52:05 2005
>New Revision: 357737
>
>URL: http://svn.apache.org/viewcvs?rev=357737&view=rev
>Log:
>add'l fixes RE using URI >= Java 1.4:  ensure the URI is encoded prior to
>passing to URI.create(); ensure no new object is created by encodeUri until
>encoding is determined to be necessary.
>
>Modified:
>    ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
>
>Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
>URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=357737&r1=357736&r2=357737&view=diff
>==============================================================================
>--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java (original)
>+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Mon Dec 19 09:52:05
2005
>@@ -156,6 +156,11 @@
>         // things when the path is not absolute, and fall back to the old parsing behavior.
>         if (uriClazz != null && uri.startsWith("file:/")) {
>             try {
>+                uri = encodeUri(uri);
>+            } catch (UnsupportedEncodingException e) {
>+                //leave as-is?
>+            }
>+            try {
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message