directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1083598 - in /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api: LdapConnectionConfig.java LdapNetworkConnection.java
Date Sun, 20 Mar 2011 22:15:48 GMT
Author: felixk
Date: Sun Mar 20 22:15:48 2011
New Revision: 1083598

URL: http://svn.apache.org/viewvc?rev=1083598&view=rev
Log:
Don't catch accidentally RuntimeExceptions and mask potential bugs by catching all Exceptions

Modified:
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionConfig.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionConfig.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionConfig.java?rev=1083598&r1=1083597&r2=1083598&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionConfig.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionConfig.java
Sun Mar 20 22:15:48 2011
@@ -22,6 +22,8 @@ package org.apache.directory.ldap.client
 
 
 import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 
 import javax.net.ssl.KeyManager;
@@ -120,10 +122,14 @@ public class LdapConnectionConfig
                 }
             }
         }
-        catch( Exception e )
+        catch( NoSuchAlgorithmException e )
         {
             LOG.warn( "couldn't find any default X509 TrustManager with algorithm {}", trustMgmtAlgo
);
         }
+        catch( KeyStoreException e )
+        {
+            LOG.warn( "couldn't initialize TrustManagerFactory with keystore {}", KeyStore.getDefaultType()
);
+        }
     }
     
     

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1083598&r1=1083597&r2=1083598&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Sun Mar 20 22:15:48 2011
@@ -32,6 +32,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -586,7 +587,11 @@ public class LdapNetworkConnection exten
                             ( ( SearchFuture ) responseFuture ).set( SearchNoDResponse.PROTOCOLERROR
);
                         }
                     }
-                    catch ( Exception e )
+                    catch ( ExecutionException e )
+                    {
+                        LOG.error( "Error while processing the NoD for {}", responseFuture
);
+                    }
+                    catch ( InterruptedException e )
                     {
                         LOG.error( "Error while processing the NoD for {}", responseFuture
);
                     }



Mime
View raw message