Browse Source

Don't mess with classloading of the launcher

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1376031 13f79535-47bb-0310-9956-ffa450edef68
master
Nicolas Lalevee 13 years ago
parent
commit
97d423a273
2 changed files with 5 additions and 6 deletions
  1. +2
    -3
      src/main/org/apache/tools/ant/launch/Launcher.java
  2. +3
    -3
      src/main/org/apache/tools/ant/launch/Locator.java

+ 2
- 3
src/main/org/apache/tools/ant/launch/Launcher.java View File

@@ -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;
}


+ 3
- 3
src/main/org/apache/tools/ant/launch/Locator.java View File

@@ -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;
}


Loading…
Cancel
Save