Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 38149 invoked from network); 14 Dec 2008 06:07:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2008 06:07:26 -0000 Received: (qmail 23496 invoked by uid 500); 14 Dec 2008 06:07:39 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 23474 invoked by uid 500); 14 Dec 2008 06:07:39 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 23465 invoked by uid 99); 14 Dec 2008 06:07:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Dec 2008 22:07:39 -0800 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; Sun, 14 Dec 2008 06:07:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 17D472388970; Sat, 13 Dec 2008 22:07:06 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r726380 - /harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java Date: Sun, 14 Dec 2008 06:07:06 -0000 To: commits@harmony.apache.org From: ndbeyer@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081214060706.17D472388970@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ndbeyer Date: Sat Dec 13 22:07:05 2008 New Revision: 726380 URL: http://svn.apache.org/viewvc?rev=726380&view=rev Log: wrap IO calls in try/finally to allow for complete resource close Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java?rev=726380&r1=726379&r2=726380&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java (original) +++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java Sat Dec 13 22:07:05 2008 @@ -76,9 +76,11 @@ } if (keystore != null) { FileInputStream fis = new FileInputStream(keystore); - ks.load(fis, pwd); - fis.close(); - + try { + ks.load(fis, pwd); + } finally { + fis.close(); + } KeyManagerFactory kmf; String kmfAlg = Security.getProperty("ssl.KeyManagerFactory.algorithm"); if (kmfAlg == null) { @@ -100,8 +102,11 @@ // TODO Defaults: jssecacerts; cacerts if (keystore != null) { FileInputStream fis = new FileInputStream(keystore); - ks.load(fis, pwd); - fis.close(); + try { + ks.load(fis, pwd); + } finally { + fis.close(); + } TrustManagerFactory tmf; String tmfAlg = Security.getProperty("ssl.TrustManagerFactory.algorithm"); if (tmfAlg == null) {