Browse Source

little bit of code review

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@533214 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 18 years ago
parent
commit
88e48dbdd3
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      src/main/org/apache/tools/ant/AntClassLoader.java

+ 8
- 5
src/main/org/apache/tools/ant/AntClassLoader.java View File

@@ -35,6 +35,7 @@ import java.util.Hashtable;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Vector;
import java.util.Locale;
import java.util.jar.Attributes;
import java.util.jar.Attributes.Name;
import java.util.jar.JarFile;
@@ -212,7 +213,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener {
*/
private Hashtable zipFiles = new Hashtable();

/** Static map of jar file/time to manifiest class-path entries */
/** Static map of jar file/time to manifest class-path entries */
private static Map/*<String,String>*/ pathMap = Collections.synchronizedMap(new HashMap());

/**
@@ -515,9 +516,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener {
} catch (org.apache.tools.ant.taskdefs.ManifestException e) {
// ignore
} finally {
if (manifestStream != null) {
manifestStream.close();
}
FileUtils.close(manifestStream);
if (jarFile != null) {
jarFile.close();
}
@@ -829,6 +828,9 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener {
if (zipFile == null) {
zipFile = new ZipFile(file);
zipFiles.put(file, zipFile);
//to eliminate a race condition, retrieve the entry
//that is in the hash table under that filename
zipFile = (ZipFile) zipFiles.get(file);
}
ZipEntry entry = zipFile.getEntry(resourceName);
if (entry != null) {
@@ -1276,7 +1278,8 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener {
}
}

if (sealedString != null && sealedString.equalsIgnoreCase("true")) {
if (sealedString != null
&& sealedString.toLowerCase(Locale.ENGLISH).equals("true")) {
try {
sealBase = new URL(FileUtils.getFileUtils().toURI(container.getAbsolutePath()));
} catch (MalformedURLException e) {


Loading…
Cancel
Save