harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
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 GMT
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) {



Mime
View raw message