directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r944650 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Date Sat, 15 May 2010 14:38:03 GMT
Author: kayyagari
Date: Sat May 15 14:38:03 2010
New Revision: 944650

URL: http://svn.apache.org/viewvc?rev=944650&view=rev
Log:
o logging exceptions instead of leaving the catch blocks empty
o removed PMD annotations

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=944650&r1=944649&r2=944650&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Sat May 15 14:38:03 2010
@@ -46,7 +46,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.message.SearchRequest;
 import org.apache.directory.ldap.client.api.message.SearchResponse;
 import org.apache.directory.ldap.client.api.message.SearchResultEntry;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.ldap.NotImplementedException;
@@ -79,6 +78,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -99,6 +100,8 @@ public class LdapCoreSessionConnection i
     /** the session's DirectoryService */
     private DirectoryService directoryService;
 
+    private static final Logger LOG = LoggerFactory.getLogger( LdapCoreSessionConnection.class
);
+    
     public LdapCoreSessionConnection()
     {
 
@@ -491,8 +494,6 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     public SearchResponse lookup( String dn, String... attributes ) throws LdapException
     {
         SearchResultEntry resp = null;
@@ -506,6 +507,7 @@ public class LdapCoreSessionConnection i
         catch ( Exception e )
         {
             // do nothing
+            LOG.warn( e.getMessage(), e );
         }
 
         return resp;
@@ -515,8 +517,6 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     public SearchResponse lookup( String dn ) throws LdapException
     {
         SearchResultEntry resp = null;
@@ -529,6 +529,7 @@ public class LdapCoreSessionConnection i
         catch ( Exception e )
         {
             // do nothing
+            LOG.warn( e.getMessage(), e );
         }
 
         return resp;
@@ -744,8 +745,6 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     public Cursor<SearchResponse> search( SearchRequest searchRequest ) throws LdapException
     {
         try
@@ -773,6 +772,7 @@ public class LdapCoreSessionConnection i
         }
         catch ( Exception e )
         {
+            LOG.warn( e.getMessage(), e );
         }
 
         return new EmptyCursor<SearchResponse>();
@@ -890,8 +890,6 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     public BindResponse bind() throws LdapException, IOException
     {
         try
@@ -900,6 +898,7 @@ public class LdapCoreSessionConnection i
         }
         catch( Exception e )
         {
+            LOG.warn( e.getMessage(), e );
         }
         
         return null;
@@ -909,8 +908,6 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     public BindResponse bind( BindRequest bindRequest ) throws LdapException, IOException
     {
         try
@@ -927,6 +924,7 @@ public class LdapCoreSessionConnection i
         }
         catch( Exception e )
         {
+            LOG.warn( e.getMessage(), e );
         }
         
         return null;
@@ -936,8 +934,6 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
-    // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
     public BindResponse bind( DN name, String credentials ) throws LdapException, IOException
     {
         try
@@ -946,6 +942,7 @@ public class LdapCoreSessionConnection i
         }
         catch( Exception e )
         {
+            LOG.warn( e.getMessage(), e );
         }
         
         return null;



Mime
View raw message