directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1681127 - in /directory/shared/trunk: asn1/api/src/main/java/org/apache/directory/api/asn1/util/ ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/ ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/ l...
Date Fri, 22 May 2015 14:25:14 GMT
Author: elecharny
Date: Fri May 22 14:25:14 2015
New Revision: 1681127

URL: http://svn.apache.org/r1681127
Log:
Fixed many of the SOnar critical issues 

Modified:
    directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionValidator.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/LookupLdapConnectionValidator.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/AbstractPasswordPolicyResponder.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java
    directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv/VirtualListViewResultCode.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ad_impl/AdDirSyncDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncDoneValueDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncInfoValueDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncRequestValueDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncStateValueDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewRequestDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewResponseDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/cancel/CancelDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/certGeneration/CertGenerationDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulDisconnect/GracefulDisconnectDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulShutdown/GracefulShutdownDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseDecoder.java
    directory/shared/trunk/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/util/tree/DnNode.java
    directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
    directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extractor/impl/ResourceMap.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Serialize.java

Modified: directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java
(original)
+++ directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java
Fri May 22 14:25:14 2015
@@ -74,7 +74,7 @@ import org.apache.directory.api.i18n.I18
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-final public class Oid
+public final class Oid
 {
     private byte[] oidBytes;
     private String oidString;
@@ -330,7 +330,7 @@ final public class Oid
 
     // Internal helper class for converting a long value to a properly encoded
     // byte[]
-    final private static class ByteBuffer
+    private static final class ByteBuffer
     {
         private ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionValidator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionValidator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionValidator.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/DefaultLdapConnectionValidator.java
Fri May 22 14:25:14 2015
@@ -26,7 +26,7 @@ package org.apache.directory.ldap.client
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-final public class DefaultLdapConnectionValidator implements LdapConnectionValidator
+public final class DefaultLdapConnectionValidator implements LdapConnectionValidator
 {
     /**
      * Returns true if <code>connection</code> is connected, and authenticated.

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=1681127&r1=1681126&r2=1681127&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
Fri May 22 14:25:14 2015
@@ -742,12 +742,9 @@ public class LdapNetworkConnection exten
 
         if ( container != null )
         {
-            if ( schemaManager != null )
+            if ( ( schemaManager != null ) && !( container.getBinaryAttributeDetector()
instanceof SchemaBinaryAttributeDetector ) )
             {
-                if ( !( container.getBinaryAttributeDetector() instanceof SchemaBinaryAttributeDetector
) )
-                {
-                    container.setBinaryAttributeDetector( new SchemaBinaryAttributeDetector(
schemaManager ) );
-                }
+                container.setBinaryAttributeDetector( new SchemaBinaryAttributeDetector(
schemaManager ) );
             }
         }
         else

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java
Fri May 22 14:25:14 2015
@@ -31,7 +31,7 @@ import org.apache.directory.api.ldap.mod
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-final public class LookupLdapConnectionValidator implements LdapConnectionValidator
+public final class LookupLdapConnectionValidator implements LdapConnectionValidator
 {
     /**
      * Returns true if <code>connection</code> is connected, authenticated, and

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/AbstractPasswordPolicyResponder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/AbstractPasswordPolicyResponder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/AbstractPasswordPolicyResponder.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/AbstractPasswordPolicyResponder.java
Fri May 22 14:25:14 2015
@@ -40,7 +40,7 @@ import org.apache.directory.ldap.client.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-abstract public class AbstractPasswordPolicyResponder implements PasswordPolicyResponder
+public abstract class AbstractPasswordPolicyResponder implements PasswordPolicyResponder
 {
     private final PasswordPolicyDecorator passwordPolicyRequestControl;
 
@@ -100,7 +100,7 @@ abstract public class AbstractPasswordPo
 
 
     @Override
-    final public PasswordWarning process( PasswordPolicyOperation operation )
+    public final PasswordWarning process( PasswordPolicyOperation operation )
         throws PasswordException
     {
         try

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java
Fri May 22 14:25:14 2015
@@ -63,8 +63,8 @@ import org.slf4j.LoggerFactory;
  */
 public class LdapConnectionTemplate implements LdapConnectionOperations, ModelFactory
 {
-    private static Logger logger = LoggerFactory.getLogger( LdapConnectionTemplate.class
);
-    private static final EntryMapper<Dn> dnEntryMapper = new EntryMapper<Dn>()
+    private static Logger LOG = LoggerFactory.getLogger( LdapConnectionTemplate.class );
+    private static final EntryMapper<Dn> DN_ENTRY_MAPPER = new EntryMapper<Dn>()
     {
         @Override
         public Dn map( Entry entry ) throws LdapException
@@ -86,7 +86,7 @@ public class LdapConnectionTemplate impl
      */
     public LdapConnectionTemplate( LdapConnectionPool connectionPool )
     {
-        logger.debug( "creating new connection template from connectionPool" );
+        LOG.debug( "creating new connection template from connectionPool" );
         this.connectionPool = connectionPool;
         this.passwordPolicyRequestControl = new PasswordPolicyDecorator(
             connectionPool.getLdapApiService() );
@@ -166,7 +166,7 @@ public class LdapConnectionTemplate impl
     @Override
     public PasswordWarning authenticate( SearchRequest searchRequest, char[] password ) throws
PasswordException
     {
-        Dn userDn = searchFirst( searchRequest, dnEntryMapper );
+        Dn userDn = searchFirst( searchRequest, DN_ENTRY_MAPPER );
         if ( userDn == null )
         {
             throw new PasswordException().setResultCode( ResultCodeEnum.INVALID_CREDENTIALS
);

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java
Fri May 22 14:25:14 2015
@@ -40,6 +40,7 @@ public class LdapRequestUnsuccessfulExce
     public LdapRequestUnsuccessfulException( ResultResponse response )
     {
         super();
+        this.response = response;
     }
 
 

Modified: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv/VirtualListViewResultCode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv/VirtualListViewResultCode.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv/VirtualListViewResultCode.java
(original)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv/VirtualListViewResultCode.java
Fri May 22 14:25:14 2015
@@ -48,20 +48,35 @@ public enum VirtualListViewResultCode
 
     OTHER(80, "Other");
 
-    private int val;
+    /** The associated value */
+    private int value;
+    
+    /** The associated description */
     private String desc;
 
 
-    private VirtualListViewResultCode( int val, String desc )
+    private VirtualListViewResultCode( int value, String desc )
     {
-        this.val = val;
+        this.value = value;
         this.desc = desc;
     }
 
 
-    public int getVal()
+    /**
+     * @return The associated integer value
+     */
+    public int getValue()
     {
-        return val;
+        return value;
+    }
+
+
+    /**
+     * @return The associated description
+     */
+    public String getDesc()
+    {
+        return desc;
     }
 
 

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ad_impl/AdDirSyncDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ad_impl/AdDirSyncDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ad_impl/AdDirSyncDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ad_impl/AdDirSyncDecorator.java
Fri May 22 14:25:14 2015
@@ -47,7 +47,7 @@ public class AdDirSyncDecorator extends
     private int adDirSyncLength;
 
     /** An instance of this decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -266,7 +266,7 @@ public class AdDirSyncDecorator extends
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         AdDirSyncContainer container = new AdDirSyncContainer( getCodecService(), this );
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         return this;
     }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java
Fri May 22 14:25:14 2015
@@ -45,13 +45,11 @@ import org.apache.directory.api.ldap.ext
 public class PasswordPolicyDecorator extends ControlDecorator<PasswordPolicy> implements
PasswordPolicy
 {
     /** An instance of this decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
     // Storage for computed lengths
     private int ppolicySeqLength = 0;
     private int warningLength = 0;
-    private int timeBeforeExpirationValueLength;
-    private int graceAuthNsRemainingValueLength;
 
 
     public PasswordPolicyDecorator( LdapApiService codec )
@@ -78,7 +76,7 @@ public class PasswordPolicyDecorator ext
     @Override
     public void setValue( byte[] value )
     {
-        if ( value == null || value.length <= 2 )
+        if ( ( value == null ) || ( value.length <= 2 ) )
         {
             setResponse( null );
         }
@@ -98,8 +96,6 @@ public class PasswordPolicyDecorator ext
         valueLength = 0;
         ppolicySeqLength = 0;
         warningLength = 0;
-        timeBeforeExpirationValueLength = 0;
-        graceAuthNsRemainingValueLength = 0;
 
         if ( !hasResponse() )
         {
@@ -108,12 +104,12 @@ public class PasswordPolicyDecorator ext
 
         if ( getResponse().getTimeBeforeExpiration() >= 0 )
         {
-            timeBeforeExpirationValueLength = BerValue.getNbBytes( getResponse().getTimeBeforeExpiration()
);
+            int timeBeforeExpirationValueLength = BerValue.getNbBytes( getResponse().getTimeBeforeExpiration()
);
             warningLength = 1 + TLV.getNbBytes( timeBeforeExpirationValueLength ) + timeBeforeExpirationValueLength;
         }
         else if ( getResponse().getGraceAuthNRemaining() >= 0 )
         {
-            graceAuthNsRemainingValueLength = BerValue.getNbBytes( getResponse().getGraceAuthNRemaining()
);
+            int graceAuthNsRemainingValueLength = BerValue.getNbBytes( getResponse().getGraceAuthNRemaining()
);
             warningLength = 1 + TLV.getNbBytes( graceAuthNsRemainingValueLength ) + graceAuthNsRemainingValueLength;
         }
 
@@ -233,7 +229,7 @@ public class PasswordPolicyDecorator ext
 
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         PasswordPolicyContainer container = new PasswordPolicyContainer( getCodecService(),
this );
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         return this;
     }
 

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncDoneValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncDoneValueDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncDoneValueDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncDoneValueDecorator.java
Fri May 22 14:25:14 2015
@@ -48,7 +48,7 @@ public class SyncDoneValueDecorator exte
     private int syncDoneValueLength;
 
     /** An instance of this decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -226,7 +226,7 @@ public class SyncDoneValueDecorator exte
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         SyncDoneValueContainer container = new SyncDoneValueContainer( getCodecService(),
this );
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         return this;
     }
 }
\ No newline at end of file

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncInfoValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncInfoValueDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncInfoValueDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncInfoValueDecorator.java
Fri May 22 14:25:14 2015
@@ -51,7 +51,7 @@ public class SyncInfoValueDecorator exte
     private int syncUUIDsLength;
 
     /** An instance of this decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -541,7 +541,7 @@ public class SyncInfoValueDecorator exte
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         SyncInfoValueContainer container = new SyncInfoValueContainer( getCodecService(),
this );
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         return this;
     }
 

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncRequestValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncRequestValueDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncRequestValueDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncRequestValueDecorator.java
Fri May 22 14:25:14 2015
@@ -49,7 +49,7 @@ public class SyncRequestValueDecorator e
     private int syncRequestValueLength;
 
     /** An instance of this decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     public SyncRequestValueDecorator( LdapApiService codec )
@@ -257,7 +257,7 @@ public class SyncRequestValueDecorator e
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         SyncRequestValueContainer container = new SyncRequestValueContainer( this );
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         return this;
     }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncStateValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncStateValueDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncStateValueDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/syncrepl_impl/SyncStateValueDecorator.java
Fri May 22 14:25:14 2015
@@ -48,7 +48,7 @@ public class SyncStateValueDecorator ext
     private int syncStateSeqLength;
 
     /** An instance of this decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     public SyncStateValueDecorator( LdapApiService codec )
@@ -235,7 +235,7 @@ public class SyncStateValueDecorator ext
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
         SyncStateValueContainer container = new SyncStateValueContainer( this );
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         return this;
     }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewRequestDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewRequestDecorator.java
Fri May 22 14:25:14 2015
@@ -48,7 +48,7 @@ public class VirtualListViewRequestDecor
     private int vlvSeqLength;
     private int targetSeqLength;
 
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     public VirtualListViewRequestDecorator( LdapApiService codec )
@@ -190,7 +190,7 @@ public class VirtualListViewRequestDecor
     {
         ByteBuffer buffer = ByteBuffer.wrap( controlBytes );
         VirtualListViewRequestContainer container = new VirtualListViewRequestContainer(
this, getCodecService() );
-        decoder.decode( buffer, container );
+        DECODER.decode( buffer, container );
         return this;
     }
 

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewResponseDecorator.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewResponseDecorator.java
Fri May 22 14:25:14 2015
@@ -48,7 +48,7 @@ public class VirtualListViewResponseDeco
 {
     private int vlvSeqLength;
 
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     public VirtualListViewResponseDecorator( LdapApiService codec )
@@ -101,7 +101,7 @@ public class VirtualListViewResponseDeco
         BerValue.encode( buffer, getTargetPosition() );
         BerValue.encode( buffer, getContentCount() );
 
-        BerValue.encodeEnumerated( buffer, getVirtualListViewResult().getVal() );
+        BerValue.encodeEnumerated( buffer, getVirtualListViewResult().getValue() );
 
         if ( getContextId() != null )
         {
@@ -144,7 +144,7 @@ public class VirtualListViewResponseDeco
     {
         ByteBuffer buffer = ByteBuffer.wrap( controlBytes );
         VirtualListViewResponseContainer container = new VirtualListViewResponseContainer(
this, getCodecService() );
-        decoder.decode( buffer, container );
+        DECODER.decode( buffer, container );
 
         return this;
     }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/cancel/CancelDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/cancel/CancelDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/cancel/CancelDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/cancel/CancelDecoder.java
Fri May 22 14:25:14 2015
@@ -35,7 +35,7 @@ import org.apache.directory.api.ldap.ext
 public class CancelDecoder extends Asn1Decoder
 {
     /** The decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -50,7 +50,7 @@ public class CancelDecoder extends Asn1D
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         CancelContainer container = new CancelContainer();
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         CancelRequest cancel = container.getCancel();
 
         // Clean the container for the next decoding

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/certGeneration/CertGenerationDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/certGeneration/CertGenerationDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/certGeneration/CertGenerationDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/certGeneration/CertGenerationDecoder.java
Fri May 22 14:25:14 2015
@@ -35,7 +35,7 @@ import org.apache.directory.api.ldap.ext
 public class CertGenerationDecoder extends Asn1Decoder
 {
     /** The decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -50,7 +50,7 @@ public class CertGenerationDecoder exten
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         CertGenerationContainer container = new CertGenerationContainer();
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         CertGenerationRequestDecorator certGenerationRequestDecorator = container.getCertGenerationRequest();
 
         // Clean the container for the next decoding

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulDisconnect/GracefulDisconnectDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulDisconnect/GracefulDisconnectDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulDisconnect/GracefulDisconnectDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulDisconnect/GracefulDisconnectDecoder.java
Fri May 22 14:25:14 2015
@@ -35,7 +35,7 @@ import org.apache.directory.api.ldap.ext
 public class GracefulDisconnectDecoder extends Asn1Decoder
 {
     /** The decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -50,7 +50,7 @@ public class GracefulDisconnectDecoder e
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         GracefulDisconnectContainer container = new GracefulDisconnectContainer();
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         GracefulDisconnectResponseDecorator gracefulDisconnect = container.getGracefulDisconnectResponse();
 
         // Clean the container for the next decoding

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulShutdown/GracefulShutdownDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulShutdown/GracefulShutdownDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulShutdown/GracefulShutdownDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/gracefulShutdown/GracefulShutdownDecoder.java
Fri May 22 14:25:14 2015
@@ -35,7 +35,7 @@ import org.apache.directory.api.ldap.ext
 public class GracefulShutdownDecoder extends Asn1Decoder
 {
     /** The decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -50,7 +50,7 @@ public class GracefulShutdownDecoder ext
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         GracefulShutdownContainer container = new GracefulShutdownContainer();
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         GracefulShutdownRequestDecorator gracefulShutdown = container.getGracefulShutdownRequest();
 
         // Clean the container for the next decoding

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
Fri May 22 14:25:14 2015
@@ -36,7 +36,7 @@ import org.apache.directory.api.ldap.ext
 public class PasswordModifyRequestDecoder extends Asn1Decoder
 {
     /** The decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -51,7 +51,7 @@ public class PasswordModifyRequestDecode
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         PasswordModifyRequestContainer container = new PasswordModifyRequestContainer();
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         PasswordModifyRequestDecorator passwordModifyRequest = container.getPwdModifyRequest();
 
         // Clean the container for the next decoding

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
Fri May 22 14:25:14 2015
@@ -36,7 +36,7 @@ import org.apache.directory.api.ldap.ext
 public class PasswordModifyResponseDecoder extends Asn1Decoder
 {
     /** The decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -51,7 +51,7 @@ public class PasswordModifyResponseDecod
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         PasswordModifyResponseContainer container = new PasswordModifyResponseContainer();
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         PasswordModifyResponseDecorator pwdModifyResponse = container.getPwdModifyResponse();
 
         // Clean the container for the next decoding

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseDecoder.java
Fri May 22 14:25:14 2015
@@ -36,7 +36,7 @@ import org.apache.directory.api.ldap.ext
 public class WhoAmIResponseDecoder extends Asn1Decoder
 {
     /** The decoder */
-    private static final Asn1Decoder decoder = new Asn1Decoder();
+    private static final Asn1Decoder DECODER = new Asn1Decoder();
 
 
     /**
@@ -51,7 +51,7 @@ public class WhoAmIResponseDecoder exten
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         WhoAmIResponseContainer container = new WhoAmIResponseContainer();
-        decoder.decode( bb, container );
+        DECODER.decode( bb, container );
         WhoAmIResponseDecorator whoAmIResponse = container.getWhoAmIResponse();
 
         // Clean the container for the next decoding

Modified: directory/shared/trunk/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/util/tree/DnNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/util/tree/DnNode.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/util/tree/DnNode.java
(original)
+++ directory/shared/trunk/ldap/extras/util/src/main/java/org/apache/directory/api/ldap/util/tree/DnNode.java
Fri May 22 14:25:14 2015
@@ -1026,7 +1026,7 @@ public class DnNode<N> implements Clonea
 
         if ( hasChildren )
         {
-            for ( Rdn rdn : children.keySet() )
+            for ( Map.Entry<Rdn, DnNode<N>> entry : children.entrySet() )
             {
                 if ( isFirst )
                 {
@@ -1037,7 +1037,7 @@ public class DnNode<N> implements Clonea
                     sb.append( "\n" );
                 }
 
-                DnNode<N> child = children.get( rdn );
+                DnNode<N> child = entry.getValue();
 
                 sb.append( child.toString( tabs ) );
             }

Modified: directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
(original)
+++ directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
Fri May 22 14:25:14 2015
@@ -158,24 +158,24 @@ public class LdapProtocolDecoder impleme
                     messageContainer.clean();
                 }
             }
-            catch ( DecoderException de )
+            catch ( ResponseCarryingException rce )
             {
                 buffer.clear();
                 messageContainer.clean();
+                
+                // Transform the DecoderException message to a MessageException
+                ResponseCarryingMessageException rcme = new ResponseCarryingMessageException(
rce.getMessage() );
+                rcme.setResponse( ( ( ResponseCarryingException ) rce ).getResponse() );
 
-                if ( de instanceof ResponseCarryingException )
-                {
-                    // Transform the DecoderException message to a MessageException
-                    ResponseCarryingMessageException rcme = new ResponseCarryingMessageException(
de.getMessage() );
-                    rcme.setResponse( ( ( ResponseCarryingException ) de ).getResponse()
);
+                throw rcme;
+            }
+            catch ( DecoderException de )
+            {
+                buffer.clear();
+                messageContainer.clean();
 
-                    throw rcme;
-                }
-                else
-                {
-                    // TODO : This is certainly not the way we should handle such an exception
!
-                    throw new ResponseCarryingException( de.getMessage() );
-                }
+                // TODO : This is certainly not the way we should handle such an exception
!
+                throw new ResponseCarryingException( de.getMessage() );
             }
         }
     }

Modified: directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extractor/impl/ResourceMap.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extractor/impl/ResourceMap.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extractor/impl/ResourceMap.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schema/extractor/impl/ResourceMap.java
Fri May 22 14:25:14 2015
@@ -178,33 +178,30 @@ public final class ResourceMap
     {
         File[] fileList = directory.listFiles();
 
-        if ( fileList != null )
+        for ( File file : fileList )
         {
-            for ( File file : fileList )
+            if ( file.isDirectory() )
             {
-                if ( file.isDirectory() )
-                {
-                    getResourcesFromDirectory( map, file, pattern );
-                }
-                else
+                getResourcesFromDirectory( map, file, pattern );
+            }
+            else
+            {
+                try
                 {
-                    try
-                    {
-                        String fileName = file.getCanonicalPath();
-                        boolean accept = pattern.matcher( fileName ).matches();
+                    String fileName = file.getCanonicalPath();
+                    boolean accept = pattern.matcher( fileName ).matches();
 
-                        if ( accept )
-                        {
-                            map.put( fileName, Boolean.FALSE );
-                        }
-                    }
-                    catch ( IOException e )
+                    if ( accept )
                     {
-                        LOG.error( "Cannot load file {} : {}", file.getAbsolutePath(), e.getMessage()
);
-
-                        // Continue...
+                        map.put( fileName, Boolean.FALSE );
                     }
                 }
+                catch ( IOException e )
+                {
+                    LOG.error( "Cannot load file {} : {}", file.getAbsolutePath(), e.getMessage()
);
+
+                    // Continue...
+                }
             }
         }
     }

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Serialize.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Serialize.java?rev=1681127&r1=1681126&r2=1681127&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Serialize.java
(original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Serialize.java
Fri May 22 14:25:14 2015
@@ -26,8 +26,8 @@ package org.apache.directory.api.util;
  */
 public class Serialize
 {
-    public final static byte TRUE = 0x01;
-    public final static byte FALSE = 0x00;
+    public static final byte TRUE = 0x01;
+    public static final byte FALSE = 0x00;
 
 
     /**



Mime
View raw message