Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 29792 invoked from network); 4 Aug 2009 19:54:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Aug 2009 19:54:04 -0000 Received: (qmail 82003 invoked by uid 500); 4 Aug 2009 19:54:09 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 81937 invoked by uid 500); 4 Aug 2009 19:54:09 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 81925 invoked by uid 99); 4 Aug 2009 19:54:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 19:54:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 19:54:05 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7FE29238886C; Tue, 4 Aug 2009 19:53:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r800940 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java Date: Tue, 04 Aug 2009 19:53:45 -0000 To: commits@felix.apache.org From: rickhall@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090804195345.7FE29238886C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rickhall Date: Tue Aug 4 19:53:45 2009 New Revision: 800940 URL: http://svn.apache.org/viewvc?rev=800940&view=rev Log: Let exception pass up when trying to open JAR files. (FELIX-883) Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java?rev=800940&r1=800939&r2=800940&view=diff ============================================================================== --- felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java (original) +++ felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java Tue Aug 4 19:53:45 2009 @@ -59,17 +59,7 @@ protected void finalize() { - if (m_jarFile != null) - { - try - { - m_jarFile.close(); - } - catch (IOException ex) - { - // Not much we can do, so ignore it. - } - } + close(); } public synchronized void close() @@ -96,17 +86,7 @@ // Open JAR file if not already opened. if (m_jarFile == null) { - try - { - openJarFile(); - } - catch (IOException ex) - { - m_logger.log( - Logger.LOG_ERROR, - "JarContent: Unable to open JAR file.", ex); - return false; - } + openJarFile(); } try @@ -128,17 +108,7 @@ // Open JAR file if not already opened. if (m_jarFile == null) { - try - { - openJarFile(); - } - catch (IOException ex) - { - m_logger.log( - Logger.LOG_ERROR, - "JarContent: Unable to open JAR file.", ex); - return null; - } + openJarFile(); } // Wrap entries enumeration to filter non-matching entries. @@ -153,17 +123,7 @@ // Open JAR file if not already opened. if (m_jarFile == null) { - try - { - openJarFile(); - } - catch (IOException ex) - { - m_logger.log( - Logger.LOG_ERROR, - "JarContent: Unable to open JAR file.", ex); - return null; - } + openJarFile(); } // Get the embedded resource. @@ -224,17 +184,7 @@ // Open JAR file if not already opened. if (m_jarFile == null) { - try - { - openJarFile(); - } - catch (IOException ex) - { - m_logger.log( - Logger.LOG_ERROR, - "JarContent: Unable to open JAR file.", ex); - return null; - } + openJarFile(); } // Get the embedded resource. @@ -266,17 +216,7 @@ // Open JAR file if not already opened. if (m_jarFile == null) { - try - { - openJarFile(); - } - catch (IOException ex) - { - m_logger.log( - Logger.LOG_ERROR, - "JarContent: Unable to open JAR file.", ex); - return null; - } + openJarFile(); } @@ -366,18 +306,7 @@ // Open JAR file if not already opened. if (m_jarFile == null) { - try - { - openJarFile(); - } - catch (IOException ex) - { - m_logger.log( - Logger.LOG_ERROR, - "Unable to open JAR file.", ex); - return null; - } - + openJarFile(); } // Remove any leading slash. @@ -491,11 +420,18 @@ return m_file; } - private void openJarFile() throws IOException + private void openJarFile() throws RuntimeException { if (m_jarFile == null) { - m_jarFile = BundleCache.getSecureAction().openJAR(m_file, false); + try + { + m_jarFile = BundleCache.getSecureAction().openJAR(m_file, false); + } + catch (IOException ex) + { + throw new RuntimeException("Unable to open JAR file, probably deleted.", ex); + } } }