Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 88285 invoked from network); 16 Jan 2002 05:18:15 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 16 Jan 2002 05:18:15 -0000 Received: (qmail 6659 invoked by uid 97); 16 Jan 2002 05:18:17 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 6624 invoked by uid 97); 16 Jan 2002 05:18:16 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 6613 invoked by uid 97); 16 Jan 2002 05:18:16 -0000 Date: 16 Jan 2002 05:06:01 -0000 Message-ID: <20020116050601.75516.qmail@icarus.apache.org> From: billbarker@apache.org To: jakarta-tomcat-cvs@apache.org Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/depend DependClassLoader12.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N billbarker 02/01/15 21:06:01 Modified: src/share/org/apache/tomcat/util/depend DependClassLoader12.java Log: Change to use JarFile rather than JarURLConnection. Continuing to work around the problems with Java 1.3.x locking up jar files. Now, the jar file is closed after defining the package (and so can be replaced w/o waiting for finalize). Now, it should be possible to have both the good reloading of 3.3 with the brain-challenged loading behavior of 3.2. This is about as non-critical as code in 3.3 gets, so the extra open/close shouldn't hurt perfomance at all. Also some formatting fixes. Revision Changes Path 1.8 +13 -13 jakarta-tomcat/src/share/org/apache/tomcat/util/depend/DependClassLoader12.java Index: DependClassLoader12.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/depend/DependClassLoader12.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DependClassLoader12.java 9 Jan 2002 06:21:14 -0000 1.7 +++ DependClassLoader12.java 16 Jan 2002 05:06:01 -0000 1.8 @@ -65,7 +65,6 @@ import java.security.*; import org.apache.tomcat.util.compat.*; - /** * 1.2 support for DependClassLoader * @@ -115,19 +114,19 @@ if ( p == null ) { if ( "jar".equals(res.getProtocol()) ) { try { - JarURLConnection juconn = - (JarURLConnection)res.openConnection(); - Manifest mf = juconn.getManifest(); - if(mf == null) // Jar may not be Java2 - throw new IOException("No Manifest"); - Attributes main = mf.getMainAttributes(); - Attributes pkg = mf.getAttributes( - pkgname.replace('.', '/').concat("/") - ); - boolean sealed = Boolean.valueOf( - getAttribute(Attributes.Name.SEALED, main, pkg) + String JarN = res.getFile(); + JarFile JarF = new JarFile(JarN); + Manifest mf = JarF.getManifest(); + if(mf == null) // Jar may not be Java2 + throw new IOException("No Manifest"); + Attributes main = mf.getMainAttributes(); + Attributes pkg = mf.getAttributes( + pkgname.replace('.', '/').concat("/") + ); + boolean sealed = Boolean.valueOf( + getAttribute(Attributes.Name.SEALED, main, pkg) ).booleanValue(); - definePackage( + definePackage( pkgname, getAttribute(Attributes.Name.SPECIFICATION_TITLE, main, pkg), getAttribute(Attributes.Name.SPECIFICATION_VERSION, main, pkg), @@ -137,6 +136,7 @@ getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR, main, pkg), sealed ? res : null ); + JarF.close(); } catch ( IOException e ) { definePackage(pkgname, null, null, null, null, null, null, null); } -- To unsubscribe, e-mail: For additional commands, e-mail: