This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hi,
This reverts the lookaside support in URLClassLoader. It was bothering
me while trying to merge URLClassLoader with GNU Classpath and Tom and
Andrew said on irc that it was not (anymore) supported anyway.
(See http://gcc.gnu.org/ml/java-patches/2004-q3/msg00481.html)
2005-02-15 Mark Wielaard <mark@klomp.org>
* java/net/URLClassLoader.java (JarURLLoader.JarURLLoader): Don't look
aside for "GCJLIBS" in directory where jarfiles are loaded.
(JarURLLoader.getClass): Removed method.
(JarURLLoader.toString): Removed method.
(FileResource.toString): Removed method.
All regression tests still pass with this applied.
OK to commit?
Mark
Index: java/net/URLClassLoader.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URLClassLoader.java,v
retrieving revision 1.23
diff -u -r1.23 URLClassLoader.java
--- java/net/URLClassLoader.java 12 Feb 2005 13:51:11 -0000 1.23
+++ java/net/URLClassLoader.java 15 Feb 2005 17:09:53 -0000
@@ -306,8 +306,6 @@
Vector classPath; // The "Class-Path" attribute of this Jar's manifest
- SoURLLoader soURLLoader;
-
public JarURLLoader(URLClassLoader classloader, URL baseURL)
{
super(classloader, baseURL);
@@ -320,70 +318,48 @@
sb.append("!/");
String jarURL = sb.toString();
- this.soURLLoader = null;
this.classPath = null;
URL baseJarURL = null;
JarFile jarfile = null;
try
{
- baseJarURL
- = new URL(null, jarURL, classloader.getURLStreamHandler("jar"));
- jarfile
- = ((JarURLConnection) baseJarURL.openConnection()).getJarFile();
-
- if (jarfile != null)
+ baseJarURL =
+ new URL(null, jarURL, classloader.getURLStreamHandler("jar"));
+
+ jarfile =
+ ((JarURLConnection) baseJarURL.openConnection()).getJarFile();
+
+ Manifest manifest;
+ Attributes attributes;
+ String classPathString;
+
+ if ((manifest = jarfile.getManifest()) != null
+ && (attributes = manifest.getMainAttributes()) != null
+ && ((classPathString
+ = attributes.getValue(Attributes.Name.CLASS_PATH))
+ != null))
{
- String fileName = baseURL.getFile();
- if (fileName != null)
- {
- File f = new File(fileName);
- String libDirName = f.getCanonicalFile().getParent()
- + File.separator + "GCJLIBS";
- File libDir = new File(libDirName);
- if (libDir != null && (libDir.isDirectory()))
+ this.classPath = new Vector();
+
+ StringTokenizer st
+ = new StringTokenizer
+ (classPathString,
+ System.getProperty ("path.separator", ":"));
+
+ while (st.hasMoreElements ())
+ {
+ String e = st.nextToken ();
+ try
{
- File soFile = new File (libDirName
- + File.separator + f.getName()
- + ".so");
- if (soFile != null && soFile.isFile())
- this.soURLLoader
- = new SoURLLoader (classloader, soFile.toURL(),
- baseURL);
- }
- }
-
- Manifest manifest;
- Attributes attributes;
- String classPathString;
-
- if ((manifest = jarfile.getManifest()) != null
- && (attributes = manifest.getMainAttributes()) != null
- && ((classPathString
- = attributes.getValue(Attributes.Name.CLASS_PATH))
- != null))
- {
- this.classPath = new Vector();
-
- StringTokenizer st
- = new StringTokenizer
- (classPathString,
- System.getProperty ("path.separator", ":"));
-
- while (st.hasMoreElements ())
- {
- String e = st.nextToken ();
- try
- {
- URL url = new URL(baseURL, e);
- this.classPath.add(url);
- }
- catch (java.net.MalformedURLException xx)
- {
- // Give up
- }
+ URL url = new URL(baseURL, e);
+ this.classPath.add(url);
+ }
+ catch (java.net.MalformedURLException xx)
+ {
+ // Give up
}
}
- }
+ }
}
catch (IOException ioe)
{
@@ -394,13 +370,6 @@
this.jarfile = jarfile;
}
- Class getClass(String className)
- {
- if (soURLLoader != null)
- return soURLLoader.getClass(className);
- return null;
- }
-
/** get resource with the name "name" in the jar url */
Resource getResource(String name)
{
@@ -417,11 +386,6 @@
return null;
}
- public String toString ()
- {
- return "jarfile " + jarfile.getName();
- }
-
Manifest getManifest()
{
try
@@ -672,11 +636,6 @@
return (int) file.length();
}
- public String toString ()
- {
- return "file " +file.getAbsolutePath();
- }
-
public URL getURL()
{
try
Attachment:
signature.asc
Description: This is a digitally signed message part
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |