You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by fe...@apache.org on 2010/10/05 11:41:21 UTC

svn commit: r1004587 - in /directory/shared/trunk: dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ ldap-client-api/src/main/java/org/apache/directory/ldap/client...

Author: felixk
Date: Tue Oct  5 09:41:20 2010
New Revision: 1004587

URL: http://svn.apache.org/viewvc?rev=1004587&view=rev
Log:
Fix pmd errors

Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierComparator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DummySSLSocketFactory.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java Tue Oct  5 09:41:20 2010
@@ -73,7 +73,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.SearchRequest;
 import org.apache.directory.shared.ldap.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.SearchResultReference;
-import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.xmlpull.v1.XmlPullParserException;
@@ -87,12 +86,6 @@ import org.xmlpull.v1.XmlPullParserExcep
  */
 public class Dsmlv2Engine
 {
-    /** The port. */
-    private int port;
-
-    /** The host. */
-    private String host;
-
     /** The user. */
     private String user;
 
@@ -128,8 +121,6 @@ public class Dsmlv2Engine
      */
     public Dsmlv2Engine( String host, int port, String user, String password )
     {
-        this.host = host;
-        this.port = port;
         this.user = user;
         this.password = password;
 
@@ -437,17 +428,6 @@ public class Dsmlv2Engine
     }
 
 
-    private void copyMessageIdAndControls( Message from, Message to )
-    {
-        to.setMessageId( from.getMessageId() );
-
-        for ( Control control : from.getControls().values() )
-        {
-            to.addControl( control );
-        }
-    }
-
-
     /**
      * Processes the BatchRequest
      * <ul>

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java Tue Oct  5 09:41:20 2010
@@ -1632,7 +1632,7 @@ public final class Dsmlv2ResponseGrammar
         {
             SearchResultDone searchResultDone = new SearchResultDoneImpl();
 
-            LdapResult ldapResult = searchResultDone.getLdapResult();
+            searchResultDone.getLdapResult();
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java Tue Oct  5 09:41:20 2010
@@ -37,15 +37,6 @@ public class LdapConnectionPool extends 
 
     /**
      * Instantiates a new LDAP connection pool.
-     */
-    public LdapConnectionPool()
-    {
-        super();
-    }
-
-
-    /**
-     * Instantiates a new LDAP connection pool.
      *
      * @param factory the LDAP connection factory
      */
@@ -56,17 +47,6 @@ public class LdapConnectionPool extends 
 
 
     /**
-     * Sets the LDAP connection factory.
-     *
-     * @param factory the new LDAP connection factory
-     */
-    public void setFactory( PoolableLdapConnectionFactory factory )
-    {
-        super.setFactory( factory );
-    }
-
-
-    /**
      * Gives a LdapConnection fetched from the pool.
      *
      * @return an LdapConnection object from pool 

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=1004587&r1=1004586&r2=1004587&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 Tue Oct  5 09:41:20 2010
@@ -28,7 +28,6 @@ import java.net.SocketAddress;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -212,14 +211,10 @@ public class LdapNetworkConnection exten
 
     // ~~~~~~~~~~~~~~~~~ common error messages ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    private static final String OPERATION_CANCELLED = "Operation would have been cancelled";
-
     static final String TIME_OUT_ERROR = "TimeOut occured";
 
     static final String NO_RESPONSE_ERROR = "The response queue has been emptied, no response was found.";
 
-    private static final String COMPARE_FAILED = "Failed to perform compare operation";
-
 
     //--------------------------- Helper methods ---------------------------//
     /**
@@ -458,6 +453,7 @@ public class LdapNetworkConnection exten
     /**
      * {@inheritDoc}
      */
+    @SuppressWarnings("PMD.EmptyCatchBlock")
     public boolean connect() throws LdapException, IOException
     {
         if ( ( ldapSession != null ) && connected.get() )
@@ -975,42 +971,6 @@ public class LdapNetworkConnection exten
 
 
     /**
-     * Create a Simple BindRequest with controls ready to be sent.
-     */
-    private BindRequest createBindRequest( String name, byte[] credentials, Control[] controls ) throws LdapException
-    {
-        return createBindRequest( name, credentials, null, controls );
-    }
-
-
-    /**
-     * Create a Simple BindRequest with controls ready to be sent.
-     */
-    private BindRequest createBindRequest( DN name, byte[] credentials, Control[] controls ) throws LdapException
-    {
-        return createBindRequest( name, credentials, null, controls );
-    }
-
-
-    /**
-     * Create a SASL BindRequest ready to be sent.
-     */
-    private BindRequest createBindRequest( String name, byte[] credentials, String mechanism ) throws LdapException
-    {
-        return createBindRequest( name, credentials, mechanism, ( Control[] ) null );
-    }
-
-
-    /**
-     * Create a SASL BindRequest ready to be sent.
-     */
-    private BindRequest createBindRequest( DN name, byte[] credentials, String mechanism ) throws LdapException
-    {
-        return createBindRequest( name, credentials, mechanism, ( Control ) null );
-    }
-
-
-    /**
      * Create a complete BindRequest ready to be sent.
      */
     private BindRequest createBindRequest( String name, byte[] credentials, String saslMechanism, Control... controls )
@@ -1489,7 +1449,8 @@ public class LdapNetworkConnection exten
         LOG.debug( "Sending Unbind request \n{}", unbindRequest );
 
         // Send the request to the server
-        WriteFuture unbindFuture = ldapSession.write( unbindRequest );
+       // Use this for logging instead: WriteFuture unbindFuture = ldapSession.write( unbindRequest );
+        ldapSession.write( unbindRequest );
 
         //LOG.debug( "waiting for unbindFuture" );
         //unbindFuture.awaitUninterruptibly();
@@ -2456,101 +2417,6 @@ public class LdapNetworkConnection exten
 
 
     /**
-     * removes all child entries present under the given DN and finally the DN itself
-     *
-     * Working:
-     *          This is a recursive function which maintains a Map<DN,Cursor>.
-     *          The way the cascade delete works is by checking for children for a
-     *          given DN(i.e opening a search cursor) and if the cursor is empty
-     *          then delete the DN else for each entry's DN present in cursor call
-     *          deleteChildren() with the DN and the reference to the map.
-     *
-     *          The reason for opening a search cursor is based on an assumption
-     *          that an entry *might* contain children, consider the below DIT fragment
-     *
-     *          parent
-     *          /     \
-     *        child1   child2
-     *                 /     \
-     *               grand21  grand22
-     *
-     *           The below method works better in the case where the tree depth is >1
-     *
-     *   In the case of passing a non-null DeleteListener, the return value will always be null, cause the
-     *   operation is treated as asynchronous and response result will be sent using the listener callback
-     *
-     *  //FIXME provide another method for optimizing delete operation for a tree with depth <=1
-     *
-     * @param dn the DN which will be removed after removing its children
-     * @param map a map to hold the Cursor related to a DN
-     * @throws LdapException If the DN is not valid or if the deletion failed
-     */
-    private DeleteResponse deleteRecursive( DN dn, Map<DN, Cursor<Response>> cursorMap )
-        throws LdapException
-    {
-        LOG.debug( "searching for {}", dn.getName() );
-        DeleteResponse delResponse = null;
-        Cursor<Response> cursor = null;
-
-        try
-        {
-            if ( cursorMap == null )
-            {
-                cursorMap = new HashMap<DN, Cursor<Response>>();
-            }
-
-            cursor = cursorMap.get( dn );
-
-            if ( cursor == null )
-            {
-                cursor = search( dn.getName(), "(objectClass=*)", SearchScope.ONELEVEL, ( String[] ) null );
-                LOG.debug( "putting cursor for {}", dn.getName() );
-                cursorMap.put( dn, cursor );
-            }
-
-            if ( !cursor.next() ) // if this is a leaf entry's DN
-            {
-                LOG.debug( "deleting {}", dn.getName() );
-                cursorMap.remove( dn );
-                cursor.close();
-                DeleteRequest deleteRequest = new DeleteRequestImpl();
-                deleteRequest.setName( dn );
-                delResponse = delete( deleteRequest );
-            }
-            else
-            {
-                do
-                {
-                    Response searchResp = cursor.get();
-
-                    if ( searchResp instanceof SearchResultEntry )
-                    {
-                        SearchResultEntry searchResult = ( SearchResultEntry ) searchResp;
-                        deleteRecursive( searchResult.getEntry().getDn(), cursorMap );
-                    }
-                }
-                while ( cursor.next() );
-
-                cursorMap.remove( dn );
-                cursor.close();
-                LOG.debug( "deleting {}", dn.getName() );
-                DeleteRequest deleteRequest = new DeleteRequestImpl();
-                deleteRequest.setName( dn );
-                delResponse = delete( deleteRequest );
-            }
-        }
-        catch ( Exception e )
-        {
-            String msg = "Failed to delete child entries under the DN " + dn.getName();
-            LOG.error( msg, e );
-            throw new LdapException( msg, e );
-        }
-
-        return delResponse;
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public DeleteResponse delete( DeleteRequest deleteRequest ) throws LdapException

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class AddFuture extends ResponseF
      * @param connection the LDAP connection
      * @param messageId The associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public AddFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -54,6 +56,7 @@ public class AddFuture extends ResponseF
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public AddResponse get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class BindFuture extends Response
      * @param connection the LDAP connection
      * @param messageId the associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public BindFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -54,6 +56,7 @@ public class BindFuture extends Response
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public BindResponse get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class CompareFuture extends Respo
      * @param connection the LDAP connection
      * @param messageId the associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public CompareFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -54,6 +56,7 @@ public class CompareFuture extends Respo
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public CompareResponse get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class DeleteFuture extends Respon
      * @param connection the LDAP connection
      * @param messageId The associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public DeleteFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -54,6 +56,7 @@ public class DeleteFuture extends Respon
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public DeleteResponse get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class ExtendedFuture extends Resp
      * @param connection the LDAP connection
      * @param messageId The associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public ExtendedFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -54,6 +56,7 @@ public class ExtendedFuture extends Resp
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public Response get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class ModifyDnFuture extends Resp
      * @param connection the LDAP connection
      * @param messageId The associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public ModifyDnFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -54,6 +56,7 @@ public class ModifyDnFuture extends Resp
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public ModifyDnResponse get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class ModifyFuture extends Respon
      * @param connection the LDAP connection
      * @param messageId The associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public ModifyFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -54,6 +56,7 @@ public class ModifyFuture extends Respon
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public ModifyResponse get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java Tue Oct  5 09:41:20 2010
@@ -41,6 +41,8 @@ public class SearchFuture extends Respon
      * @param connection the LDAP connection
      * @param messageId The associated messageId
      */
+    // Implicit super constructor ResponseFuture<BindResponse>() is undefined for default constructor. 
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public SearchFuture( LdapConnection connection, int messageId )
     {
         super( connection, messageId );
@@ -56,6 +58,7 @@ public class SearchFuture extends Respon
      * @throws InterruptedException {@inheritDoc}
      * @throws ExecutionException {@inheritDoc}
      */
+    @SuppressWarnings("PMD.UselessOverridingMethod")
     public Response get() throws InterruptedException, ExecutionException
     {
         return super.get();

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/protocol/LdapProtocolEncoder.java Tue Oct  5 09:41:20 2010
@@ -28,8 +28,6 @@ import org.apache.mina.core.buffer.IoBuf
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolEncoder;
 import org.apache.mina.filter.codec.ProtocolEncoderOutput;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -39,12 +37,6 @@ import org.slf4j.LoggerFactory;
  */
 public class LdapProtocolEncoder implements ProtocolEncoder
 {
-    /** The logger */
-    private static final Logger LOG = LoggerFactory.getLogger( LdapProtocolEncoder.class );
-
-    /** A speedup for logger */
-    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-
     /** The stateful encoder */
     private static final LdapEncoder ENCODER = new LdapEncoder();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java Tue Oct  5 09:41:20 2010
@@ -28,8 +28,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.ldap.message.spi.Provider;
 import org.apache.directory.shared.ldap.message.spi.ProviderEncoder;
 import org.apache.directory.shared.ldap.message.spi.ProviderException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -39,12 +37,6 @@ import org.slf4j.LoggerFactory;
  */
 public class LdapEncoder implements ProviderEncoder
 {
-    /** The logger */
-    private static Logger log = LoggerFactory.getLogger( LdapEncoder.class );
-
-    /** A speedup for logger */
-    private static final boolean IS_DEBUG = log.isDebugEnabled();
-
     /** The associated Provider */
     final Provider provider;
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java Tue Oct  5 09:41:20 2010
@@ -562,12 +562,9 @@ public class BinaryValue extends Abstrac
         {
             wrappedValue = new byte[wrappedLength];
 
-            if ( wrappedLength > 0 )
+            if ( wrappedLength > 0 &&  in.read( wrappedValue ) == -1 )
             {
-                if ( in.read( wrappedValue ) == -1 )
-                {
-                    throw new IOException( I18n.err( I18n.ERR_04480_END_OF_STREAM ) );
-                }
+                throw new IOException( I18n.err( I18n.ERR_04480_END_OF_STREAM ) );
             }
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java Tue Oct  5 09:41:20 2010
@@ -727,16 +727,6 @@ public class ImmutableEntry implements E
 
 
     /**
-     * A helper method to recompute the hash code
-     */
-    private void rehash()
-    {
-        new Exception().printStackTrace();
-        throw new NotImplementedException( "Cannot rehash the entry " + entry.getDn() + " is immutable." );
-    }
-
-
-    /**
      * Get the hash code of this ClientEntry. The Attributes will be sorted
      * before the comparison can be done.
      *

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java Tue Oct  5 09:41:20 2010
@@ -511,7 +511,6 @@ public class FilterParser
     private static ExprNode parseItem( SchemaManager schemaManager, String filter, Position pos, char c ) 
         throws ParseException, LdapException
     {
-        LeafNode node = null;
         String attribute = null;
 
         if ( c == '\0' )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java Tue Oct  5 09:41:20 2010
@@ -1337,7 +1337,7 @@ public class LdapEncoder
      * UnBindRequest : 
      * 0x42 00
      */
-    private int computeUnbindRequestLength( UnbindRequestImpl unbindRequest )
+    private int computeUnbindRequestLength( )
     {
         return 2; // Always 2
     }
@@ -2295,7 +2295,7 @@ public class LdapEncoder
     /**
      * Encode the Unbind protocolOp part
      */
-    private void encodeUnbindRequest( ByteBuffer buffer, UnbindRequestImpl unbindRequest ) throws EncoderException
+    private void encodeUnbindRequest( ByteBuffer buffer ) throws EncoderException
     {
         try
         {
@@ -2422,7 +2422,7 @@ public class LdapEncoder
                 return computeSearchResultReferenceLength( ( SearchResultReferenceImpl ) message );
 
             case UNBIND_REQUEST:
-                return computeUnbindRequestLength( ( UnbindRequestImpl ) message );
+                return computeUnbindRequestLength( );
 
             default:
                 return 0;
@@ -2515,7 +2515,7 @@ public class LdapEncoder
                 break;
 
             case UNBIND_REQUEST:
-                encodeUnbindRequest( bb, ( UnbindRequestImpl ) message );
+                encodeUnbindRequest( bb );
                 break;
         }
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierComparator.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ObjectIdentifierComparator.java Tue Oct  5 09:41:20 2010
@@ -21,7 +21,6 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.schema.LdapComparator;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -36,9 +35,6 @@ public class ObjectIdentifierComparator 
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( ObjectIdentifierComparator.class );
 
-    /** A reference to the schema manager */
-    private transient SchemaManager schemaManager;
-
     /** The serialVersionUID */
     private static final long serialVersionUID = 1L;
 
@@ -54,15 +50,6 @@ public class ObjectIdentifierComparator 
 
 
     /**
-     * {@inheritDoc}
-     */
-    public void setSchemaManager( SchemaManager schemaManager )
-    {
-        this.schemaManager = schemaManager;
-    }
-
-
-    /**
      * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
      */
     public int compare( Object o1, Object o2 )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java Tue Oct  5 09:41:20 2010
@@ -1520,6 +1520,8 @@ public class Registries implements Schem
     /**
      * Register the given SchemaObject into the associated Registry
      */
+    // Remove SuppressWarnings when TODO is fixed
+    @SuppressWarnings("PMD.EmptyIfStmt")
     private void register( List<Throwable> errors, SchemaObject schemaObject ) throws LdapException
     {
         LOG.debug( "Registering {}:{}", schemaObject.getObjectType(), schemaObject.getOid() );
@@ -1738,7 +1740,7 @@ public class Registries implements Schem
      * @throws LdapException If the removal failed
      */
     // Remove me when TODO is implemented
-    @SuppressWarnings("PMD.UnusedFormalParameter")
+    @SuppressWarnings({"PMD.UnusedFormalParameter","PMD.EmptyIfStmt"})
     private SchemaObject unregister( List<Throwable> errors, SchemaObject schemaObject ) throws LdapException
     {
         LOG.debug( "Unregistering {}:{}", schemaObject.getObjectType(), schemaObject.getOid() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DummySSLSocketFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DummySSLSocketFactory.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DummySSLSocketFactory.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/DummySSLSocketFactory.java Tue Oct  5 09:41:20 2010
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.Socket;
-import java.net.UnknownHostException;
 import java.security.SecureRandom;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java?rev=1004587&r1=1004586&r2=1004587&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java Tue Oct  5 09:41:20 2010
@@ -374,7 +374,7 @@ public class DnNode<N> implements Clonea
 
     
     /**
-     * recursively get all the elements from nodes havig an element
+     * recursively get all the elements from nodes having an element
      */
     private void getDescendantElements( DnNode<N> node, List<N> descendants )
     {