directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1680515 - in /directory/shared/trunk: ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/certGeneration/ ldap/extras/codec/src/mai...
Date Wed, 20 May 2015 10:27:26 GMT
Author: elecharny
Date: Wed May 20 10:27:25 2015
New Revision: 1680515

URL: http://svn.apache.org/r1680515
Log:
Fixed the Sonar warnings ("Trailing comments")

Modified:
    directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyDnRequestDecorator.java
    directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/UnbindRequestDecorator.java
    directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/certGeneration/CertGenerationRequestImpl.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyTags.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewerTags.java
    directory/shared/trunk/ldap/extras/trigger/src/main/java/org/apache/directory/api/ldap/trigger/TriggerSpecificationParser.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/LdapSecurityConstants.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/LdapUriException.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/LdapResultImpl.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/AbstractSchemaParser.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/OpenLdapSchemaParser.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JpegSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Base64.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Hex.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Strings.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Unicode.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnicodeConstants.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnixCrypt.java

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyDnRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyDnRequestDecorator.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyDnRequestDecorator.java (original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/ModifyDnRequestDecorator.java Wed May 20 10:27:25 2015
@@ -239,9 +239,10 @@ public class ModifyDnRequestDecorator ex
     {
         int newRdnlength = Strings.getBytesUtf8( getNewRdn().getName() ).length;
 
+        // deleteOldRDN
         int modifyDNRequestLength = 1 + TLV.getNbBytes( Dn.getNbBytes( getName() ) )
             + Dn.getNbBytes( getName() ) + 1 + TLV.getNbBytes( newRdnlength ) + newRdnlength + 1 + 1
-            + 1; // deleteOldRDN
+            + 1;
 
         if ( getNewSuperior() != null )
         {

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=1680515&r1=1680514&r2=1680515&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 Wed May 20 10:27:25 2015
@@ -99,7 +99,8 @@ public class UnbindRequestDecorator exte
      */
     public int computeLength()
     {
-        return 2; // Always 2
+        // Always 2
+        return 2;
     }
 
 

Modified: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/certGeneration/CertGenerationRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/certGeneration/CertGenerationRequestImpl.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/certGeneration/CertGenerationRequestImpl.java (original)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/certGeneration/CertGenerationRequestImpl.java Wed May 20 10:27:25 2015
@@ -37,13 +37,13 @@ public class CertGenerationRequestImpl e
     private String targetDN;
 
     /** the issuer Dn that will be set in the certificate*/
-    private String issuerDN;// = "CN=ApacheDS, OU=Directory, O=ASF, C=US";
+    private String issuerDN;
 
     /** the Dn of the subject that is present in the certificate*/
-    private String subjectDN;// = "CN=ApacheDS, OU=Directory, O=ASF, C=US";
+    private String subjectDN;
 
     /** name of the algorithm used for generating the keys*/
-    private String keyAlgorithm;// = "RSA";
+    private String keyAlgorithm;
 
 
     /**

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.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/PasswordPolicyStates.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.java (original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyStates.java Wed May 20 10:27:25 2015
@@ -32,20 +32,13 @@ import org.apache.directory.api.asn1.ber
  */
 public enum PasswordPolicyStates implements States
 {
-
-    START_STATE, // 0
-
-    PPOLICY_SEQ_STATE, // 1
-
-    PPOLICY_WARNING_TAG_STATE, // 2
-
-    PPOLICY_TIME_BEFORE_EXPIRATION_STATE, // 3
-
-    PPOLICY_GRACE_AUTHNS_REMAINING_STATE, // 4
-
-    PPOLICY_ERROR_TAG_STATE, // 5
-
-    END_STATE; // 6
+    START_STATE,
+    PPOLICY_SEQ_STATE,
+    PPOLICY_WARNING_TAG_STATE,
+    PPOLICY_TIME_BEFORE_EXPIRATION_STATE,
+    PPOLICY_GRACE_AUTHNS_REMAINING_STATE,
+    PPOLICY_ERROR_TAG_STATE,
+    END_STATE;
 
     /**
      * {@inheritDoc}

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyTags.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/PasswordPolicyTags.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyTags.java (original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/ppolicy_impl/PasswordPolicyTags.java Wed May 20 10:27:25 2015
@@ -28,10 +28,14 @@ package org.apache.directory.api.ldap.ex
  */
 public enum PasswordPolicyTags
 {
-    PPOLICY_WARNING_TAG(0xA0), // warning [0]
-    PPOLICY_ERROR_TAG(0x81), // error [1]
-    TIME_BEFORE_EXPIRATION_TAG(0x80), // timeBeforeExpiration [0]
-    GRACE_AUTHNS_REMAINING_TAG(0x81); // graceAuthNsRemaining [1]
+    // warning [0]
+    PPOLICY_WARNING_TAG(0xA0),
+    // error [1]
+    PPOLICY_ERROR_TAG(0x81),
+    // timeBeforeExpiration [0]
+    TIME_BEFORE_EXPIRATION_TAG(0x80),
+    // graceAuthNsRemaining [1]
+    GRACE_AUTHNS_REMAINING_TAG(0x81);
 
     /** Internal value for each tag */
     private int value;

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewerTags.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/VirtualListViewerTags.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewerTags.java (original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/controls/vlv_impl/VirtualListViewerTags.java Wed May 20 10:27:25 2015
@@ -28,8 +28,10 @@ package org.apache.directory.api.ldap.ex
  */
 public enum VirtualListViewerTags
 {
-    BY_OFFSET_TAG(0xA0), // byOffset [0]
-    ASSERTION_VALUE_TAG(0x81); // greaterThanOrEqual [1]
+    // byOffset [0]
+    BY_OFFSET_TAG(0xA0),
+    // greaterThanOrEqual [1]
+    ASSERTION_VALUE_TAG(0x81);
 
     /** Internal value for each tag */
     private int value;

Modified: directory/shared/trunk/ldap/extras/trigger/src/main/java/org/apache/directory/api/ldap/trigger/TriggerSpecificationParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/trigger/src/main/java/org/apache/directory/api/ldap/trigger/TriggerSpecificationParser.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/trigger/src/main/java/org/apache/directory/api/ldap/trigger/TriggerSpecificationParser.java (original)
+++ directory/shared/trunk/ldap/extras/trigger/src/main/java/org/apache/directory/api/ldap/trigger/TriggerSpecificationParser.java Wed May 20 10:27:25 2015
@@ -58,8 +58,9 @@ public class TriggerSpecificationParser
         this.lexer = new ReusableAntlrTriggerSpecificationLexer( new StringReader( "" ) );
         this.parser = new ReusableAntlrTriggerSpecificationParser( lexer );
 
-        this.parser.init(); // this method MUST be called while we cannot do
+        // this method MUST be called while we cannot do
         // constructor overloading for antlr generated parser
+        this.parser.init();
         this.isNormalizing = false;
     }
 
@@ -75,8 +76,9 @@ public class TriggerSpecificationParser
         this.parser = new ReusableAntlrTriggerSpecificationParser( lexer );
 
         this.parser.setNormalizerMappingResolver( resolver );
-        this.parser.init(); // this method MUST be called while we cannot do
+        // this method MUST be called while we cannot do
         // constructor overloading for ANTLR generated parser
+        this.parser.init();
         this.isNormalizing = true;
     }
 
@@ -114,7 +116,8 @@ public class TriggerSpecificationParser
             return null;
         }
 
-        reset( spec ); // reset and initialize the parser / lexer pair
+        // reset and initialize the parser / lexer pair
+        reset( spec );
 
         try
         {

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/LdapSecurityConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/LdapSecurityConstants.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/LdapSecurityConstants.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/LdapSecurityConstants.java Wed May 20 10:27:25 2015
@@ -169,14 +169,16 @@ public enum LdapSecurityConstants
 
         if ( ( HASH_METHOD_SHA256.name.equalsIgnoreCase( algorithm ) )
             || ( HASH_METHOD_SHA256.prefix.equalsIgnoreCase( algorithm ) )
-            || ( "sha-256".equalsIgnoreCase( algorithm ) ) ) // "sha-256" used for backwards compatibility
+            // "sha-256" used for backwards compatibility
+            || ( "sha-256".equalsIgnoreCase( algorithm ) ) )
         {
             return HASH_METHOD_SHA256;
         }
 
         if ( ( HASH_METHOD_SSHA256.name.equalsIgnoreCase( algorithm ) )
             || ( HASH_METHOD_SSHA256.prefix.equalsIgnoreCase( algorithm ) )
-            || ( "ssha-256".equalsIgnoreCase( algorithm ) ) ) // "ssha-256" used for backwards compatibility
+            // "ssha-256" used for backwards compatibility
+            || ( "ssha-256".equalsIgnoreCase( algorithm ) ) )
         {
             return HASH_METHOD_SSHA256;
         }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/cursor/SetCursor.java Wed May 20 10:27:25 2015
@@ -54,6 +54,9 @@ public class SetCursor<E> extends Abstra
     /** The current position in the list */
     private int index = -1;
 
+    /** A limit to what we can print */
+    private static final int MAX_PRINTED_ELEMENT = 100;
+
 
     /**
      * Creates a new SetCursor.
@@ -430,14 +433,15 @@ public class SetCursor<E> extends Abstra
         {
             sb.append( tabs ).append( "    Size : " ).append( set.length ).append( "\n" );
 
-            int counter = 0; // Don't print more than 100 elements...
+            // Don't print more than 100 elements...
+            int counter = 0;
 
             for ( E e : set )
             {
                 sb.append( tabs ).append( "    " ).append( e ).append( "\n" );
                 counter++;
 
-                if ( counter == 100 )
+                if ( counter == MAX_PRINTED_ELEMENT )
                 {
                     break;
                 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java Wed May 20 10:27:25 2015
@@ -1052,7 +1052,8 @@ public final class DefaultEntry implemen
             DefaultEntry clone = ( DefaultEntry ) super.clone();
 
             // An Entry has a Dn and many attributes.
-            clone.dn = dn; // note that Dn is immutable now
+            // note that Dn is immutable now
+            clone.dn = dn;
 
             // then clone the ClientAttribute Map.
             clone.attributes = ( Map<String, Attribute> ) ( ( ( HashMap<String, Attribute> ) attributes )

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java Wed May 20 10:27:25 2015
@@ -582,8 +582,9 @@ public class StringValue extends Abstrac
     public int serialize( byte[] buffer, int pos )
     {
         // Compute the length
-        int length = 1 + 1 + 1 + 4; // The value type, the wrappedValue presence flag,
-                                    // the normalizedValue presence flag and the hash length.
+        // The value type, the wrappedValue presence flag,
+        // the normalizedValue presence flag and the hash length.
+        int length = 1 + 1 + 1 + 4;
 
         byte[] wrappedValueBytes = null;
         byte[] normalizedValueBytes = null;

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/LdapUriException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/LdapUriException.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/LdapUriException.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/LdapUriException.java Wed May 20 10:27:25 2015
@@ -38,7 +38,8 @@ public class LdapUriException extends Ld
      */
     public LdapUriException( String reason, Throwable cause )
     {
-        super( reason, cause ); // for backward compatibility of Throwable
+        // for backward compatibility of Throwable
+        super( reason, cause );
         this.reason = reason;
         this.reasonCode = UNKNOWN;
     }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java Wed May 20 10:27:25 2015
@@ -114,7 +114,8 @@ public class LdifEntry implements Clonea
      */
     public LdifEntry()
     {
-        changeType = ChangeType.None; // Default LDIF content
+        // Default LDIF content
+        changeType = ChangeType.None;
         modificationList = new LinkedList<Modification>();
         modifications = new HashMap<String, Modification>();
         entry = new DefaultEntry( ( Dn ) null );
@@ -128,7 +129,8 @@ public class LdifEntry implements Clonea
      */
     public LdifEntry( SchemaManager schemaManager )
     {
-        changeType = ChangeType.None; // Default LDIF content
+        // Default LDIF content
+        changeType = ChangeType.None;
         modificationList = new LinkedList<Modification>();
         modifications = new HashMap<String, Modification>();
         entry = new DefaultEntry( schemaManager, ( Dn ) null );
@@ -142,7 +144,8 @@ public class LdifEntry implements Clonea
      */
     public LdifEntry( Entry entry )
     {
-        changeType = ChangeType.None; // Default LDIF content
+        // Default LDIF content
+        changeType = ChangeType.None;
         modificationList = new LinkedList<Modification>();
         modifications = new HashMap<String, Modification>();
         this.entry = entry;
@@ -1032,7 +1035,8 @@ public class LdifEntry implements Clonea
                     break;
 
                 default:
-                    break; // do nothing
+                    // do nothing
+                    break;
             }
         }
 
@@ -1193,7 +1197,8 @@ public class LdifEntry implements Clonea
                 break;
 
             default:
-                break; // do nothing
+                // do nothing
+                break;
         }
 
         if ( controls != null )

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java Wed May 20 10:27:25 2015
@@ -1338,7 +1338,9 @@ public class LdifReader implements Itera
                 parseModify( entry, iter );
                 return;
 
-            case ModDn:// They are supposed to have the same syntax ???
+            case ModDn:
+                // They are supposed to have the same syntax :
+                // No break !
             case ModRdn:
                 // First, parse the modrdn part
                 parseModRdn( entry, iter );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.java Wed May 20 10:27:25 2015
@@ -226,7 +226,8 @@ public final class LdifRevertor
                     break;
 
                 default:
-                    break; // Do nothing
+                    // Do nothing
+                    break;
 
             }
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java Wed May 20 10:27:25 2015
@@ -67,12 +67,18 @@ public final class LdifUtils
             LDIF_SAFE_STARTING_CHAR_ALPHABET[i] = true;
         }
 
-        LDIF_SAFE_STARTING_CHAR_ALPHABET[0] = false; // 0 (NUL)
-        LDIF_SAFE_STARTING_CHAR_ALPHABET[10] = false; // 10 (LF)
-        LDIF_SAFE_STARTING_CHAR_ALPHABET[13] = false; // 13 (CR)
-        LDIF_SAFE_STARTING_CHAR_ALPHABET[32] = false; // 32 (SPACE)
-        LDIF_SAFE_STARTING_CHAR_ALPHABET[58] = false; // 58 (:)
-        LDIF_SAFE_STARTING_CHAR_ALPHABET[60] = false; // 60 (>)
+        // 0 (NUL)
+        LDIF_SAFE_STARTING_CHAR_ALPHABET[0] = false;
+        // 10 (LF)
+        LDIF_SAFE_STARTING_CHAR_ALPHABET[10] = false;
+        // 13 (CR)
+        LDIF_SAFE_STARTING_CHAR_ALPHABET[13] = false;
+        // 32 (SPACE)
+        LDIF_SAFE_STARTING_CHAR_ALPHABET[32] = false;
+        // 58 (:)
+        LDIF_SAFE_STARTING_CHAR_ALPHABET[58] = false;
+        // 60 (>)
+        LDIF_SAFE_STARTING_CHAR_ALPHABET[60] = false;
 
         // Initialization of the array that will be used to match the other chars.
         for ( int i = 0; i < 128; i++ )
@@ -80,9 +86,12 @@ public final class LdifUtils
             LDIF_SAFE_OTHER_CHARS_ALPHABET[i] = true;
         }
 
-        LDIF_SAFE_OTHER_CHARS_ALPHABET[0] = false; // 0 (NUL)
-        LDIF_SAFE_OTHER_CHARS_ALPHABET[10] = false; // 10 (LF)
-        LDIF_SAFE_OTHER_CHARS_ALPHABET[13] = false; // 13 (CR)
+        // 0 (NUL)
+        LDIF_SAFE_OTHER_CHARS_ALPHABET[0] = false;
+        // 10 (LF)
+        LDIF_SAFE_OTHER_CHARS_ALPHABET[10] = false;
+        // 13 (CR)
+        LDIF_SAFE_OTHER_CHARS_ALPHABET[13] = false;
     }
 
 
@@ -273,9 +282,9 @@ public final class LdifUtils
         try
         {
             Attributes attributes = AttributeUtils.toAttributes( reader.parseEntry( ldif ) );
-            
+
             reader.close();
-            
+
             return attributes;
         }
         catch ( IOException ioe )
@@ -739,7 +748,7 @@ public final class LdifUtils
 
         LdifAttributesReader reader = new LdifAttributesReader();
         Attributes attributes = AttributeUtils.toAttributes( reader.parseEntry( sb.toString() ) );
-        
+
         try
         {
             reader.close();

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/LdapResultImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/LdapResultImpl.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/LdapResultImpl.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/LdapResultImpl.java Wed May 20 10:27:25 2015
@@ -241,7 +241,8 @@ public class LdapResultImpl implements L
                 return false;
             }
         }
-        else if ( result.getMatchedDn() != null ) // one is null other is not
+        // one is null other is not
+        else if ( result.getMatchedDn() != null )
         {
             return false;
         }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java Wed May 20 10:27:25 2015
@@ -82,7 +82,7 @@ import org.apache.directory.api.util.Str
 
         Position pos = new Position();
         char[] chars = name.toCharArray();
-            
+
         pos.start = 0;
         pos.length = chars.length;
 
@@ -97,9 +97,9 @@ import org.apache.directory.api.util.Str
                 // end of line reached
                 break;
             }
-            
+
             char c = nextChar( chars, pos, true );
-            
+
             switch ( c )
             {
                 case ',':
@@ -129,7 +129,7 @@ import org.apache.directory.api.util.Str
         {
             throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04193 ) );
         }
-        
+
         if ( rdn == null )
         {
             throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04194 ) );
@@ -195,7 +195,7 @@ import org.apache.directory.api.util.Str
         while ( hasMoreChars( pos ) )
         {
             char c = nextChar( name, pos, true );
-            
+
             if ( c != ' ' )
             {
                 pos.start--;
@@ -218,7 +218,7 @@ import org.apache.directory.api.util.Str
     private static String matchAttributeType( char[] name, Position pos ) throws LdapInvalidDnException
     {
         char c = nextChar( name, pos, false );
-        
+
         switch ( c )
         {
             case 'A':
@@ -310,11 +310,11 @@ import org.apache.directory.api.util.Str
     private static String matchAttributeTypeDescr( char[] name, Position pos ) throws LdapInvalidDnException
     {
         int start = pos.start;
-        
+
         while ( hasMoreChars( pos ) )
         {
             char c = nextChar( name, pos, true );
-            
+
             switch ( c )
             {
                 case 'A':
@@ -380,7 +380,8 @@ import org.apache.directory.api.util.Str
                 case '8':
                 case '9':
                 case '-':
-                case '_': // Violation of the RFC, just because those idiots at Microsoft decided to support it...
+                case '_':
+                    // Violation of the RFC, just because those idiots at Microsoft decided to support it...
                     break;
 
                 case ' ':
@@ -398,7 +399,7 @@ import org.apache.directory.api.util.Str
                         pos.start ) );
             }
         }
-        
+
         return new String( name, start, pos.start - start );
     }
 
@@ -417,33 +418,33 @@ import org.apache.directory.api.util.Str
     {
         int dotCount = 0;
         int start = pos.start;
-        
+
         while ( true )
         {
             char c = nextChar( name, pos, true );
-            
+
             switch ( c )
             {
                 case '0':
                     // leading '0', no other digit may follow!
                     c = nextChar( name, pos, true );
-                    
+
                     switch ( c )
                     {
                         case '.':
                             dotCount++;
                             break;
-                            
+
                         case ' ':
                         case '=':
                             pos.start--;
                             break;
-                            
+
                         default:
                             throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err(
                                 I18n.ERR_04197, c, pos.start ) );
                     }
-                    
+
                     break;
 
                 case '1':
@@ -456,11 +457,11 @@ import org.apache.directory.api.util.Str
                 case '8':
                 case '9':
                     boolean inInnerLoop = true;
-                    
+
                     while ( inInnerLoop )
                     {
                         c = nextChar( name, pos, true );
-                        
+
                         switch ( c )
                         {
                             case ' ':
@@ -468,7 +469,7 @@ import org.apache.directory.api.util.Str
                                 inInnerLoop = false;
                                 pos.start--;
                                 break;
-                                
+
                             case '.':
                                 inInnerLoop = false;
                                 dotCount++;
@@ -484,19 +485,19 @@ import org.apache.directory.api.util.Str
                             case '8':
                             case '9':
                                 break;
-                                
+
                             default:
                                 throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err(
                                     I18n.ERR_04197, c, pos.start ) );
                         }
                     }
-                    
+
                     break;
-                    
+
                 case ' ':
                 case '=':
                     pos.start--;
-                    
+
                     if ( dotCount > 0 )
                     {
                         return new String( name, start, pos.start - start );
@@ -505,7 +506,7 @@ import org.apache.directory.api.util.Str
                     {
                         throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04198 ) );
                     }
-                    
+
                 default:
                     throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04199, c,
                         pos.start ) );
@@ -525,7 +526,7 @@ import org.apache.directory.api.util.Str
     private static void matchEquals( char[] name, Position pos ) throws LdapInvalidDnException
     {
         char c = nextChar( name, pos, true );
-        
+
         if ( c != '=' )
         {
             throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04200, c, pos.start ) );
@@ -550,7 +551,7 @@ import org.apache.directory.api.util.Str
         //StringBuilder value = new StringBuilder();
         int start = pos.start;
         int numTrailingSpaces = 0;
-        
+
         while ( true )
         {
             if ( !hasMoreChars( pos ) )
@@ -558,9 +559,9 @@ import org.apache.directory.api.util.Str
                 pos.start -= numTrailingSpaces;
                 return new String( name, start, pos.start - start );
             }
-            
+
             char c = nextChar( name, pos, true );
-            
+
             switch ( c )
             {
                 case '\\':
@@ -568,17 +569,17 @@ import org.apache.directory.api.util.Str
                 case '#':
                 case '"':
                     throw TooComplexDnException.INSTANCE;
-                    
+
                 case ',':
                 case ';':
                     pos.start--;
                     pos.start -= numTrailingSpaces;
                     return new String( name, start, pos.start - start );
-                    
+
                 case ' ':
                     numTrailingSpaces++;
                     break;
-                    
+
                 default:
                     numTrailingSpaces = 0;
             }
@@ -602,14 +603,14 @@ import org.apache.directory.api.util.Str
         {
             throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04201, pos.start ) );
         }
-        
-        char c = name[ pos.start ];
-        
+
+        char c = name[pos.start];
+
         if ( increment )
         {
             pos.start++;
         }
-        
+
         return c;
     }
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java Wed May 20 10:27:25 2015
@@ -1544,7 +1544,8 @@ public class Rdn implements Cloneable, E
      */
     public int serialize( byte[] buffer, int pos ) throws IOException
     {
-        int length = 4 + 4; // The nbAvas and the HashCode length
+        // The nbAvas and the HashCode length
+        int length = 4 + 4;
 
         // The NnbAvas
         pos = Serialize.serialize( nbAvas, buffer, pos );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/password/PasswordUtil.java Wed May 20 10:27:25 2015
@@ -150,12 +150,14 @@ public class PasswordUtil
             case HASH_METHOD_SSHA384:
             case HASH_METHOD_SSHA512:
             case HASH_METHOD_SMD5:
-                salt = new byte[8]; // we use 8 byte salt always except for "crypt" which needs 2 byte salt
+                // we use 8 byte salt always except for "crypt" which needs 2 byte salt
+                salt = new byte[8];
                 new SecureRandom().nextBytes( salt );
                 break;
 
             case HASH_METHOD_PKCS5S2:
-                salt = new byte[16]; // we use 16 byte salt for PKCS5S2
+                // we use 16 byte salt for PKCS5S2
+                salt = new byte[16];
                 new SecureRandom().nextBytes( salt );
                 break;
 
@@ -513,7 +515,8 @@ public class PasswordUtil
     {
         Date pwdChangeDate = DateUtils.getDate( pwdChangedZtime );
 
-        long time = pwdMaxAgeSec * 1000L;//DIRSERVER-1735
+        //DIRSERVER-1735
+        long time = pwdMaxAgeSec * 1000L;
         time += pwdChangeDate.getTime();
 
         Date expiryDate = DateUtils.getDate( DateUtils.getGeneralizedTime( time ) );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/AbstractSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/AbstractSchemaParser.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/AbstractSchemaParser.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/AbstractSchemaParser.java Wed May 20 10:27:25 2015
@@ -74,7 +74,8 @@ public abstract class AbstractSchemaPars
      * @param errorCodeOnParseExceptionWithPosition error code used on parse error when position is known
      * @param errorCodeOnParseException error code used on parse error when position is unknown
      */
-    protected AbstractSchemaParser( Class<T> schemaObjectType, I18n errorCodeOnNull, I18n errorCodeOnParseExceptionWithPosition,
+    protected AbstractSchemaParser( Class<T> schemaObjectType, I18n errorCodeOnNull,
+        I18n errorCodeOnParseExceptionWithPosition,
         I18n errorCodeOnParseException )
     {
         this.schemaObjectType = schemaObjectType;
@@ -154,7 +155,8 @@ public abstract class AbstractSchemaPars
             throw new ParseException( "Null", 0 );
         }
 
-        reset( schemaDescription ); // reset and initialize the parser / lexer pair
+        // reset and initialize the parser / lexer pair
+        reset( schemaDescription );
 
         try
         {

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/OpenLdapSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/OpenLdapSchemaParser.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/OpenLdapSchemaParser.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/parsers/OpenLdapSchemaParser.java Wed May 20 10:27:25 2015
@@ -259,7 +259,8 @@ public class OpenLdapSchemaParser extend
             throw new ParseException( I18n.err( I18n.ERR_04258 ), 0 );
         }
 
-        reset( schemaObject ); // reset and initialize the parser / lexer pair
+        // reset and initialize the parser / lexer pair
+        reset( schemaObject );
         invokeParser( schemaObject );
 
         if ( !schemaDescriptions.isEmpty() )

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java Wed May 20 10:27:25 2015
@@ -75,16 +75,24 @@ public class GeneralizedTimeSyntaxChecke
 
     /** The GeneralizedDate pattern matching */
     private static final String GENERALIZED_TIME_PATTERN =
-        "^\\d{4}" // century + year : 0000 to 9999
-            + "(0[1-9]|1[0-2])" // month : 01 to 12
-            + "(0[1-9]|[12]\\d|3[01])" // day : 01 to 31
-            + "([01]\\d|2[0-3])" // hour : 00 to 23
+        // century + year : 0000 to 9999
+        "^\\d{4}"
+            // month : 01 to 12
+            + "(0[1-9]|1[0-2])"
+            // day : 01 to 31
+            + "(0[1-9]|[12]\\d|3[01])"
+            // hour : 00 to 23
+            + "([01]\\d|2[0-3])"
             + "("
-            + "([0-5]\\d)" // optional minute : 00 to 59
-            + "([0-5]\\d|60)?" // optional second | leap second
+            // optional minute : 00 to 59
+            + "([0-5]\\d)"
+            // optional second | leap second
+            + "([0-5]\\d|60)?"
             + ")?"
-            + "([.,]\\d+)?" // fraction       
-            + "(Z|[+-]([01]\\d|2[0-3])([0-5]\\d)?)$"; // time-zone
+            // fraction
+            + "([.,]\\d+)?"
+            // time-zone
+            + "(Z|[+-]([01]\\d|2[0-3])([0-5]\\d)?)$";
 
     /** The date pattern. The regexp pattern is immutable, only one instance needed. */
     private static final Pattern DATE_PATTERN = Pattern.compile( GENERALIZED_TIME_PATTERN );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JpegSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JpegSyntaxChecker.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JpegSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/JpegSyntaxChecker.java Wed May 20 10:27:25 2015
@@ -47,6 +47,7 @@ public class JpegSyntaxChecker extends S
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( JpegSyntaxChecker.class );
 
+
     /**
      * Creates a new instance of JpegSyntaxChecker.
      */
@@ -83,31 +84,32 @@ public class JpegSyntaxChecker extends S
             return false;
         }
 
-        if ( ( bytes[0] == ( byte ) 0x00FF ) // SOI
+        // SOI or APP0 or APP1 format
+        if ( ( bytes[0] == ( byte ) 0x00FF )
             && ( bytes[1] == ( byte ) 0x00D8 )
-            && ( bytes[2] == ( byte ) 0x00FF ) ) // APP0 or APP1
+            && ( bytes[2] == ( byte ) 0x00FF ) )
         {
-            if ( bytes[3] == (byte)0x00E0 )
+            if ( bytes[3] == ( byte ) 0x00E0 )
             {
                 // JFIF format
-                if ( ( bytes[6] == 'J' ) // JFIF
-                    && ( bytes[7] == 'F' ) // JFIF
-                    && ( bytes[8] == 'I' ) // JFIF
+                if ( ( bytes[6] == 'J' )
+                    && ( bytes[7] == 'F' )
+                    && ( bytes[8] == 'I' )
                     && ( bytes[9] == 'F' )
-                    && ( bytes[10] == 0x00 ) ) // \0
+                    && ( bytes[10] == 0x00 ) )
                 {
                     LOG.debug( "Syntax valid for '{}'", value );
                     return true;
                 }
             }
-            else if ( bytes[3] == (byte)0x00E1 )
+            else if ( bytes[3] == ( byte ) 0x00E1 )
             {
                 // Exif format
-                if ( ( bytes[6] == 'E' )   // Exif
-                    && ( bytes[7] == 'x' ) // Exif
-                    && ( bytes[8] == 'i' ) // Exif
-                    && ( bytes[9] == 'f' ) // Exif
-                    && ( bytes[10] == 0x00 ) ) // \0
+                if ( ( bytes[6] == 'E' )
+                    && ( bytes[7] == 'x' )
+                    && ( bytes[8] == 'i' )
+                    && ( bytes[9] == 'f' )
+                    && ( bytes[10] == 0x00 ) )
                 {
                     LOG.debug( "Syntax valid for '{}'", value );
                     return true;

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java Wed May 20 10:27:25 2015
@@ -69,14 +69,21 @@ public class UtcTimeSyntaxChecker extend
 
     /** The GeneralizedDate pattern matching */
     private static final String UTC_TIME_PATTERN =
-        "^\\d{2}" // year : 00 to 99
-            + "(0[1-9]|1[0-2])" // month : 01 to 12
-            + "(0[1-9]|[12]\\d|3[01])" // day : 01 to 31
-            + "([01]\\d|2[0-3])" // hour: 00 to 23
-            + "([0-5]\\d)" // minute : 00 to 59
+        // year : 00 to 99
+        "^\\d{2}"
+            // month : 01 to 12
+            + "(0[1-9]|1[0-2])"
+            // day : 01 to 31
+            + "(0[1-9]|[12]\\d|3[01])"
+            // hour: 00 to 23
+            + "([01]\\d|2[0-3])"
+            // minute : 00 to 59
+            + "([0-5]\\d)"
             + "("
-            + "([0-5]\\d)?" // optional second : 00 to 59
-            + "(Z|([+-]([01]\\d|2[0-3])[0-5]\\d))?" // optionnal time-zone
+            // optional second : 00 to 59
+            + "([0-5]\\d)?"
+            // optional time-zone
+            + "(Z|([+-]([01]\\d|2[0-3])[0-5]\\d))?"
             + ")$";
 
     // The regexp pattern, java.util.regex.Pattern is immutable so only one instance is needed.

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java Wed May 20 10:27:25 2015
@@ -54,12 +54,14 @@ public class SubtreeSpecificationChecker
      */
     public SubtreeSpecificationChecker( SchemaManager schemaManager )
     {
-        StringReader in = new StringReader( "" ); // place holder for the
-                                                  // first input
+        // place holder for the first input
+        StringReader in = new StringReader( "" );
         this.lexer = new ReusableAntlrSubtreeSpecificationCheckerLexer( in );
         this.parser = new ReusableAntlrSubtreeSpecificationChecker( lexer );
-        this.parser.init( schemaManager ); // this method MUST be called while we cannot do
+
+        // this method MUST be called while we cannot do
         // constructor overloading for antlr generated parser
+        this.parser.init( schemaManager );
     }
 
 
@@ -69,8 +71,8 @@ public class SubtreeSpecificationChecker
      */
     private synchronized void reset( String spec )
     {
-        StringReader in = new StringReader( spec + "end" ); // append end of
-                                                            // input token
+        // append end of input token
+        StringReader in = new StringReader( spec + "end" );
         this.lexer.prepareNextInput( in );
         this.parser.resetState();
     }
@@ -91,7 +93,8 @@ public class SubtreeSpecificationChecker
             return;
         }
 
-        reset( spec ); // reset and initialize the parser / lexer pair
+        // reset and initialize the parser / lexer pair
+        reset( spec );
 
         try
         {

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java Wed May 20 10:27:25 2015
@@ -57,12 +57,13 @@ public class SubtreeSpecificationParser
      */
     public SubtreeSpecificationParser( SchemaManager schemaManager )
     {
-        StringReader in = new StringReader( "" ); // place holder for the
-                                                  // first input
+        // place holder for the first input
+        StringReader in = new StringReader( "" );
         this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in );
         this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer );
-        this.parser.init( schemaManager ); // this method MUST be called while we cannot do
+        // this method MUST be called while we cannot do
         // constructor overloading for antlr generated parser
+        this.parser.init( schemaManager );
         this.isNormalizing = false;
     }
 
@@ -73,13 +74,14 @@ public class SubtreeSpecificationParser
     public SubtreeSpecificationParser( @SuppressWarnings("rawtypes") NormalizerMappingResolver resolver,
         SchemaManager schemaManager )
     {
-        StringReader in = new StringReader( "" ); // place holder for the
-                                                  // first input
+        // place holder for the first input
+        StringReader in = new StringReader( "" );
         this.lexer = new ReusableAntlrSubtreeSpecificationLexer( in );
         this.parser = new ReusableAntlrSubtreeSpecificationParser( lexer );
         this.parser.setNormalizerMappingResolver( resolver );
-        this.parser.init( schemaManager ); // this method MUST be called while we cannot do
+        // this method MUST be called while we cannot do
         // constructor overloading for antlr generated parser
+        this.parser.init( schemaManager );
         this.isNormalizing = true;
     }
 
@@ -90,8 +92,8 @@ public class SubtreeSpecificationParser
      */
     private synchronized void reset( String spec )
     {
-        StringReader in = new StringReader( spec + "end" ); // append end of
-                                                            // input token
+        // append end of input token
+        StringReader in = new StringReader( spec + "end" );
         this.lexer.prepareNextInput( in );
         this.parser.resetState();
     }
@@ -115,7 +117,8 @@ public class SubtreeSpecificationParser
             return null;
         }
 
-        reset( spec ); // reset and initialize the parser / lexer pair
+        // reset and initialize the parser / lexer pair
+        reset( spec );
 
         try
         {

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Base64.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Base64.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Base64.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Base64.java Wed May 20 10:27:25 2015
@@ -114,7 +114,8 @@ public final class Base64
         {
             if ( ( c > 255 ) || CODES[c] < 0 )
             {
-                --tempLen; // ignore non-valid chars and padding
+                // ignore non-valid chars and padding
+                --tempLen;
             }
         }
         // calculate required length:
@@ -136,8 +137,9 @@ public final class Base64
 
         byte[] out = new byte[len];
 
-        int shift = 0; // # of excess bits stored in accum
-        int accum = 0; // excess bits
+        // # of excess bits stored in accum excess bits
+        int shift = 0;
+        int accum = 0;
         int index = 0;
 
         // we now go through the entire array (NOT using the 'tempLen' value)
@@ -145,27 +147,30 @@ public final class Base64
         {
             int value = ( c > 255 ) ? -1 : CODES[c];
 
-            if ( value >= 0 ) // skip over non-code
+            // skip over non-code bits 
+            if ( value >= 0 )
             {
-                accum <<= 6; // bits shift up by 6 each time thru
-                shift += 6; // loop, with new bits being put in
-                accum |= value; // at the bottom. whenever there
-                if ( shift >= 8 ) // are 8 or more shifted in, write them
+                // shift up by 6 each time thru
+                // loop, with new bits being put in
+                // at the bottom. whenever there
+                // are 8 or more shifted in, write them
+                // out (from the top, leaving any excess
+                // at the bottom for next iteration.
+                accum <<= 6;
+                shift += 6;
+                accum |= value;
+
+                if ( shift >= 8 )
                 {
-                    shift -= 8; // out (from the top, leaving any excess
-                    out[index++] = // at the bottom for next iteration.
-                    ( byte ) ( ( accum >> shift ) & 0xff );
+                    shift -= 8;
+                    out[index++] = ( byte ) ( ( accum >> shift ) & 0xff );
                 }
             }
-            // we will also have skipped processing a padding null byte ('=')
-            // here;
-            // these are used ONLY for padding to an even length and do not
-            // legally
+            // we will also have skipped processing a padding null byte ('=') here;
+            // these are used ONLY for padding to an even length and do not legally
             // occur as encoded data. for this reason we can ignore the fact
-            // that
-            // no index++ operation occurs in that special case: the out[] array
-            // is
-            // initialized to all-zero bytes to start with and that works to our
+            // that no index++ operation occurs in that special case: the out[] array
+            // is initialized to all-zero bytes to start with and that works to our
             // advantage in this combination.
         }
 

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java Wed May 20 10:27:25 2015
@@ -93,7 +93,7 @@ public class DummySSLSocketFactory exten
             };
             TrustManager[] tma =
                 { tm };
-            SSLContext sc = SSLContext.getInstance( "TLS" ); //$NON-NLS-1$
+            SSLContext sc = SSLContext.getInstance( "TLS" );
             sc.init( null, tma, new SecureRandom() );
             delegate = sc.getSocketFactory();
         }

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Hex.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Hex.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Hex.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Hex.java Wed May 20 10:27:25 2015
@@ -37,119 +37,22 @@ public class Hex
     /** &lt;hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66] */
     public static final byte[] HEX_VALUE =
         {
-            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00 -> 0F
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1, // 10 -> 1F
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1, // 20 -> 2F
-            0,
-            1,
-            2,
-            3,
-            4,
-            5,
-            6,
-            7,
-            8,
-            9,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1, // 30 -> 3F ( 0, 1,2, 3, 4,5, 6, 7, 8, 9 )
-            -1,
-            10,
-            11,
-            12,
-            13,
-            14,
-            15,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1, // 40 -> 4F ( A, B, C, D, E, F )
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1, // 50 -> 5F
-            -1,
-            10,
-            11,
-            12,
-            13,
-            14,
-            15,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1, // 60 -> 6F ( a, b, c, d, e, f )
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1,
-            -1 // 70 -> 7F
+            // 00 -> 0F
+            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+            // 10 -> 1F
+            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+            // 20 -> 2F
+            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+            // 30 -> 3F ( 0, 1,2, 3, 4,5, 6, 7, 8, 9 )
+             0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, 
+             // 40 -> 4F ( A, B, C, D, E, F )
+            -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+            // 50 -> 5F
+            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+            // 60 -> 6F ( a, b, c, d, e, f )
+            -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+            // 70 -> 7F
+            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
     };
 
     /** Used to build output as Hex */

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Strings.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Strings.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Strings.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Strings.java Wed May 20 10:27:25 2015
@@ -63,22 +63,38 @@ public final class Strings
     /** A table containing booleans when the corresponding char is printable */
     public static final boolean[] IS_PRINTABLE_CHAR =
         {
-            false, false, false, false, false, false, false, false, // ---, ---, ---, ---, ---, ---, ---, ---
-            false, false, false, false, false, false, false, false, // ---, ---, ---, ---, ---, ---, ---, ---
-            false, false, false, false, false, false, false, false, // ---, ---, ---, ---, ---, ---, ---, ---
-            false, false, false, false, false, false, false, false, // ---, ---, ---, ---, ---, ---, ---, ---
-            true,  false, false, false, false, false, false, true,  // ' ', ---, ---, ---, ---, ---, ---, "'"
-            true,  true,  false, true,  true,  true,  true,  true,  // '(', ')', ---, '+', ',', '-', '.', '/'
-            true,  true,  true,  true,  true,  true,  true,  true,  // '0', '1', '2', '3', '4', '5', '6', '7',
-            true,  true,  true,  false, false, true,  false, true,  // '8', '9', ':', ---, ---, '=', ---, '?'
-            false, true,  true,  true,  true,  true,  true,  true,  // ---, 'A', 'B', 'C', 'D', 'E', 'F', 'G',
-            true,  true,  true,  true,  true,  true,  true,  true,  // 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O'
-            true,  true,  true,  true,  true,  true,  true,  true,  // 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W'
-            true,  true,  true,  false, false, false, false, false, // 'X', 'Y', 'Z', ---, ---, ---, ---, ---
-            false, true,  true,  true,  true,  true,  true,  true,  // ---, 'a', 'b', 'c', 'd', 'e', 'f', 'g'
-            true,  true,  true,  true,  true,  true,  true,  true,  // 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o'
-            true,  true,  true,  true,  true,  true,  true,  true,  // 'p', 'q', 'r', 's', 't', 'u', 'v', 'w'
-            true,  true,  true,  false, false, false, false, false // 'x', 'y', 'z', ---, ---, ---, ---, ---
+            // ---, ---, ---, ---, ---, ---, ---, ---
+            false, false, false, false, false, false, false, false, 
+            // ---, ---, ---, ---, ---, ---, ---, ---
+            false, false, false, false, false, false, false, false, 
+            // ---, ---, ---, ---, ---, ---, ---, ---
+            false, false, false, false, false, false, false, false, 
+            // ---, ---, ---, ---, ---, ---, ---, ---
+            false, false, false, false, false, false, false, false, 
+            // ' ', ---, ---, ---, ---, ---, ---, "'"
+            true,  false, false, false, false, false, false, true,  
+            // '(', ')', ---, '+', ',', '-', '.', '/'
+            true,  true,  false, true,  true,  true,  true,  true,  
+            // '0', '1', '2', '3', '4', '5', '6', '7',
+            true,  true,  true,  true,  true,  true,  true,  true,  
+            // '8', '9', ':', ---, ---, '=', ---, '?'
+            true,  true,  true,  false, false, true,  false, true,  
+            // ---, 'A', 'B', 'C', 'D', 'E', 'F', 'G',
+            false, true,  true,  true,  true,  true,  true,  true,  
+            // 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O'
+            true,  true,  true,  true,  true,  true,  true,  true,  
+            // 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W'
+            true,  true,  true,  true,  true,  true,  true,  true,  
+            // 'X', 'Y', 'Z', ---, ---, ---, ---, ---
+            true,  true,  true,  false, false, false, false, false, 
+            // ---, 'a', 'b', 'c', 'd', 'e', 'f', 'g'
+            false, true,  true,  true,  true,  true,  true,  true,  
+            // 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o'
+            true,  true,  true,  true,  true,  true,  true,  true,  
+            // 'p', 'q', 'r', 's', 't', 'u', 'v', 'w'
+            true,  true,  true,  true,  true,  true,  true,  true, 
+            // 'x', 'y', 'z', ---, ---, ---, ---, ---
+            true,  true,  true,  false, false, false, false, false 
     };
 
     public static final char[] TO_LOWER_CASE =

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Unicode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Unicode.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Unicode.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/Unicode.java Wed May 20 10:27:25 2015
@@ -120,56 +120,33 @@ public final class Unicode
             if ( ( bytes[pos] & UnicodeConstants.UTF8_TWO_BYTES_MASK ) == UnicodeConstants.UTF8_TWO_BYTES )
             {
                 // Two bytes char
-                return ( char ) ( ( ( bytes[pos] & 0x1C ) << 6 ) + // 110x-xxyy
-                                                                   // 10zz-zzzz
-                                                                   // ->
-                                                                   // 0000-0xxx
-                                                                   // 0000-0000
-                    ( ( bytes[pos] & 0x03 ) << 6 ) + // 110x-xxyy 10zz-zzzz
-                                                     // -> 0000-0000
-                                                     // yy00-0000
-                ( bytes[pos + 1] & 0x3F ) // 110x-xxyy 10zz-zzzz -> 0000-0000
-                                          // 00zz-zzzz
-                ); // -> 0000-0xxx yyzz-zzzz (07FF)
+                // 110x-xxyy 10zz-zzzz -> 0000-0xxx yyzz-zzzz
+                return ( char ) ( ( ( bytes[pos] & 0x1C ) << 6 ) + 
+                    ( ( bytes[pos] & 0x03 ) << 6 ) + 
+                ( bytes[pos + 1] & 0x3F ) 
+                );
             }
             else if ( ( bytes[pos] & UnicodeConstants.UTF8_THREE_BYTES_MASK ) == UnicodeConstants.UTF8_THREE_BYTES )
             {
                 // Three bytes char
-                return ( char ) (
-                // 1110-tttt 10xx-xxyy 10zz-zzzz -> tttt-0000-0000-0000
-                ( ( bytes[pos] & 0x0F ) << 12 )
-                    // 1110-tttt 10xx-xxyy 10zz-zzzz -> 0000-xxxx-0000-0000
+                // 1110-tttt 10xx-xxyy 10zz-zzzz -> tttt-xxxx yyzz-zzzz (FF FF)
+                return ( char ) ( ( ( bytes[pos] & 0x0F ) << 12 )
                     + ( ( bytes[pos + 1] & 0x3C ) << 6 )
-                    // 1110-tttt 10xx-xxyy 10zz-zzzz -> 0000-0000-yy00-0000
                     + ( ( bytes[pos + 1] & 0x03 ) << 6 )
-                    // 1110-tttt 10xx-xxyy 10zz-zzzz -> 0000-0000-00zz-zzzz
                     + ( bytes[pos + 2] & 0x3F )
-                // -> tttt-xxxx yyzz-zzzz (FF FF)
                 );
             }
             else if ( ( bytes[pos] & UnicodeConstants.UTF8_FOUR_BYTES_MASK ) == UnicodeConstants.UTF8_FOUR_BYTES )
             {
                 // Four bytes char
                 return ( char ) (
-                // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 000t-tt00
-                // 0000-0000 0000-0000
+                // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 000t-ttuu vvvv-xxxx yyzz-zzzz (1FFFFF)
                 ( ( bytes[pos] & 0x07 ) << 18 )
-                    // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-00uu
-                    // 0000-0000 0000-0000
                     + ( ( bytes[pos + 1] & 0x30 ) << 16 )
-                    // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
-                    // vvvv-0000 0000-0000
                     + ( ( bytes[pos + 1] & 0x0F ) << 12 )
-                    // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
-                    // 0000-xxxx 0000-0000
                     + ( ( bytes[pos + 2] & 0x3C ) << 6 )
-                    // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
-                    // 0000-0000 yy00-0000
                     + ( ( bytes[pos + 2] & 0x03 ) << 6 )
-                    // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
-                    // 0000-0000 00zz-zzzz
                     + ( bytes[pos + 3] & 0x3F )
-                // -> 000t-ttuu vvvv-xxxx yyzz-zzzz (1FFFFF)
                 );
             }
             else if ( ( bytes[pos] & UnicodeConstants.UTF8_FIVE_BYTES_MASK ) == UnicodeConstants.UTF8_FIVE_BYTES )
@@ -177,27 +154,14 @@ public final class Unicode
                 // Five bytes char
                 return ( char ) (
                 // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
-                // 0000-00tt 0000-0000 0000-0000 0000-0000
+                // 0000-00tt uuuu-uuvv wwww-xxxx yyzz-zzzz (03 FF FF FF)
                 ( ( bytes[pos] & 0x03 ) << 24 )
-                    // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
-                    // 0000-0000 uuuu-uu00 0000-0000 0000-0000
                     + ( ( bytes[pos + 1] & 0x3F ) << 18 )
-                    // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
-                    // 0000-0000 0000-00vv 0000-0000 0000-0000
                     + ( ( bytes[pos + 2] & 0x30 ) << 12 )
-                    // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
-                    // 0000-0000 0000-0000 wwww-0000 0000-0000
                     + ( ( bytes[pos + 2] & 0x0F ) << 12 )
-                    // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
-                    // 0000-0000 0000-0000 0000-xxxx 0000-0000
                     + ( ( bytes[pos + 3] & 0x3C ) << 6 )
-                    // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
-                    // 0000-0000 0000-0000 0000-0000 yy00-0000
                     + ( ( bytes[pos + 3] & 0x03 ) << 6 )
-                    // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
-                    // 0000-0000 0000-0000 0000-0000 00zz-zzzz
                     + ( bytes[pos + 4] & 0x3F )
-                // -> 0000-00tt uuuu-uuvv wwww-xxxx yyzz-zzzz (03 FF FF FF)
                 );
             }
             else if ( ( bytes[pos] & UnicodeConstants.UTF8_FIVE_BYTES_MASK ) == UnicodeConstants.UTF8_FIVE_BYTES )
@@ -205,38 +169,15 @@ public final class Unicode
                 // Six bytes char
                 return ( char ) (
                 // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz
-                // ->
-                // 0s00-0000 0000-0000 0000-0000 0000-0000
+                // -> 0stt-tttt uuuu-uuvv wwww-xxxx yyzz-zzzz (7F FF FF FF)
                 ( ( bytes[pos] & 0x01 ) << 30 )
-                    // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz
-                    // ->
-                    // 00tt-tttt 0000-0000 0000-0000 0000-0000
                     + ( ( bytes[pos + 1] & 0x3F ) << 24 )
-                    // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
-                    // 10zz-zzzz ->
-                    // 0000-0000 uuuu-uu00 0000-0000 0000-0000
                     + ( ( bytes[pos + 2] & 0x3F ) << 18 )
-                    // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
-                    // 10zz-zzzz ->
-                    // 0000-0000 0000-00vv 0000-0000 0000-0000
                     + ( ( bytes[pos + 3] & 0x30 ) << 12 )
-                    // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
-                    // 10zz-zzzz ->
-                    // 0000-0000 0000-0000 wwww-0000 0000-0000
                     + ( ( bytes[pos + 3] & 0x0F ) << 12 )
-                    // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
-                    // 10zz-zzzz ->
-                    // 0000-0000 0000-0000 0000-xxxx 0000-0000
                     + ( ( bytes[pos + 4] & 0x3C ) << 6 )
-                    // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
-                    // 10zz-zzzz ->
-                    // 0000-0000 0000-0000 0000-0000 yy00-0000
                     + ( ( bytes[pos + 4] & 0x03 ) << 6 )
-                    // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz
-                    // ->
-                    // 0000-0000 0000-0000 0000-0000 00zz-zzzz
                     + ( bytes[pos + 5] & 0x3F )
-                // -> 0stt-tttt uuuu-uuvv wwww-xxxx yyzz-zzzz (7F FF FF FF)
                 );
             }
             else

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnicodeConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnicodeConstants.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnicodeConstants.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnicodeConstants.java Wed May 20 10:27:25 2015
@@ -42,18 +42,21 @@ public interface UnicodeConstants
     /** %01-%27 %2B-%5B %5D-%7F */
     boolean[] UNICODE_SUBSET =
         {
-            false, true,  true,  true,  true,  true,  true,  true, // '\0'
+            // '\0'
+            false, true,  true,  true,  true,  true,  true,  true, 
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
-            false, false, false, true,  true,  true,  true,  true, // '(', ')', '*'
+            // '(', ')', '*'
+            false, false, false, true,  true,  true,  true,  true, 
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
-            true,  true,  true,  true,  false, true,  true,  true, // '\'
+            // '\'
+            true,  true,  true,  true,  false, true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,
             true,  true,  true,  true,  true,  true,  true,  true,

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnixCrypt.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnixCrypt.java?rev=1680515&r1=1680514&r2=1680515&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnixCrypt.java (original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/UnixCrypt.java Wed May 20 10:27:25 2015
@@ -74,7 +74,8 @@ public class UnixCrypt extends Object
 
     /* (mostly) Standard DES Tables from Tom Truscott */
     private static final byte[] IP =
-        { /* initial permutation */
+        { 
+            /* initial permutation */
             58, 50, 42, 34, 26, 18, 10, 2,
             60, 52, 44, 36, 28, 20, 12, 4,
             62, 54, 46, 38, 30, 22, 14, 6,
@@ -86,7 +87,8 @@ public class UnixCrypt extends Object
 
     /* The final permutation is the inverse of IP - no table is necessary */
     private static final byte[] ExpandTr =
-        { /* expansion operation */
+        { 
+            /* expansion operation */
             32, 1, 2, 3, 4, 5,
             4, 5, 6, 7, 8, 9,
             8, 9, 10, 11, 12, 13,
@@ -97,7 +99,8 @@ public class UnixCrypt extends Object
             28, 29, 30, 31, 32, 1 };
 
     private static final byte[] PC1 =
-        { /* permuted choice table 1 */
+        { 
+            /* permuted choice table 1 */
             57, 49, 41, 33, 25, 17, 9,
             1, 58, 50, 42, 34, 26, 18,
             10, 2, 59, 51, 43, 35, 27,
@@ -109,11 +112,13 @@ public class UnixCrypt extends Object
             21, 13, 5, 28, 20, 12, 4 };
 
     private static final byte[] Rotates =
-        { /* PC1 rotation schedule */
+        { 
+            /* PC1 rotation schedule */
             1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 };
 
     private static final byte[] PC2 =
-        { /* permuted choice table 2 */
+        { 
+            /* permuted choice table 2 */
             9, 18, 14, 17, 11, 24, 1, 5,
             22, 25, 3, 28, 15, 6, 21, 10,
             35, 38, 23, 19, 12, 4, 26, 8,
@@ -125,7 +130,8 @@ public class UnixCrypt extends Object
             0, 0, 46, 42, 50, 36, 29, 32 };
 
     private static final byte[][] S =
-        { /* 48->32 bit substitution tables */
+        { 
+            /* 48->32 bit substitution tables */
             /* S[1]         */
             { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
                 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
@@ -168,7 +174,8 @@ public class UnixCrypt extends Object
                 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 } };
 
     private static final byte[] P32Tr =
-        { /* 32-bit permutation function */
+        { 
+            /* 32-bit permutation function */
             16, 7, 20, 21,
             29, 12, 28, 17,
             1, 15, 23, 26,
@@ -179,7 +186,8 @@ public class UnixCrypt extends Object
             22, 11, 4, 25 };
 
     private static final byte[] CIFP =
-        { /* compressed/interleaved permutation */
+        { 
+            /* compressed/interleaved permutation */
             1, 2, 3, 4, 17, 18, 19, 20,
             5, 6, 7, 8, 21, 22, 23, 24,
             9, 10, 11, 12, 25, 26, 27, 28,
@@ -191,7 +199,8 @@ public class UnixCrypt extends Object
             45, 46, 47, 48, 61, 62, 63, 64 };
 
     private static final byte[] ITOA64 =
-        { /* 0..63 => ascii-64 */
+        { 
+            /* 0..63 => ascii-64 */
             ( byte ) '.',
             ( byte ) '/',
             ( byte ) '0',
@@ -646,14 +655,17 @@ public class UnixCrypt extends Object
     @SuppressWarnings("deprecation")
     public static String crypt( String key, String setting )
     {
-        long constdatablock = 0L; /* encryption constant */
-        byte[] cryptresult = new byte[13]; /* encrypted result */
+        /* encryption constant */
+        long constdatablock = 0L; 
+        /* encrypted result */
+        byte[] cryptresult = new byte[13]; 
         long keyword = 0L;
         
         /* invalid parameters! */
         if ( key == null || setting == null )
         {
-            return "*"; // will NOT match under ANY circumstances!
+         // will NOT match under ANY circumstances!
+            return "*"; 
         } 
 
         int keylen = key.length();



Mime
View raw message