directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1771436 [3/3] - in /directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec: ./ actions/bindRequest/ actions/bindResponse/ actions/compareRequest/ actions/controls/ actions/delRequest/ actions/extendedReque...
Date Sat, 26 Nov 2016 07:48:58 GMT
Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyRequestDecorator.java Sat Nov 26 07:48:58 2016
@@ -152,6 +152,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public Dn getName()
     {
         return getDecorated().getName();
@@ -161,6 +162,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest setName( Dn name )
     {
         getDecorated().setName( name );
@@ -172,6 +174,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public Collection<Modification> getModifications()
     {
         return getDecorated().getModifications();
@@ -181,6 +184,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest addModification( Modification mod )
     {
         getDecorated().addModification( mod );
@@ -192,6 +196,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest removeModification( Modification mod )
     {
         getDecorated().removeModification( mod );
@@ -203,6 +208,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest remove( String attributeName, String... attributeValue )
     {
         getDecorated().remove( attributeName, attributeValue );
@@ -225,6 +231,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest remove( Attribute attr )
     {
         getDecorated().remove( attr );
@@ -236,6 +243,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest remove( String attributeName )
     {
         getDecorated().remove( attributeName );
@@ -247,6 +255,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest addModification( Attribute attr, ModificationOperation modOp )
     {
         getDecorated().addModification( attr, modOp );
@@ -258,6 +267,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest add( String attributeName, String... attributeValue )
     {
         getDecorated().add( attributeName, attributeValue );
@@ -280,6 +290,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest add( Attribute attr )
     {
         getDecorated().add( attr );
@@ -291,6 +302,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest replace( String attributeName )
     {
         getDecorated().replace( attributeName );
@@ -302,6 +314,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest replace( String attributeName, String... attributeValue )
     {
         getDecorated().replace( attributeName, attributeValue );
@@ -324,6 +337,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest replace( Attribute attr )
     {
         getDecorated().replace( attr );
@@ -335,6 +349,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest setMessageId( int messageId )
     {
         super.setMessageId( messageId );
@@ -346,6 +361,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest addControl( Control control )
     {
         return ( ModifyRequest ) super.addControl( control );
@@ -355,6 +371,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest addAllControls( Control[] controls )
     {
         return ( ModifyRequest ) super.addAllControls( controls );
@@ -364,6 +381,7 @@ public class ModifyRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ModifyRequest removeControl( Control control )
     {
         return ( ModifyRequest ) super.removeControl( control );
@@ -415,6 +433,7 @@ public class ModifyRequestDecorator exte
      *                          +--&gt; 0x04 L8-2-n attributeValue
      * </pre>
      */
+    @Override
     public int computeLength()
     {
         // Initialized with name
@@ -426,11 +445,11 @@ public class ModifyRequestDecorator exte
 
         Collection<Modification> modifications = getModifications();
 
-        if ( ( modifications != null ) && ( modifications.size() != 0 ) )
+        if ( ( modifications != null ) && ( !modifications.isEmpty() ) )
         {
-            changeLength = new LinkedList<Integer>();
-            modificationLength = new LinkedList<Integer>();
-            valuesLength = new LinkedList<Integer>();
+            changeLength = new LinkedList<>();
+            modificationLength = new LinkedList<>();
+            valuesLength = new LinkedList<>();
 
             for ( Modification modification : modifications )
             {
@@ -505,6 +524,7 @@ public class ModifyRequestDecorator exte
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         try
@@ -523,7 +543,7 @@ public class ModifyRequestDecorator exte
             // The modifications list
             Collection<Modification> modifications = getModifications();
 
-            if ( ( modifications != null ) && ( modifications.size() != 0 ) )
+            if ( ( modifications != null ) && ( !modifications.isEmpty() ) )
             {
                 int modificationNumber = 0;
 
@@ -569,7 +589,7 @@ public class ModifyRequestDecorator exte
                         }
                     }
 
-                    // Go to the next modification number;
+                    // Go to the next modification number
                     modificationNumber++;
                 }
             }

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyResponseDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyResponseDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyResponseDecorator.java Sat Nov 26 07:48:58 2016
@@ -72,6 +72,7 @@ public class ModifyResponseDecorator ext
      * Length(ModifyResponse) = Length(0x67) + Length(L1) + L1
      * </pre>
      */
+    @Override
     public int computeLength()
     {
         modifyResponseLength = ( ( LdapResultDecorator ) getLdapResult() ).computeLength();
@@ -85,6 +86,7 @@ public class ModifyResponseDecorator ext
      * 
      * @param buffer The buffer where to put the PDU
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         try

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/RequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/RequestDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/RequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/RequestDecorator.java Sat Nov 26 07:48:58 2016
@@ -28,9 +28,9 @@ import org.apache.directory.api.ldap.mod
 /**
  * A decorator for the LdapResultResponse message
  *
- * TODO make this extend AbstractDsmlMessageDecorator instead of codec's 
- * MessageDecorator.
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * 
+ * @param <M> The request to decorate
  */
 public abstract class RequestDecorator<M extends Request> extends MessageDecorator<M> implements Request
 {
@@ -49,6 +49,7 @@ public abstract class RequestDecorator<M
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean hasResponse()
     {
         return ( getDecorated() ).hasResponse();

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResponseDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResponseDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResponseDecorator.java Sat Nov 26 07:48:58 2016
@@ -30,6 +30,7 @@ import org.apache.directory.api.ldap.mod
  * A decorator for the Response message. It will store the LdapResult.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @param <M> The response to be decorated
  */
 public abstract class ResponseDecorator<M extends ResultResponse> extends MessageDecorator<M> implements ResultResponse
 {
@@ -47,13 +48,14 @@ public abstract class ResponseDecorator<
     {
         super( codec, decoratedMessage );
 
-        ldapResultDecorator = new LdapResultDecorator( codec, ( ( ResultResponse ) decoratedMessage ).getLdapResult() );
+        ldapResultDecorator = new LdapResultDecorator( codec, ( decoratedMessage ).getLdapResult() );
     }
 
 
     /**
      * @return the ldapResultDecorator
      */
+    @Override
     public LdapResult getLdapResult()
     {
         return ldapResultDecorator;

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResultResponseRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResultResponseRequestDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResultResponseRequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ResultResponseRequestDecorator.java Sat Nov 26 07:48:58 2016
@@ -29,6 +29,7 @@ import org.apache.directory.api.ldap.mod
  * A decorator for the LdapResultResponse message
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @param <M> The request to be decorated
  */
 public abstract class ResultResponseRequestDecorator<M extends ResultResponseRequest>
     extends RequestDecorator<M> implements ResultResponseRequest
@@ -48,6 +49,7 @@ public abstract class ResultResponseRequ
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean hasResponse()
     {
         return getDecorated().hasResponse();
@@ -57,6 +59,7 @@ public abstract class ResultResponseRequ
     /**
      * {@inheritDoc}
      */
+    @Override
     public ResultResponse getResultResponse()
     {
         return getDecorated().getResultResponse();

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java Sat Nov 26 07:48:58 2016
@@ -179,6 +179,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setFilter( ExprNode filter )
     {
         topFilter = transform( filter );
@@ -190,6 +191,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setFilter( String filter ) throws LdapException
     {
         getDecorated().setFilter( filter );
@@ -329,7 +331,7 @@ public class SearchRequestDecorator exte
             // Transform OR, AND or NOT leaves
             if ( filter instanceof ConnectorFilter )
             {
-                BranchNode branch = null;
+                BranchNode branch;
 
                 if ( filter instanceof AndFilter )
                 {
@@ -339,7 +341,7 @@ public class SearchRequestDecorator exte
                 {
                     branch = new OrNode();
                 }
-                else if ( filter instanceof NotFilter )
+                else
                 {
                     branch = new NotNode();
                 }
@@ -415,7 +417,7 @@ public class SearchRequestDecorator exte
 
                     if ( substrFilter.getAnySubstrings() != null )
                     {
-                        anyString = new ArrayList<String>();
+                        anyString = new ArrayList<>();
 
                         for ( String any : substrFilter.getAnySubstrings() )
                         {
@@ -475,7 +477,7 @@ public class SearchRequestDecorator exte
                 {
                     filter = new OrFilter();
                 }
-                else if ( exprNode instanceof NotNode )
+                else
                 {
                     filter = new NotFilter();
                 }
@@ -655,7 +657,7 @@ public class SearchRequestDecorator exte
             return false;
         }
 
-        if ( ( o == null ) || ( o instanceof SearchRequestDecorator ) )
+        if ( !( o instanceof SearchRequestDecorator ) )
         {
             return false;
         }
@@ -707,6 +709,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public MessageTypeEnum[] getResponseTypes()
     {
         return getDecorated().getResponseTypes();
@@ -716,6 +719,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public Dn getBase()
     {
         return getDecorated().getBase();
@@ -725,6 +729,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setBase( Dn baseDn )
     {
         getDecorated().setBase( baseDn );
@@ -736,6 +741,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchScope getScope()
     {
         return getDecorated().getScope();
@@ -745,6 +751,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setScope( SearchScope scope )
     {
         getDecorated().setScope( scope );
@@ -756,6 +763,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public AliasDerefMode getDerefAliases()
     {
         return getDecorated().getDerefAliases();
@@ -765,6 +773,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setDerefAliases( AliasDerefMode aliasDerefAliases )
     {
         getDecorated().setDerefAliases( aliasDerefAliases );
@@ -776,6 +785,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public long getSizeLimit()
     {
         return getDecorated().getSizeLimit();
@@ -785,6 +795,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setSizeLimit( long entriesMax )
     {
         getDecorated().setSizeLimit( entriesMax );
@@ -796,6 +807,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public int getTimeLimit()
     {
         return getDecorated().getTimeLimit();
@@ -805,6 +817,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setTimeLimit( int secondsMax )
     {
         getDecorated().setTimeLimit( secondsMax );
@@ -816,6 +829,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean getTypesOnly()
     {
         return getDecorated().getTypesOnly();
@@ -825,6 +839,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setTypesOnly( boolean typesOnly )
     {
         getDecorated().setTypesOnly( typesOnly );
@@ -836,6 +851,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExprNode getFilter()
     {
         return getDecorated().getFilter();
@@ -845,6 +861,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public List<String> getAttributes()
     {
         return getDecorated().getAttributes();
@@ -854,6 +871,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest addAttributes( String... attributes )
     {
         getDecorated().addAttributes( attributes );
@@ -865,6 +883,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest removeAttribute( String attribute )
     {
         getDecorated().removeAttribute( attribute );
@@ -901,6 +920,7 @@ public class SearchRequestDecorator exte
      *        +--&gt; 0x04 L4-n Attribute description
      * </pre>
      */
+    @Override
     public int computeLength()
     {
         searchRequestLength = 0;
@@ -932,7 +952,7 @@ public class SearchRequestDecorator exte
         // The attributes description list
         attributeDescriptionListLength = 0;
 
-        if ( ( getAttributes() != null ) && ( getAttributes().size() != 0 ) )
+        if ( ( getAttributes() != null ) && ( !getAttributes().isEmpty() ) )
         {
             // Compute the attributes length
             for ( String attribute : getAttributes() )
@@ -972,6 +992,7 @@ public class SearchRequestDecorator exte
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         try
@@ -1005,7 +1026,7 @@ public class SearchRequestDecorator exte
             buffer.put( UniversalTag.SEQUENCE.getValue() );
             buffer.put( TLV.getBytes( attributeDescriptionListLength ) );
 
-            if ( ( getAttributes() != null ) && ( getAttributes().size() != 0 ) )
+            if ( ( getAttributes() != null ) && ( !getAttributes().isEmpty() ) )
             {
                 // encode each attribute
                 for ( String attribute : getAttributes() )
@@ -1023,30 +1044,50 @@ public class SearchRequestDecorator exte
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public SearchResultDone getResultResponse()
     {
         return ( SearchResultDone ) getDecorated().getResultResponse();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public boolean hasResponse()
     {
         return getDecorated().hasResponse();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public void abandon()
     {
         getDecorated().abandon();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public boolean isAbandoned()
     {
         return getDecorated().isAbandoned();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public SearchRequest addAbandonListener( AbandonListener listener )
     {
         getDecorated().addAbandonListener( listener );
@@ -1058,6 +1099,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest setMessageId( int messageId )
     {
         return ( SearchRequest ) super.setMessageId( messageId );
@@ -1067,6 +1109,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest addControl( Control control )
     {
         return ( SearchRequest ) super.addControl( control );
@@ -1076,6 +1119,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest addAllControls( Control[] controls )
     {
         return ( SearchRequest ) super.addAllControls( controls );
@@ -1085,6 +1129,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest removeControl( Control control )
     {
         return ( SearchRequest ) super.removeControl( control );
@@ -1094,6 +1139,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isFollowReferrals()
     {
         return getDecorated().isFollowReferrals();
@@ -1103,6 +1149,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest followReferrals()
     {
         return getDecorated().followReferrals();
@@ -1112,6 +1159,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isIgnoreReferrals()
     {
         return getDecorated().isIgnoreReferrals();
@@ -1121,6 +1169,7 @@ public class SearchRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchRequest ignoreReferrals()
     {
         return getDecorated().ignoreReferrals();

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultDoneDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultDoneDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultDoneDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultDoneDecorator.java Sat Nov 26 07:48:58 2016
@@ -72,6 +72,7 @@ public class SearchResultDoneDecorator e
      * </pre>
      * 
      */
+    @Override
     public int computeLength()
     {
         searchResultDoneLength = ( ( LdapResultDecorator ) getLdapResult() ).computeLength();
@@ -87,6 +88,7 @@ public class SearchResultDoneDecorator e
      * return The encoded response
      * @throws EncoderException If the encoding failed
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         try

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultEntryDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultEntryDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultEntryDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultEntryDecorator.java Sat Nov 26 07:48:58 2016
@@ -144,6 +144,7 @@ public class SearchResultEntryDecorator
     /**
      * {@inheritDoc}
      */
+    @Override
     public Dn getObjectName()
     {
         return getDecorated().getObjectName();
@@ -153,6 +154,7 @@ public class SearchResultEntryDecorator
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setObjectName( Dn objectName )
     {
         getDecorated().setObjectName( objectName );
@@ -162,6 +164,7 @@ public class SearchResultEntryDecorator
     /**
      * {@inheritDoc}
      */
+    @Override
     public Entry getEntry()
     {
         return getDecorated().getEntry();
@@ -171,6 +174,7 @@ public class SearchResultEntryDecorator
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setEntry( Entry entry )
     {
         getDecorated().setEntry( entry );
@@ -221,6 +225,7 @@ public class SearchResultEntryDecorator
      *                    +--&gt; 0x04 L7-m-n value
      * </pre>
      */
+    @Override
     public int computeLength()
     {
         Dn dn = getObjectName();
@@ -237,17 +242,17 @@ public class SearchResultEntryDecorator
 
         if ( ( entry != null ) && ( entry.size() != 0 ) )
         {
-            attributeLength = new LinkedList<Integer>();
-            attributeIds = new LinkedList<byte[]>();
-            valuesLength = new LinkedList<Integer>();
+            attributeLength = new LinkedList<>();
+            attributeIds = new LinkedList<>();
+            valuesLength = new LinkedList<>();
 
             // Store those lists in the object
-            valuesLength = new LinkedList<Integer>();
+            valuesLength = new LinkedList<>();
 
             // Compute the attributes length
             for ( Attribute attribute : entry )
             {
-                int localAttributeLength = 0;
+                int localAttributeLength;
                 int localValuesLength = 0;
 
                 // Get the type length
@@ -329,6 +334,7 @@ public class SearchResultEntryDecorator
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         try
@@ -375,7 +381,7 @@ public class SearchResultEntryDecorator
                         }
                     }
 
-                    // Go to the next attribute number;
+                    // Go to the next attribute number
                     attributeNumber++;
                 }
             }

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultReferenceDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultReferenceDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultReferenceDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchResultReferenceDecorator.java Sat Nov 26 07:48:58 2016
@@ -66,6 +66,7 @@ public class SearchResultReferenceDecora
     /**
      * {@inheritDoc}
      */
+    @Override
     public Referral getReferral()
     {
         return getDecorated().getReferral();
@@ -75,6 +76,7 @@ public class SearchResultReferenceDecora
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setReferral( Referral referral )
     {
         getDecorated().setReferral( referral );
@@ -106,6 +108,7 @@ public class SearchResultReferenceDecora
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         searchResultReferenceLength = 0;
@@ -139,6 +142,7 @@ public class SearchResultReferenceDecora
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         SearchResultReference searchResultReference = getDecorated();

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SingleReplyRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SingleReplyRequestDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SingleReplyRequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SingleReplyRequestDecorator.java Sat Nov 26 07:48:58 2016
@@ -31,6 +31,7 @@ import org.apache.directory.api.ldap.mod
  * A decorator for the LdapResultResponse message
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @param <M> The request to be decorated
  */
 public abstract class SingleReplyRequestDecorator<M extends SingleReplyRequest>
     extends ResultResponseRequestDecorator<M> implements SingleReplyRequest, AbandonableRequest
@@ -50,6 +51,7 @@ public abstract class SingleReplyRequest
     /**
      * {@inheritDoc}
      */
+    @Override
     public MessageTypeEnum getResponseType()
     {
         return getDecorated().getResponseType();
@@ -59,6 +61,7 @@ public abstract class SingleReplyRequest
     /**
      * {@inheritDoc}
      */
+    @Override
     public void abandon()
     {
         ( ( AbandonableRequest ) getDecorated() ).abandon();
@@ -68,6 +71,7 @@ public abstract class SingleReplyRequest
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isAbandoned()
     {
         return ( ( AbandonableRequest ) getDecorated() ).isAbandoned();
@@ -77,6 +81,7 @@ public abstract class SingleReplyRequest
     /**
      * {@inheritDoc}
      */
+    @Override
     public AbandonableRequest addAbandonListener( AbandonListener listener )
     {
         ( ( AbandonableRequest ) getDecorated() ).addAbandonListener( listener );

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/UnbindRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/UnbindRequestDecorator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/UnbindRequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/UnbindRequestDecorator.java Sat Nov 26 07:48:58 2016
@@ -53,6 +53,7 @@ public class UnbindRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public UnbindRequest setMessageId( int messageId )
     {
         super.setMessageId( messageId );
@@ -64,6 +65,7 @@ public class UnbindRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public UnbindRequest addControl( Control control )
     {
         return ( UnbindRequest ) super.addControl( control );
@@ -73,6 +75,7 @@ public class UnbindRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public UnbindRequest addAllControls( Control[] controls )
     {
         return ( UnbindRequest ) super.addAllControls( controls );
@@ -82,6 +85,7 @@ public class UnbindRequestDecorator exte
     /**
      * {@inheritDoc}
      */
+    @Override
     public UnbindRequest removeControl( Control control )
     {
         return ( UnbindRequest ) super.removeControl( control );
@@ -100,6 +104,7 @@ public class UnbindRequestDecorator exte
      * 0x42 00
      * </pre>
      */
+    @Override
     public int computeLength()
     {
         // Always 2
@@ -110,6 +115,7 @@ public class UnbindRequestDecorator exte
     /**
      * Encode the Unbind protocolOp part
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         try

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultActivator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultActivator.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultActivator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultActivator.java Sat Nov 26 07:48:58 2016
@@ -38,6 +38,9 @@ public class DefaultActivator implements
     private ServiceRegistration<?> registration;
 
 
+    /**
+     * Creates a new instance of DefaultActivator 
+     */
     public DefaultActivator()
     {
         this.codec = new DefaultLdapCodecService();
@@ -47,6 +50,7 @@ public class DefaultActivator implements
     /**
      * {@inheritDoc}
      */
+    @Override
     public void start( BundleContext bundleContext ) throws Exception
     {
         registration = bundleContext.registerService( LdapApiService.class.getName(), codec, null );
@@ -57,6 +61,7 @@ public class DefaultActivator implements
     /**
      * {@inheritDoc}
      */
+    @Override
     public void stop( BundleContext bundleContext ) throws Exception
     {
         registration.unregister();

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/osgi/DefaultLdapCodecService.java Sat Nov 26 07:48:58 2016
@@ -81,10 +81,10 @@ public class DefaultLdapCodecService imp
     private static final Logger LOG = LoggerFactory.getLogger( DefaultLdapCodecService.class );
 
     /** The map of registered {@link org.apache.directory.api.ldap.codec.api.ControlFactory}'s */
-    private Map<String, ControlFactory<? extends Control>> controlFactories = new HashMap<String, ControlFactory<? extends Control>>();
+    private Map<String, ControlFactory<? extends Control>> controlFactories = new HashMap<>();
 
     /** The map of registered {@link org.apache.directory.api.ldap.codec.api.ExtendedOperationFactory}'s by request OID */
-    private Map<String, ExtendedOperationFactory> extendedOperationsFactories = new HashMap<String, ExtendedOperationFactory>();
+    private Map<String, ExtendedOperationFactory> extendedOperationsFactories = new HashMap<>();
 
     /** The registered ProtocolCodecFactory */
     private ProtocolCodecFactory protocolCodecFactory;
@@ -141,6 +141,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ControlFactory<?> registerControl( ControlFactory<?> factory )
     {
         return controlFactories.put( factory.getOid(), factory );
@@ -150,6 +151,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ControlFactory<?> unregisterControl( String oid )
     {
         return controlFactories.remove( oid );
@@ -159,6 +161,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public Iterator<String> registeredControls()
     {
         return Collections.unmodifiableSet( controlFactories.keySet() ).iterator();
@@ -168,6 +171,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isControlRegistered( String oid )
     {
         return controlFactories.containsKey( oid );
@@ -177,6 +181,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public Iterator<String> registeredExtendedRequests()
     {
         return Collections.unmodifiableSet( extendedOperationsFactories.keySet() ).iterator();
@@ -186,6 +191,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedOperationFactory registerExtendedRequest( ExtendedOperationFactory factory )
     {
         return extendedOperationsFactories.put( factory.getOid(), factory );
@@ -195,12 +201,14 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ProtocolCodecFactory getProtocolCodecFactory()
     {
         return protocolCodecFactory;
     }
 
 
+    @Override
     public ProtocolCodecFactory registerProtocolCodecFactory( ProtocolCodecFactory protocolCodecFactory )
     {
         ProtocolCodecFactory oldFactory = this.protocolCodecFactory;
@@ -212,13 +220,14 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public CodecControl<? extends Control> newControl( String oid )
     {
         ControlFactory<?> factory = controlFactories.get( oid );
 
         if ( factory == null )
         {
-            return new BasicControlDecorator<Control>( this, new OpaqueControl( oid ) );
+            return new BasicControlDecorator( this, new OpaqueControl( oid ) );
         }
 
         return factory.newCodecControl();
@@ -229,6 +238,7 @@ public class DefaultLdapCodecService imp
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
+    @Override
     public CodecControl<? extends Control> newControl( Control control )
     {
         if ( control == null )
@@ -247,7 +257,7 @@ public class DefaultLdapCodecService imp
 
         if ( factory == null )
         {
-            return new BasicControlDecorator<Control>( this, control );
+            return new BasicControlDecorator( this, control );
         }
 
         return factory.newCodecControl( control );
@@ -257,21 +267,22 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public javax.naming.ldap.Control toJndiControl( Control control ) throws EncoderException
     {
         CodecControl<? extends Control> decorator = newControl( control );
         ByteBuffer bb = ByteBuffer.allocate( decorator.computeLength() );
         decorator.encode( bb );
         bb.flip();
-        BasicControl jndiControl =
-            new BasicControl( control.getOid(), control.isCritical(), bb.array() );
-        return jndiControl;
+
+        return new BasicControl( control.getOid(), control.isCritical(), bb.array() );
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public Control fromJndiControl( javax.naming.ldap.Control control ) throws DecoderException
     {
         @SuppressWarnings("rawtypes")
@@ -281,8 +292,8 @@ public class DefaultLdapCodecService imp
         {
             OpaqueControl ourControl = new OpaqueControl( control.getID() );
             ourControl.setCritical( control.isCritical() );
-            BasicControlDecorator<Control> decorator =
-                new BasicControlDecorator<Control>( this, ourControl );
+            BasicControlDecorator decorator =
+                new BasicControlDecorator( this, ourControl );
             decorator.setValue( control.getEncodedValue() );
             return decorator;
         }
@@ -300,6 +311,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public Asn1Container newMessageContainer()
     {
         return new LdapMessageContainer<MessageDecorator<? extends Message>>( this );
@@ -309,6 +321,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedOperationFactory unregisterExtendedRequest( String oid )
     {
         return extendedOperationsFactories.remove( oid );
@@ -318,6 +331,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public javax.naming.ldap.ExtendedResponse toJndi( final ExtendedResponse modelResponse ) throws EncoderException
     {
         throw new NotImplementedException( "Figure out how to transform" );
@@ -327,6 +341,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedResponse fromJndi( javax.naming.ldap.ExtendedResponse jndiResponse ) throws DecoderException
     {
         throw new NotImplementedException( "Figure out how to transform" );
@@ -336,17 +351,17 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedRequest fromJndi( javax.naming.ldap.ExtendedRequest jndiRequest ) throws DecoderException
     {
-        ExtendedRequestDecorator<?> decorator =
-            ( ExtendedRequestDecorator<?> ) newExtendedRequest( jndiRequest.getID(), jndiRequest.getEncodedValue() );
-        return decorator;
+        return newExtendedRequest( jndiRequest.getID(), jndiRequest.getEncodedValue() );
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public javax.naming.ldap.ExtendedRequest toJndi( final ExtendedRequest modelRequest ) throws EncoderException
     {
         final String oid = modelRequest.getRequestName();
@@ -367,23 +382,26 @@ public class DefaultLdapCodecService imp
             value = decorator.getRequestValue();
         }
 
-        javax.naming.ldap.ExtendedRequest jndiRequest = new javax.naming.ldap.ExtendedRequest()
+        return new javax.naming.ldap.ExtendedRequest()
         {
             private static final long serialVersionUID = -4160980385909987475L;
 
 
+            @Override
             public String getID()
             {
                 return oid;
             }
 
 
+            @Override
             public byte[] getEncodedValue()
             {
                 return value;
             }
 
 
+            @Override
             public javax.naming.ldap.ExtendedResponse createExtendedResponse( String id, byte[] berValue, int offset,
                 int length ) throws NamingException
             {
@@ -394,24 +412,25 @@ public class DefaultLdapCodecService imp
                 {
                     final ExtendedResponseDecorator<?> resp = ( ExtendedResponseDecorator<?> ) factory
                         .newResponse( berValue );
-                    javax.naming.ldap.ExtendedResponse jndiResponse = new javax.naming.ldap.ExtendedResponse()
+                    
+                    return new javax.naming.ldap.ExtendedResponse()
                     {
                         private static final long serialVersionUID = -7686354122066100703L;
 
 
+                        @Override
                         public String getID()
                         {
                             return oid;
                         }
 
 
+                        @Override
                         public byte[] getEncodedValue()
                         {
                             return resp.getResponseValue();
                         }
                     };
-
-                    return jndiResponse;
                 }
                 catch ( DecoderException de )
                 {
@@ -422,8 +441,6 @@ public class DefaultLdapCodecService imp
                 }
             }
         };
-
-        return jndiRequest;
     }
 
 
@@ -431,6 +448,7 @@ public class DefaultLdapCodecService imp
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
+    @Override
     public <E extends ExtendedResponse> E newExtendedResponse( String responseName, int messageId,
         byte[] serializedResponse )
         throws DecoderException
@@ -461,9 +479,10 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedRequest newExtendedRequest( String oid, byte[] value )
     {
-        ExtendedRequest req = null;
+        ExtendedRequest req;
 
         ExtendedOperationFactory extendedRequestFactory = extendedOperationsFactories.get( oid );
 
@@ -488,9 +507,10 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedRequestDecorator<?> decorate( ExtendedRequest decoratedMessage )
     {
-        ExtendedRequestDecorator<?> req = null;
+        ExtendedRequestDecorator<?> req;
 
         ExtendedOperationFactory extendedRequestFactory = extendedOperationsFactories.get( decoratedMessage
             .getRequestName() );
@@ -501,7 +521,7 @@ public class DefaultLdapCodecService imp
         }
         else
         {
-            req = new ExtendedRequestDecorator<ExtendedRequest>( this, decoratedMessage );
+            req = new ExtendedRequestDecorator<>( this, decoratedMessage );
         }
 
         return req;
@@ -511,9 +531,10 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedResponseDecorator<?> decorate( ExtendedResponse decoratedMessage )
     {
-        ExtendedResponseDecorator<?> resp = null;
+        ExtendedResponseDecorator<?> resp;
 
         ExtendedOperationFactory extendedRequestFactory = extendedOperationsFactories.get( decoratedMessage
             .getResponseName() );
@@ -524,7 +545,7 @@ public class DefaultLdapCodecService imp
         }
         else
         {
-            resp = new ExtendedResponseDecorator<ExtendedResponse>( this, decoratedMessage );
+            resp = new ExtendedResponseDecorator<>( this, decoratedMessage );
         }
 
         return resp;
@@ -534,6 +555,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isExtendedOperationRegistered( String oid )
     {
         return extendedOperationsFactories.containsKey( oid );

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AndFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AndFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AndFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AndFilter.java Sat Nov 26 07:48:58 2016
@@ -83,6 +83,7 @@ public class AndFilter extends Connector
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         filtersLength = super.computeLength();
@@ -103,6 +104,7 @@ public class AndFilter extends Connector
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -132,9 +134,10 @@ public class AndFilter extends Connector
      * 
      * @return The AND filter string
      */
+    @Override
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( '&' ).append( super.toString() );
 

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java Sat Nov 26 07:48:58 2016
@@ -140,6 +140,7 @@ public class AttributeValueAssertionFilt
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         avaLength = 0;
@@ -149,7 +150,7 @@ public class AttributeValueAssertionFilt
 
         org.apache.directory.api.ldap.model.entry.Value<?> assertionValue = assertion.getAssertionValue();
 
-        int assertionValueLength = 0;
+        int assertionValueLength;
 
         assertionValueLength = assertionValue.getBytes().length;
 
@@ -180,6 +181,7 @@ public class AttributeValueAssertionFilt
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -241,6 +243,7 @@ public class AttributeValueAssertionFilt
      * 
      * @return The item filter string
      */
+    @Override
     public String toString()
     {
         return assertion != null ? assertion.toStringRFC2254( filterType ) : "";

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ConnectorFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ConnectorFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ConnectorFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ConnectorFilter.java Sat Nov 26 07:48:58 2016
@@ -75,7 +75,7 @@ public abstract class ConnectorFilter ex
 
         if ( filterSet == null )
         {
-            filterSet = new ArrayList<Filter>();
+            filterSet = new ArrayList<>();
         }
 
         filterSet.add( filter );
@@ -99,11 +99,12 @@ public abstract class ConnectorFilter ex
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         int connectorFilterLength = 0;
 
-        if ( ( filterSet != null ) && ( filterSet.size() != 0 ) )
+        if ( ( filterSet != null ) && ( !filterSet.isEmpty() ) )
         {
             for ( Filter filter : filterSet )
             {
@@ -126,6 +127,7 @@ public abstract class ConnectorFilter ex
      * @return The PDU.
      * @throws EncoderException If the encoding failed
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -134,7 +136,7 @@ public abstract class ConnectorFilter ex
         }
 
         // encode each filter
-        if ( ( filterSet != null ) && ( filterSet.size() != 0 ) )
+        if ( ( filterSet != null ) && ( !filterSet.isEmpty() ) )
         {
             for ( Filter filter : filterSet )
             {
@@ -152,11 +154,12 @@ public abstract class ConnectorFilter ex
      * 
      * @return The composite filter string
      */
+    @Override
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        if ( ( filterSet != null ) && ( filterSet.size() != 0 ) )
+        if ( ( filterSet != null ) && ( !filterSet.isEmpty() ) )
         {
             for ( Filter filter : filterSet )
             {

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ExtensibleMatchFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ExtensibleMatchFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ExtensibleMatchFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/ExtensibleMatchFilter.java Sat Nov 26 07:48:58 2016
@@ -209,6 +209,7 @@ public class ExtensibleMatchFilter exten
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         if ( matchingRule != null )
@@ -258,6 +259,7 @@ public class ExtensibleMatchFilter exten
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -330,10 +332,11 @@ public class ExtensibleMatchFilter exten
      * 
      * @return An Extended Filter String
      */
+    @Override
     public String toString()
     {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         if ( type != null )
         {

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/NotFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/NotFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/NotFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/NotFilter.java Sat Nov 26 07:48:58 2016
@@ -63,6 +63,7 @@ public class NotFilter extends Connector
      * 
      * @param filter The Filter to add
      */
+    @Override
     public void addFilter( Filter filter ) throws DecoderException
     {
         if ( filterSet != null )
@@ -115,6 +116,7 @@ public class NotFilter extends Connector
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         filtersLength = super.computeLength();
@@ -134,6 +136,7 @@ public class NotFilter extends Connector
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -163,9 +166,10 @@ public class NotFilter extends Connector
      * 
      * @return The NOT filter string
      */
+    @Override
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( '!' ).append( super.toString() );
 

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/OrFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/OrFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/OrFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/OrFilter.java Sat Nov 26 07:48:58 2016
@@ -83,6 +83,7 @@ public class OrFilter extends ConnectorF
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         filtersLength = super.computeLength();
@@ -102,6 +103,7 @@ public class OrFilter extends ConnectorF
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -131,10 +133,11 @@ public class OrFilter extends ConnectorF
      * 
      * @return The OR filter string
      */
+    @Override
     public String toString()
     {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( '|' ).append( super.toString() );
 

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/PresentFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/PresentFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/PresentFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/PresentFilter.java Sat Nov 26 07:48:58 2016
@@ -99,6 +99,7 @@ public class PresentFilter extends Filte
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         attributeDescriptionBytes = Strings.getBytesUtf8( attributeDescription );
@@ -113,6 +114,7 @@ public class PresentFilter extends Filte
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -141,10 +143,11 @@ public class PresentFilter extends Filte
      * 
      * @return The Present filter string
      */
+    @Override
     public String toString()
     {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( attributeDescription ).append( "=*" );
 

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/SubstringFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/SubstringFilter.java?rev=1771436&r1=1771435&r2=1771436&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/SubstringFilter.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/SubstringFilter.java Sat Nov 26 07:48:58 2016
@@ -65,7 +65,7 @@ public class SubstringFilter extends Fil
     private String initialSubstrings;
 
     /** The any filter. It's a list of LdapString */
-    private List<String> anySubstrings = new ArrayList<String>( 1 );
+    private List<String> anySubstrings = new ArrayList<>( 1 );
 
     /** The final filter */
     private String finalSubstrings;
@@ -227,6 +227,7 @@ public class SubstringFilter extends Fil
      * 
      * @return The encoded length
      */
+    @Override
     public int computeLength()
     {
         // The type
@@ -286,6 +287,7 @@ public class SubstringFilter extends Fil
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
+    @Override
     public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
     {
         if ( buffer == null )
@@ -306,7 +308,7 @@ public class SubstringFilter extends Fil
             buffer.put( UniversalTag.SEQUENCE.getValue() );
             buffer.put( TLV.getBytes( substringsFilterSequenceLength ) );
 
-            if ( ( initialSubstrings == null ) && ( ( anySubstrings == null ) || ( anySubstrings.size() == 0 ) )
+            if ( ( initialSubstrings == null ) && ( ( anySubstrings == null ) || anySubstrings.isEmpty() )
                 && ( finalSubstrings == null ) )
             {
                 throw new EncoderException( I18n.err( I18n.ERR_04058 ) );
@@ -356,10 +358,11 @@ public class SubstringFilter extends Fil
      * 
      * @return The substring filter string
      */
+    @Override
     public String toString()
     {
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         if ( initialSubstrings != null )
         {



Mime
View raw message