ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1376167 - in /ant/core/trunk/src/main/org/apache/tools/ant: launch/Locator.java util/FileUtils.java
Date Wed, 22 Aug 2012 18:10:38 GMT
Author: hibou
Date: Wed Aug 22 18:10:37 2012
New Revision: 1376167

URL: http://svn.apache.org/viewvc?rev=1376167&view=rev
Log:
getAbsoluteFile is useless since as the javadoc of File.toURI clearly explain, produced URIs
are absolute

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=1376167&r1=1376166&r2=1376167&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 Wed Aug 22 18:10:37 2012
@@ -405,7 +405,7 @@ public final class Locator {
     @Deprecated
     public static URL fileToURL(File file)
         throws MalformedURLException {
-        return new URL(file.getAbsoluteFile().toURI().toASCIIString());
+        return new URL(file.toURI().toASCIIString());
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?rev=1376167&r1=1376166&r2=1376167&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Wed Aug 22 18:10:37 2012
@@ -138,7 +138,7 @@ public class FileUtils {
      *      formed.
      */
     public URL getFileURL(File file) throws MalformedURLException {
-        return new URL(toURI(file.getAbsolutePath()));
+        return new URL(file.toURI().toASCIIString());
     }
 
     /**
@@ -1209,7 +1209,7 @@ public class FileUtils {
      * @since Ant 1.6
      */
     public String toURI(String path) {
-        return new File(path).getAbsoluteFile().toURI().toASCIIString();
+        return new File(path).toURI().toASCIIString();
     }
 
     /**



Mime
View raw message