ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1376031 - in /ant/core/trunk/src/main/org/apache/tools/ant/launch: Launcher.java Locator.java
Date Wed, 22 Aug 2012 13:21:33 GMT
Author: hibou
Date: Wed Aug 22 13:21:33 2012
New Revision: 1376031

URL: http://svn.apache.org/viewvc?rev=1376031&view=rev
Log:
Don't mess with classloading of the launcher

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java?rev=1376031&r1=1376030&r2=1376031&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java Wed Aug 22 13:21:33
2012
@@ -25,7 +25,6 @@ import java.util.StringTokenizer;
 import java.util.List;
 import java.util.ArrayList;
 
-import org.apache.tools.ant.util.FileUtils;
 
 
 
@@ -152,7 +151,7 @@ public class Launcher {
                 }
             }
 
-            URL url = FileUtils.getFileUtils().getFileURL(element);
+            URL url = Locator.fileToURL(element);
             if (launchDiag) { System.out.println("adding library URL: " + url) ;}
             libPathURLs.add(url);
         }
@@ -383,7 +382,7 @@ public class Launcher {
             systemJars.length);
 
         if (toolsJar != null) {
-            jars[jars.length - 1] = FileUtils.getFileUtils().getFileURL(toolsJar);
+            jars[jars.length - 1] = Locator.fileToURL(toolsJar);
         }
         return jars;
     }

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=1376031&r1=1376030&r2=1376031&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 13:21:33 2012
@@ -405,7 +405,7 @@ public final class Locator {
     @Deprecated
     public static URL fileToURL(File file)
         throws MalformedURLException {
-        return FileUtils.getFileUtils().getFileURL(file);
+        return new URL(file.getAbsoluteFile().toURI().toASCIIString());
     }
 
     /**
@@ -503,7 +503,7 @@ public final class Locator {
             String littlePath = path.toLowerCase(Locale.ENGLISH);
             for (int i = 0; i < extensions.length; ++i) {
                 if (littlePath.endsWith(extensions[i])) {
-                    urls[0] = FileUtils.getFileUtils().getFileURL(location);
+                    urls[0] = fileToURL(location);
                     break;
                 }
             }
@@ -523,7 +523,7 @@ public final class Locator {
             });
         urls = new URL[matches.length];
         for (int i = 0; i < matches.length; ++i) {
-            urls[i] = FileUtils.getFileUtils().getFileURL(matches[i]);
+            urls[i] = fileToURL(matches[i]);
         }
         return urls;
     }



Mime
View raw message