directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1746258 [8/9] - in /directory/shared/branches/shared-value: asn1/ber/src/main/java/org/apache/directory/api/asn1/actions/ asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/ asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/gr...
Date Tue, 31 May 2016 09:32:13 GMT
Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -56,9 +56,10 @@ public class OtherMailboxSyntaxChecker e
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -81,7 +82,7 @@ public class OtherMailboxSyntaxChecker e
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -91,31 +92,30 @@ public class OtherMailboxSyntaxChecker e
         if ( dollar == -1 )
         {
             // No '$' => error
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         String mailboxType = strValue.substring( 0, dollar );
 
-        String mailbox = ( ( dollar < strValue.length() - 1 )
-            ? strValue.substring( dollar + 1 ) : "" );
+        String mailbox = dollar < strValue.length() - 1 ? strValue.substring( dollar + 1 ) : "";
 
         // The mailbox should not contains a '$'
         if ( mailbox.indexOf( '$' ) != -1 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         // Check that the mailboxType is a PrintableString
         if ( !Strings.isPrintableString( mailboxType ) )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         // Check that the mailbox is an IA5String
-        boolean result = ( Strings.isIA5String( mailbox ) );
+        boolean result = Strings.isIA5String( mailbox );
 
         if ( result )
         {
@@ -123,7 +123,7 @@ public class OtherMailboxSyntaxChecker e
         }
         else
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
         }
 
         return result;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PostalAddressSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PostalAddressSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PostalAddressSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PostalAddressSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -55,9 +55,10 @@ public class PostalAddressSyntaxChecker
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -80,7 +81,7 @@ public class PostalAddressSyntaxChecker
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -102,7 +103,7 @@ public class PostalAddressSyntaxChecker
 
             if ( Strings.isEmpty( address ) )
             {
-                LOG.debug( "Syntax invalid for '{}'", value );
+                LOG.debug( INVALID_SYNTAX_FOR, value );
                 return false;
             }
 
@@ -111,7 +112,7 @@ public class PostalAddressSyntaxChecker
             if ( pos == strValue.length() )
             {
                 // we should not have a '$' at the end
-                LOG.debug( "Syntax invalid for '{}'", value );
+                LOG.debug( INVALID_SYNTAX_FOR, value );
                 return false;
             }
 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PresentationAddressSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PresentationAddressSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PresentationAddressSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PresentationAddressSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -52,6 +52,7 @@ public class PresentationAddressSyntaxCh
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         LOG.debug( "Syntax valid for '{}'", value );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PrintableStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PrintableStringSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PrintableStringSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/PrintableStringSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -76,9 +76,10 @@ public class PrintableStringSyntaxChecke
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -101,14 +102,14 @@ public class PrintableStringSyntaxChecke
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         // We must have at least one char
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -120,7 +121,7 @@ public class PrintableStringSyntaxChecke
         }
         else
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
         }
 
         return result;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ProtocolInformationSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ProtocolInformationSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ProtocolInformationSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ProtocolInformationSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -51,6 +51,7 @@ public class ProtocolInformationSyntaxCh
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         LOG.debug( "Syntax valid for '{}'", value );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/RegexSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/RegexSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/RegexSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/RegexSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -59,7 +59,7 @@ public class RegexSyntaxChecker extends
 
         if ( ( matchExprArray != null ) && ( matchExprArray.length != 0 ) )
         {
-            expressions = new ArrayList<String>( matchExprArray.length );
+            expressions = new ArrayList<>( matchExprArray.length );
 
             for ( String regexp : matchExprArray )
             {
@@ -68,7 +68,7 @@ public class RegexSyntaxChecker extends
         }
         else
         {
-            expressions = new ArrayList<String>();
+            expressions = new ArrayList<>();
         }
     }
 
@@ -83,16 +83,17 @@ public class RegexSyntaxChecker extends
     public RegexSyntaxChecker( String oid )
     {
         super( oid );
-        expressions = new ArrayList<String>();
+        expressions = new ArrayList<>();
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String str = null;
+        String str;
         boolean match = true;
 
         if ( value instanceof String )
@@ -101,7 +102,7 @@ public class RegexSyntaxChecker extends
 
             for ( String regexp : expressions )
             {
-                match = match && str.matches( regexp );
+                match = str.matches( regexp );
 
                 if ( !match )
                 {
@@ -116,7 +117,7 @@ public class RegexSyntaxChecker extends
         }
         else
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
         }
 
         return match;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SearchScopeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SearchScopeSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SearchScopeSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SearchScopeSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -58,9 +58,10 @@ public class SearchScopeSyntaxChecker ex
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -83,6 +84,6 @@ public class SearchScopeSyntaxChecker ex
 
         strValue = Strings.trim( Strings.toLowerCaseAscii( strValue ) );
 
-        return ( "base".equals( strValue ) || "one".equals( strValue ) || "sub".equals( strValue ) );
+        return "base".equals( strValue ) || "one".equals( strValue ) || "sub".equals( strValue );
     }
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubstringAssertionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubstringAssertionSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubstringAssertionSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubstringAssertionSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -53,6 +53,7 @@ public class SubstringAssertionSyntaxChe
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         LOG.debug( "Syntax valid for '{}'", value );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -45,7 +45,7 @@ public class SubtreeSpecificationSyntaxC
     private static final Logger LOG = LoggerFactory.getLogger( SubtreeSpecificationSyntaxChecker.class );
 
     /** The associated checker */
-    private SubtreeSpecificationChecker subtreeSpecificationChecker;
+    private transient SubtreeSpecificationChecker subtreeSpecificationChecker;
 
 
     /**
@@ -60,9 +60,10 @@ public class SubtreeSpecificationSyntaxC
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -85,7 +86,7 @@ public class SubtreeSpecificationSyntaxC
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -101,7 +102,7 @@ public class SubtreeSpecificationSyntaxC
         }
         catch ( ParseException pe )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
     }
@@ -110,6 +111,7 @@ public class SubtreeSpecificationSyntaxC
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setSchemaManager( SchemaManager schemaManager )
     {
         subtreeSpecificationChecker = new SubtreeSpecificationChecker( schemaManager );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierAndConsumerSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierAndConsumerSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierAndConsumerSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierAndConsumerSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -50,6 +50,7 @@ public class SupplierAndConsumerSyntaxCh
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         LOG.debug( "Syntax valid for '{}'", value );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierInformationSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierInformationSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierInformationSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierInformationSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -50,6 +50,7 @@ public class SupplierInformationSyntaxCh
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         LOG.debug( "Syntax valid for '{}'", value );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierOrConsumerSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierOrConsumerSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierOrConsumerSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupplierOrConsumerSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -50,6 +50,7 @@ public class SupplierOrConsumerSyntaxChe
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         LOG.debug( "Syntax valid for '{}'", value );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupportedAlgorithmSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupportedAlgorithmSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupportedAlgorithmSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/SupportedAlgorithmSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -52,6 +52,7 @@ public class SupportedAlgorithmSyntaxChe
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         LOG.debug( "Syntax valid for '{}'", value );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -93,8 +93,8 @@ public class TelephoneNumberSyntaxChecke
 
             if ( regexps == null )
             {
-                regexps = new ArrayList<String>();
-                compiledREs = new ArrayList<Pattern>();
+                regexps = new ArrayList<>();
+                compiledREs = new ArrayList<>();
             }
 
             regexps.add( regexp );
@@ -132,9 +132,10 @@ public class TelephoneNumberSyntaxChecke
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -157,7 +158,7 @@ public class TelephoneNumberSyntaxChecke
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -173,7 +174,7 @@ public class TelephoneNumberSyntaxChecke
             }
             else
             {
-                LOG.debug( "Syntax invalid for '{}'", value );
+                LOG.debug( INVALID_SYNTAX_FOR, value );
             }
 
             return result;
@@ -189,7 +190,7 @@ public class TelephoneNumberSyntaxChecke
             {
                 if ( compiledREs == null )
                 {
-                    LOG.debug( "Syntax invalid for '{}'", value );
+                    LOG.debug( INVALID_SYNTAX_FOR, value );
                     return false;
                 }
 
@@ -204,7 +205,7 @@ public class TelephoneNumberSyntaxChecke
                     }
                 }
 
-                LOG.debug( "Syntax invalid for '{}'", value );
+                LOG.debug( INVALID_SYNTAX_FOR, value );
                 return false;
             }
         }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -60,9 +60,10 @@ public class TeletexTerminalIdentifierSy
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -85,26 +86,26 @@ public class TeletexTerminalIdentifierSy
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         // Search for the first '$' separator
         int dollar = strValue.indexOf( '$' );
 
-        String terminalIdentifier = ( ( dollar == -1 ) ? strValue : strValue.substring( 0, dollar ) );
+        String terminalIdentifier = dollar == -1 ? strValue : strValue.substring( 0, dollar );
 
         if ( terminalIdentifier.length() == 0 )
         {
             // It should not be null
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         if ( !Strings.isPrintableString( terminalIdentifier ) )
         {
             // It's not a valid PrintableString 
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -120,7 +121,7 @@ public class TeletexTerminalIdentifierSy
 
         if ( ttxParams.length == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -131,7 +132,7 @@ public class TeletexTerminalIdentifierSy
             if ( colon == -1 )
             {
                 // we must have a ':' separator
-                LOG.debug( "Syntax invalid for '{}'", value );
+                LOG.debug( INVALID_SYNTAX_FOR, value );
                 return false;
             }
 
@@ -145,7 +146,7 @@ public class TeletexTerminalIdentifierSy
             {
                 if ( colon + 1 == ttxParam.length() )
                 {
-                    LOG.debug( "Syntax invalid for '{}'", value );
+                    LOG.debug( INVALID_SYNTAX_FOR, value );
                     return false;
                 }
 
@@ -157,14 +158,14 @@ public class TeletexTerminalIdentifierSy
                     {
                         case 0x24:
                             // '$' is not accepted
-                            LOG.debug( "Syntax invalid for '{}'", value );
+                            LOG.debug( INVALID_SYNTAX_FOR, value );
                             return false;
 
                         case 0x5c:
                             if ( hasEsc )
                             {
                                 // two following \ are not accepted
-                                LOG.debug( "Syntax invalid for '{}'", value );
+                                LOG.debug( INVALID_SYNTAX_FOR, value );
                                 return false;
                             }
                             else
@@ -204,7 +205,7 @@ public class TeletexTerminalIdentifierSy
             }
             else
             {
-                LOG.debug( "Syntax invalid for '{}'", value );
+                LOG.debug( INVALID_SYNTAX_FOR, value );
                 return false;
             }
         }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelexNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelexNumberSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelexNumberSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelexNumberSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -57,9 +57,10 @@ public class TelexNumberSyntaxChecker ex
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -82,7 +83,7 @@ public class TelexNumberSyntaxChecker ex
 
         if ( strValue.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -93,7 +94,7 @@ public class TelexNumberSyntaxChecker ex
         if ( dollar <= 0 )
         {
             // No '$' => error
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -102,14 +103,14 @@ public class TelexNumberSyntaxChecker ex
         // The actualNumber must not be empty
         if ( actualNumber.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         // The actual number should be a PrintableString 
         if ( !Strings.isPrintableString( actualNumber ) )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -120,7 +121,7 @@ public class TelexNumberSyntaxChecker ex
         if ( dollar2 == -1 )
         {
             // No '$' => error
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -129,14 +130,14 @@ public class TelexNumberSyntaxChecker ex
         // The countryCode must not be empty
         if ( countryCode.length() == 0 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
         // The country Code should be a PrintableString 
         if ( !Strings.isPrintableString( countryCode ) )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -144,7 +145,7 @@ public class TelexNumberSyntaxChecker ex
         if ( dollar2 + 1 == strValue.length() )
         {
             // The last string should not be null
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -153,7 +154,7 @@ public class TelexNumberSyntaxChecker ex
         // The answerBack should be a PrintableString 
         if ( !Strings.isPrintableString( answerBack ) )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -166,7 +167,7 @@ public class TelexNumberSyntaxChecker ex
         }
         else
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
         }
 
         return result;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UtcTimeSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -104,9 +104,10 @@ public class UtcTimeSyntaxChecker extend
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -130,7 +131,7 @@ public class UtcTimeSyntaxChecker extend
         // A generalized time must have a minimal length of 11 
         if ( strValue.length() < 11 )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 
@@ -143,7 +144,7 @@ public class UtcTimeSyntaxChecker extend
         }
         else
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
         }
         return result;
     }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UuidSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UuidSyntaxChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UuidSyntaxChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/UuidSyntaxChecker.java Tue May 31 09:32:09 2016
@@ -55,6 +55,7 @@ public class UuidSyntaxChecker extends S
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
         if ( value == null )
@@ -70,7 +71,7 @@ public class UuidSyntaxChecker extends S
 
         if ( !( value instanceof String ) )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( INVALID_SYNTAX_FOR, value );
             return false;
         }
 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/AndRefinement.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/AndRefinement.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/AndRefinement.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/AndRefinement.java Tue May 31 09:32:09 2016
@@ -33,7 +33,7 @@ import java.util.List;
 public class AndRefinement implements Refinement
 {
     /** The set of refinements */
-    private List<Refinement> refinements = new ArrayList<Refinement>();
+    private List<Refinement> refinements = new ArrayList<>();
 
 
     /**
@@ -59,6 +59,7 @@ public class AndRefinement implements Re
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/BaseSubtreeSpecification.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/BaseSubtreeSpecification.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/BaseSubtreeSpecification.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/BaseSubtreeSpecification.java Tue May 31 09:32:09 2016
@@ -177,6 +177,7 @@ public class BaseSubtreeSpecification im
     /**
      * @return The base
      */
+    @Override
     public Dn getBase()
     {
         return this.base;
@@ -186,6 +187,7 @@ public class BaseSubtreeSpecification im
     /**
      * @return The set of ChopBefore exclusions
      */
+    @Override
     public Set<Dn> getChopBeforeExclusions()
     {
         return this.chopBefore;
@@ -195,6 +197,7 @@ public class BaseSubtreeSpecification im
     /**
      * @return The set of ChopAfter exclusions
      */
+    @Override
     public Set<Dn> getChopAfterExclusions()
     {
         return this.chopAfter;
@@ -204,6 +207,7 @@ public class BaseSubtreeSpecification im
     /**
      * @return The mimimum distance from the base
      */
+    @Override
     public int getMinBaseDistance()
     {
         return this.minBaseDistance;
@@ -213,6 +217,7 @@ public class BaseSubtreeSpecification im
     /**
      * @return The maximum distance from the base
      */
+    @Override
     public int getMaxBaseDistance()
     {
         return this.maxBaseDistance;
@@ -222,6 +227,7 @@ public class BaseSubtreeSpecification im
     /**
      * @return The refinement
      */
+    @Override
     public ExprNode getRefinement()
     {
         return this.refinement;
@@ -234,6 +240,7 @@ public class BaseSubtreeSpecification im
      *
      * @param buffer the string buffer
      */
+    @Override
     public void toString( StringBuilder buffer )
     {
         buffer.append( toString() );
@@ -243,6 +250,7 @@ public class BaseSubtreeSpecification im
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder buffer = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/ItemRefinement.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/ItemRefinement.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/ItemRefinement.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/ItemRefinement.java Tue May 31 09:32:09 2016
@@ -67,6 +67,7 @@ public class ItemRefinement implements R
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/NotRefinement.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/NotRefinement.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/NotRefinement.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/NotRefinement.java Tue May 31 09:32:09 2016
@@ -50,6 +50,7 @@ public class NotRefinement implements Re
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/OrRefinement.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/OrRefinement.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/OrRefinement.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/OrRefinement.java Tue May 31 09:32:09 2016
@@ -33,7 +33,7 @@ import java.util.List;
 public class OrRefinement implements Refinement
 {
     /** The set of refinements */
-    private List<Refinement> refinements = new ArrayList<Refinement>();
+    private List<Refinement> refinements = new ArrayList<>();
 
 
     /**
@@ -59,6 +59,7 @@ public class OrRefinement implements Ref
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/Subentry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/Subentry.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/Subentry.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/Subentry.java Tue May 31 09:32:09 2016
@@ -61,10 +61,9 @@ public class Subentry
 
 
     /**
+     * Set teh set of AdministrativeRoles for this Subentry
      *
-     * TODO setAdministrativeRoles.
-     *
-     * @param administrativeRoles
+     * @param administrativeRoles The administrativeRoles to store
      */
     public final void setAdministrativeRoles( Set<AdministrativeRole> administrativeRoles )
     {
@@ -120,6 +119,7 @@ public class Subentry
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         return "Subentry[" + administrativeRoles + ", " + ss + "]";

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationChecker.java Tue May 31 09:32:09 2016
@@ -26,6 +26,7 @@ import java.text.ParseException;
 
 import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.util.Strings;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -88,7 +89,7 @@ public class SubtreeSpecificationChecker
      */
     public synchronized void parse( String spec ) throws ParseException
     {
-        if ( spec == null || spec.trim().equals( "" ) )
+        if ( spec == null || Strings.isEmpty( spec.trim() ) )
         {
             return;
         }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/subtree/SubtreeSpecificationParser.java Tue May 31 09:32:09 2016
@@ -27,6 +27,7 @@ import java.text.ParseException;
 import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.schema.NormalizerMappingResolver;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.util.Strings;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -110,9 +111,9 @@ public class SubtreeSpecificationParser
      */
     public synchronized SubtreeSpecification parse( String spec ) throws ParseException
     {
-        SubtreeSpecification ss = null;
+        SubtreeSpecification ss;
 
-        if ( spec == null || spec.trim().equals( "" ) )
+        if ( ( spec == null ) || Strings.isEmpty( spec.trim() ) )
         {
             return null;
         }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java Tue May 31 09:32:09 2016
@@ -156,10 +156,29 @@ public class LdapUrl
         host = null;
         port = -1;
         dn = null;
-        attributes = new ArrayList<String>();
+        attributes = new ArrayList<>();
         scope = SearchScope.OBJECT;
         filter = null;
-        extensionList = new ArrayList<Extension>( 2 );
+        extensionList = new ArrayList<>( 2 );
+    }
+
+
+    /**
+     * Create a new LdapUrl from a String after having parsed it.
+     *
+     * @param string TheString that contains the LdapUrl
+     * @throws LdapURLEncodingException If the String does not comply with RFC 2255
+     */
+    public LdapUrl( String string ) throws LdapURLEncodingException
+    {
+        if ( string == null )
+        {
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04408 ) );
+        }
+
+        bytes = Strings.getBytesUtf8( string );
+        this.string = string;
+        parse( string.toCharArray() );
     }
 
 
@@ -175,10 +194,10 @@ public class LdapUrl
         host = null;
         port = -1;
         dn = null;
-        attributes = new ArrayList<String>();
+        attributes = new ArrayList<>();
         scope = SearchScope.OBJECT;
         filter = null;
-        extensionList = new ArrayList<Extension>( 2 );
+        extensionList = new ArrayList<>( 2 );
 
         if ( ( chars == null ) || ( chars.length == 0 ) )
         {
@@ -190,10 +209,9 @@ public class LdapUrl
         // [dn ["?" [attributes] ["?" [scope]
         // ["?" [filter] ["?" extensions]]]]]]
         // scheme = "ldap"
-        int pos = 0;
-
         // The scheme
-        pos = Strings.areEquals( chars, 0, LDAP_SCHEME );
+        int pos = Strings.areEquals( chars, 0, LDAP_SCHEME );
+        
         if ( pos == StringConstants.NOT_EQUAL )
         {
             pos = Strings.areEquals( chars, 0, LDAPS_SCHEME );
@@ -329,25 +347,6 @@ public class LdapUrl
 
 
     /**
-     * Create a new LdapUrl from a String after having parsed it.
-     *
-     * @param string TheString that contains the LdapUrl
-     * @throws LdapURLEncodingException If the String does not comply with RFC 2255
-     */
-    public LdapUrl( String string ) throws LdapURLEncodingException
-    {
-        if ( string == null )
-        {
-            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04408 ) );
-        }
-
-        bytes = Strings.getBytesUtf8( string );
-        this.string = string;
-        parse( string.toCharArray() );
-    }
-
-
-    /**
      * Parse this rule : <br>
      * <pre>
      * host        = IP-literal / IPv4address / reg-name
@@ -517,7 +516,7 @@ public class LdapUrl
 
         if ( containsCompressedZeroes )
         {
-            List<String> octetList = new ArrayList<String>( Arrays.asList( octets ) );
+            List<String> octetList = new ArrayList<>( Arrays.asList( octets ) );
 
             if ( inet6Address.endsWith( "::" ) )
             {
@@ -542,7 +541,7 @@ public class LdapUrl
 
         for ( int index = 0; index < octets.length; index++ )
         {
-            String octet = ( String ) octets[index];
+            String octet = octets[index];
 
             if ( octet.length() == 0 )
             {
@@ -879,17 +878,25 @@ public class LdapUrl
     {
         int ipElemValue = 0;
         boolean ipElemSeen = false;
-        boolean hasTailingZeroes = false;
+        boolean hasHeadingZero = false;
 
         while ( Chars.isDigit( chars, pos ) )
         {
             ipElemSeen = true;
             ipElemValue = ( ipElemValue * 10 ) + ( chars[pos] - '0' );
 
-            if ( ( chars[pos] == '0' ) && hasTailingZeroes && ( ipElemValue > 0 ) )
+            if ( chars[pos] == '0' )
             {
-                // Two 0 at the beginning : not allowed
-                return -1;
+                if ( hasHeadingZero )
+                {
+                    // Two 0 at the beginning : not allowed
+                    return -1;
+                }
+                
+                if ( ipElemValue == 0 )
+                {
+                    hasHeadingZero = true;
+                }
             }
 
             if ( ipElemValue > 255 )
@@ -1166,7 +1173,7 @@ public class LdapUrl
     {
         int start = pos;
         int end = pos;
-        Set<String> hAttributes = new HashSet<String>();
+        Set<String> hAttributes = new HashSet<>();
         boolean hadComma = false;
 
         try
@@ -1187,10 +1194,8 @@ public class LdapUrl
                     }
                     else
                     {
-                        String attribute = null;
-
                         // get the attribute. It must not be blank
-                        attribute = new String( chars, start, end - start ).trim();
+                        String attribute = new String( chars, start, end - start ).trim();
 
                         if ( attribute.length() == 0 )
                         {
@@ -1245,9 +1250,7 @@ public class LdapUrl
 
                 // Store the last attribute
                 // get the attribute. It must not be blank
-                String attribute = null;
-
-                attribute = new String( chars, start, end - start ).trim();
+                String attribute = new String( chars, start, end - start ).trim();
 
                 if ( attribute.length() == 0 )
                 {
@@ -1422,7 +1425,7 @@ public class LdapUrl
 
         try
         {
-            for ( int i = pos; ( i < chars.length ); i++ )
+            for ( int i = pos; i < chars.length; i++ )
             {
                 if ( Chars.isCharASCII( chars, i, ',' ) )
                 {
@@ -1565,7 +1568,7 @@ public class LdapUrl
      */
     public static String urlEncode( String url, boolean doubleEncode )
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         for ( int i = 0; i < url.length(); i++ )
         {
@@ -1720,7 +1723,7 @@ public class LdapUrl
     @Override
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( scheme );
 
@@ -1752,8 +1755,8 @@ public class LdapUrl
         {
             sb.append( '/' ).append( urlEncode( dn.getName(), false ) );
 
-            if ( ( attributes.size() != 0 ) || forceScopeRendering
-                || ( ( scope != SearchScope.OBJECT ) || ( filter != null ) || ( extensionList.size() != 0 ) ) )
+            if ( !attributes.isEmpty() || forceScopeRendering
+                || ( ( scope != SearchScope.OBJECT ) || ( filter != null ) || !extensionList.isEmpty() ) )
             {
                 sb.append( '?' );
 
@@ -1782,7 +1785,7 @@ public class LdapUrl
             }
             else
             {
-                if ( ( scope != SearchScope.OBJECT ) || ( filter != null ) || ( extensionList.size() != 0 ) )
+                if ( ( scope != SearchScope.OBJECT ) || ( filter != null ) || !extensionList.isEmpty() )
                 {
                     sb.append( '?' );
 
@@ -1797,7 +1800,7 @@ public class LdapUrl
                             break;
                     }
 
-                    if ( ( filter != null ) || ( ( extensionList.size() != 0 ) ) )
+                    if ( ( filter != null ) || ( !extensionList.isEmpty() ) )
                     {
                         sb.append( "?" );
 
@@ -1806,13 +1809,13 @@ public class LdapUrl
                             sb.append( urlEncode( filter, false ) );
                         }
 
-                        if ( ( extensionList.size() != 0 ) )
+                        if ( !extensionList.isEmpty() )
                         {
                             sb.append( '?' );
 
                             boolean isFirst = true;
 
-                            if ( extensionList.size() != 0 )
+                            if ( !extensionList.isEmpty() )
                             {
                                 for ( Extension extension : extensionList )
                                 {
@@ -1974,7 +1977,7 @@ public class LdapUrl
      */
     public int getNbBytes()
     {
-        return ( bytes != null ? bytes.length : 0 );
+        return bytes != null ? bytes.length : 0;
     }
 
 

Modified: directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/SchemaUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/SchemaUtilsTest.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/SchemaUtilsTest.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/SchemaUtilsTest.java Tue May 31 09:32:09 2016
@@ -125,36 +125,36 @@ public class SchemaUtilsTest
 
     /**
      * Tests rendering operations on qdescrs render method. Both overloaded
-     * operations {@link org.apache.directory.api.ldap.model.schema.SchemaUtils#render(StringBuffer, String[])} and
+     * operations {@link org.apache.directory.api.ldap.model.schema.SchemaUtils#render(StringBuilder, String[])} and
      * {@link org.apache.directory.api.ldap.model.schema.SchemaUtils#render(String[])} are tested here.
      */
     @Test
     public void testRenderQdescrs()
     {
-        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuffer(), ( List<String> ) null ).toString() );
-        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuilder(), ( List<String> ) null ).toString() );
+        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
             {} ) ).toString() );
-        assertEquals( "'name1'", SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+        assertEquals( "'name1'", SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
             { "name1" } ) ).toString() );
-        assertEquals( "( 'name1' 'name2' )", SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+        assertEquals( "( 'name1' 'name2' )", SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
             { "name1", "name2" } ) ).toString() );
         assertEquals( "( 'name1' 'name2' 'name3' )",
-            SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+            SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
                 { "name1", "name2", "name3" } ) ).toString() );
 
-        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuffer(), ( List<String> ) null ).toString() );
+        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuilder(), ( List<String> ) null ).toString() );
 
-        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+        assertEquals( "", SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
             {} ) ).toString() );
 
-        assertEquals( "'name1'", SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+        assertEquals( "'name1'", SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
             { "name1" } ) ).toString() );
 
-        assertEquals( "( 'name1' 'name2' )", SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+        assertEquals( "( 'name1' 'name2' )", SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
             { "name1", "name2" } ) ).toString() );
 
         assertEquals( "( 'name1' 'name2' 'name3' )",
-            SchemaUtils.renderQDescrs( new StringBuffer(), Arrays.asList( new String[]
+            SchemaUtils.renderQDescrs( new StringBuilder(), Arrays.asList( new String[]
                 { "name1", "name2", "name3" } ) ).toString() );
     }
     

Modified: directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java (original)
+++ directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java Tue May 31 09:32:09 2016
@@ -65,6 +65,7 @@ public class LdapProtocolCodecActivator
         @Override
         public void modifiedService( ServiceReference<LdapApiService> reference, LdapApiService service )
         {
+            // Do nothing ATM
         }
 
 
@@ -83,16 +84,18 @@ public class LdapProtocolCodecActivator
      */
     public LdapProtocolCodecActivator()
     {
+        // Default constructor
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public void start( BundleContext bundleContext ) throws Exception
     {
         LdapApiServiceTracker ldapApiServiceTracker = new LdapApiServiceTracker( bundleContext );
-        serviceTracker = new ServiceTracker<LdapApiService, LdapApiService>( bundleContext, LdapApiService.class,
+        serviceTracker = new ServiceTracker<>( bundleContext, LdapApiService.class,
             ldapApiServiceTracker );
         serviceTracker.open();
     }
@@ -101,6 +104,7 @@ public class LdapProtocolCodecActivator
     /**
      * {@inheritDoc}
      */
+    @Override
     public void stop( BundleContext bundleContext ) throws Exception
     {
         serviceTracker.close();

Modified: directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java (original)
+++ directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java Tue May 31 09:32:09 2016
@@ -79,6 +79,7 @@ public class LdapProtocolCodecFactory im
      * @param session the IO session
      * @return the decoder
      */
+    @Override
     public ProtocolDecoder getDecoder( IoSession session )
     {
         return ldapDecoder;
@@ -91,6 +92,7 @@ public class LdapProtocolCodecFactory im
      * @param session the IO session
      * @return the encoder
      */
+    @Override
     public ProtocolEncoder getEncoder( IoSession session )
     {
         return ldapEncoder;

Modified: directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java (original)
+++ directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java Tue May 31 09:32:09 2016
@@ -74,6 +74,7 @@ public class LdapProtocolDecoder impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out ) throws Exception
     {
         @SuppressWarnings("unchecked")
@@ -88,7 +89,7 @@ public class LdapProtocolDecoder impleme
             messageContainer.setMaxPDUSize( maxPDUSize );
         }
 
-        List<Message> decodedMessages = new ArrayList<Message>();
+        List<Message> decodedMessages = new ArrayList<>();
         ByteBuffer buf = in.buf();
 
         decode( buf, messageContainer, decodedMessages );
@@ -165,7 +166,7 @@ public class LdapProtocolDecoder impleme
                 
                 // Transform the DecoderException message to a MessageException
                 ResponseCarryingMessageException rcme = new ResponseCarryingMessageException( rce.getMessage(), rce );
-                rcme.setResponse( ( ( ResponseCarryingException ) rce ).getResponse() );
+                rcme.setResponse( rce.getResponse() );
 
                 throw rcme;
             }
@@ -184,6 +185,7 @@ public class LdapProtocolDecoder impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void finishDecode( IoSession session, ProtocolDecoderOutput out ) throws Exception
     {
         // Nothing to do
@@ -193,6 +195,7 @@ public class LdapProtocolDecoder impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void dispose( IoSession session ) throws Exception
     {
         // Nothing to do

Modified: directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolEncoder.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolEncoder.java (original)
+++ directory/shared/branches/shared-value/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolEncoder.java Tue May 31 09:32:09 2016
@@ -73,6 +73,7 @@ public class LdapProtocolEncoder impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws Exception
     {
         ByteBuffer buffer = encoder.encodeMessage( ( Message ) message );
@@ -94,6 +95,7 @@ public class LdapProtocolEncoder impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void dispose( IoSession session ) throws Exception
     {
         // Nothing to do

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/AbstractSimpleComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/AbstractSimpleComponentsMonitor.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/AbstractSimpleComponentsMonitor.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/AbstractSimpleComponentsMonitor.java Tue May 31 09:32:09 2016
@@ -49,13 +49,14 @@ public abstract class AbstractSimpleComp
     public AbstractSimpleComponentsMonitor( String[] components )
     {
         // register components
-        this.components = new LinkedList<String>( Arrays.asList( components ) );
+        this.components = new LinkedList<>( Arrays.asList( components ) );
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public ComponentsMonitor useComponent( String component ) throws IllegalArgumentException
     {
         if ( !components.remove( component ) )
@@ -70,6 +71,7 @@ public abstract class AbstractSimpleComp
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean allComponentsUsed()
     {
         return components.isEmpty();
@@ -79,6 +81,7 @@ public abstract class AbstractSimpleComp
     /**
      * {@inheritDoc}
      */
+    @Override
     public List<String> getRemainingComponents()
     {
         return Collections.unmodifiableList( components );

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Base64.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Base64.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Base64.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Base64.java Tue May 31 09:32:09 2016
@@ -32,6 +32,39 @@ import org.apache.directory.api.i18n.I18
 public final class Base64
 {
 
+    /** code characters for values 0..63 */
+    private static final char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
+        .toCharArray();
+
+    /** lookup table for converting base64 characters to value in range 0..63 */
+    private static final byte[] CODES = new byte[256];
+
+    static
+    {
+        for ( int ii = 0; ii < 256; ii++ )
+        {
+            CODES[ii] = -1;
+        }
+
+        for ( int ii = 'A'; ii <= 'Z'; ii++ )
+        {
+            CODES[ii] = ( byte ) ( ii - 'A' );
+        }
+
+        for ( int ii = 'a'; ii <= 'z'; ii++ )
+        {
+            CODES[ii] = ( byte ) ( 26 + ii - 'a' );
+        }
+
+        for ( int ii = '0'; ii <= '9'; ii++ )
+        {
+            CODES[ii] = ( byte ) ( 52 + ii - '0' );
+        }
+
+        CODES['+'] = 62;
+        CODES['/'] = 63;
+    }
+
     /**
      * Private constructor.
      */
@@ -55,29 +88,29 @@ public final class Base64
         // 3 bytes encode to 4 chars. Output is always an even
         // multiple of 4 characters.
         //
-        for ( int ii = 0, index = 0; ii < data.length; ii += 3, index += 4 )
+        for ( int i = 0, index = 0; i < data.length; i += 3, index += 4 )
         {
             boolean isQuadrupel = false;
             boolean isTripel = false;
 
-            int val = ( 0xFF & data[ii] );
+            int val = 0xFF & data[i];
             val <<= 8;
-            if ( ( ii + 1 ) < data.length )
+            if ( ( i + 1 ) < data.length )
             {
-                val |= ( 0xFF & data[ii + 1] );
+                val |= ( 0xFF & data[i + 1] );
                 isTripel = true;
             }
 
             val <<= 8;
-            if ( ( ii + 2 ) < data.length )
+            if ( ( i + 2 ) < data.length )
             {
-                val |= ( 0xFF & data[ii + 2] );
+                val |= ( 0xFF & data[i + 2] );
                 isQuadrupel = true;
             }
 
-            out[index + 3] = ALPHABET[( isQuadrupel ? ( val & 0x3F ) : 64 )];
+            out[index + 3] = ALPHABET[ isQuadrupel ? ( val & 0x3F ) : 64 ];
             val >>= 6;
-            out[index + 2] = ALPHABET[( isTripel ? ( val & 0x3F ) : 64 )];
+            out[index + 2] = ALPHABET[ isTripel ? ( val & 0x3F ) : 64 ];
             val >>= 6;
             out[index + 1] = ALPHABET[val & 0x3F];
             val >>= 6;
@@ -182,37 +215,4 @@ public final class Base64
 
         return out;
     }
-
-    /** code characters for values 0..63 */
-    private static final char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
-        .toCharArray();
-
-    /** lookup table for converting base64 characters to value in range 0..63 */
-    private static final byte[] CODES = new byte[256];
-
-    static
-    {
-        for ( int ii = 0; ii < 256; ii++ )
-        {
-            CODES[ii] = -1;
-        }
-
-        for ( int ii = 'A'; ii <= 'Z'; ii++ )
-        {
-            CODES[ii] = ( byte ) ( ii - 'A' );
-        }
-
-        for ( int ii = 'a'; ii <= 'z'; ii++ )
-        {
-            CODES[ii] = ( byte ) ( 26 + ii - 'a' );
-        }
-
-        for ( int ii = '0'; ii <= '9'; ii++ )
-        {
-            CODES[ii] = ( byte ) ( 52 + ii - '0' );
-        }
-
-        CODES['+'] = 62;
-        CODES['/'] = 63;
-    }
 }

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Chars.java Tue May 31 09:32:09 2016
@@ -190,7 +190,7 @@ public final class Chars
         }
         else
         {
-            return ( ( chars[index] == car ) ? true : false );
+            return ( chars[index] == car ) ? true : false;
         }
     }
 
@@ -296,7 +296,7 @@ public final class Chars
      */
     public static boolean isAlpha( byte c )
     {
-        return ( ( c > 0 ) && ( c <= 127 ) && ALPHA[c] );
+        return ( c > 0 ) && ( c <= 127 ) && ALPHA[c];
     }
 
 
@@ -311,7 +311,7 @@ public final class Chars
      */
     public static boolean isAlpha( char c )
     {
-        return ( ( c > 0 ) && ( c <= 127 ) && ALPHA[c] );
+        return ( c > 0 ) && ( c <= 127 ) && ALPHA[c];
     }
 
 
@@ -664,7 +664,7 @@ public final class Chars
         else
         {
             char c = string.charAt( index );
-            return ( ( c == '0' ) || ( c == '1' ) );
+            return ( c == '0' ) || ( c == '1' );
         }
     }
 
@@ -684,7 +684,7 @@ public final class Chars
         }
         else
         {
-            return ( ( ( ( bytes[0] | 0x7F ) != 0x7F ) || !DIGIT[bytes[0]] ) ? false : true );
+            return ( ( ( bytes[0] | 0x7F ) != 0x7F ) || !DIGIT[bytes[0]] ) ? false : true;
         }
     }
 
@@ -733,7 +733,7 @@ public final class Chars
         }
         else
         {
-            return ( ( ( ( bytes[index] | 0x7F ) != 0x7F ) || !DIGIT[bytes[index]] ) ? false : true );
+            return ( ( ( bytes[index] | 0x7F ) != 0x7F ) || !DIGIT[bytes[index]] ) ? false : true;
         }
     }
 
@@ -754,7 +754,7 @@ public final class Chars
         }
         else
         {
-            return ( ( ( chars[index] > 127 ) || !DIGIT[chars[index]] ) ? false : true );
+            return ( ( chars[index] > 127 ) || !DIGIT[chars[index]] ) ? false : true;
         }
     }
 
@@ -783,7 +783,7 @@ public final class Chars
         else
         {
             char c = string.charAt( index );
-            return ( ( ( c > 127 ) || !DIGIT[c] ) ? false : true );
+            return ( ( c > 127 ) || !DIGIT[c] ) ? false : true;
         }
     }
 
@@ -803,7 +803,7 @@ public final class Chars
         }
         else
         {
-            return ( ( ( chars[0] > 127 ) || !DIGIT[chars[0]] ) ? false : true );
+            return ( ( chars[0] > 127 ) || !DIGIT[chars[0]] ) ? false : true;
         }
     }
 
@@ -852,7 +852,7 @@ public final class Chars
         {
             byte c = bytes[index];
 
-            return ( ( ( c | 0x7F ) == 0x7F ) && HEX[c] );
+            return ( ( c | 0x7F ) == 0x7F ) && HEX[c];
         }
     }
 
@@ -875,7 +875,7 @@ public final class Chars
         {
             char c = chars[index];
 
-            return ( ( ( c | 0x007F ) == 0x007F ) && HEX[c] );
+            return ( ( c | 0x007F ) == 0x007F ) && HEX[c];
         }
     }
 
@@ -905,7 +905,7 @@ public final class Chars
         {
             char c = string.charAt( index );
 
-            return ( ( ( c | 0x007F ) == 0x007F ) && HEX[c] );
+            return ( ( c | 0x007F ) == 0x007F ) && HEX[c];
         }
     }
     

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/DummySSLSocketFactory.java Tue May 31 09:32:09 2016
@@ -45,24 +45,6 @@ public class DummySSLSocketFactory exten
     /** The default instance. */
     private static SocketFactory instance;
 
-
-    /**
-     * Gets the default instance.
-     * 
-     * Note: This method is invoked from the JNDI framework when 
-     * creating a ldaps:// connection.
-     * 
-     * @return the default instance
-     */
-    public static SocketFactory getDefault()
-    {
-        if ( instance == null )
-        {
-            instance = new DummySSLSocketFactory();
-        }
-        return instance;
-    }
-
     /** The delegate. */
     private SSLSocketFactory delegate;
 
@@ -76,17 +58,20 @@ public class DummySSLSocketFactory exten
         {
             TrustManager tm = new X509TrustManager()
             {
+                @Override
                 public X509Certificate[] getAcceptedIssuers()
                 {
                     return new X509Certificate[0];
                 }
 
 
+                @Override
                 public void checkClientTrusted( X509Certificate[] arg0, String arg1 ) throws CertificateException
                 {
                 }
 
 
+                @Override
                 public void checkServerTrusted( X509Certificate[] arg0, String arg1 ) throws CertificateException
                 {
                 }
@@ -105,8 +90,27 @@ public class DummySSLSocketFactory exten
 
 
     /**
+     * Gets the default instance.
+     * 
+     * Note: This method is invoked from the JNDI framework when 
+     * creating a ldaps:// connection.
+     * 
+     * @return the default instance
+     */
+    public static SocketFactory getDefault()
+    {
+        if ( instance == null )
+        {
+            instance = new DummySSLSocketFactory();
+        }
+        return instance;
+    }
+
+
+    /**
      * @see javax.net.ssl.SSLSocketFactory#getDefaultCipherSuites()
      */
+    @Override
     public String[] getDefaultCipherSuites()
     {
         return delegate.getDefaultCipherSuites();
@@ -116,6 +120,7 @@ public class DummySSLSocketFactory exten
     /**
      * @see javax.net.ssl.SSLSocketFactory#getSupportedCipherSuites()
      */
+    @Override
     public String[] getSupportedCipherSuites()
     {
         return delegate.getSupportedCipherSuites();
@@ -125,6 +130,7 @@ public class DummySSLSocketFactory exten
     /**
      * @see javax.net.ssl.SSLSocketFactory#createSocket(java.net.Socket, java.lang.String, int, boolean)
      */
+    @Override
     public Socket createSocket( Socket arg0, String arg1, int arg2, boolean arg3 ) throws IOException
     {
         try
@@ -142,6 +148,7 @@ public class DummySSLSocketFactory exten
     /**
      * @see javax.net.SocketFactory#createSocket(java.lang.String, int)
      */
+    @Override
     public Socket createSocket( String arg0, int arg1 ) throws IOException
     {
         try
@@ -159,6 +166,7 @@ public class DummySSLSocketFactory exten
     /**
      * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int)
      */
+    @Override
     public Socket createSocket( InetAddress arg0, int arg1 ) throws IOException
     {
         try
@@ -176,6 +184,7 @@ public class DummySSLSocketFactory exten
     /**
      * @see javax.net.SocketFactory#createSocket(java.lang.String, int, java.net.InetAddress, int)
      */
+    @Override
     public Socket createSocket( String arg0, int arg1, InetAddress arg2, int arg3 ) throws IOException
     {
         try
@@ -193,6 +202,7 @@ public class DummySSLSocketFactory exten
     /**
      * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int, java.net.InetAddress, int)
      */
+    @Override
     public Socket createSocket( InetAddress arg0, int arg1, InetAddress arg2, int arg3 ) throws IOException
     {
         try

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/EmptyEnumeration.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/EmptyEnumeration.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/EmptyEnumeration.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/EmptyEnumeration.java Tue May 31 09:32:09 2016
@@ -39,6 +39,7 @@ public class EmptyEnumeration<T> impleme
     /**
      * @see javax.naming.NamingEnumeration#close()
      */
+    @Override
     public void close()
     {
     }
@@ -49,6 +50,7 @@ public class EmptyEnumeration<T> impleme
      * 
      * @see javax.naming.NamingEnumeration#hasMore()
      */
+    @Override
     public boolean hasMore() throws NamingException
     {
         return false;
@@ -60,6 +62,7 @@ public class EmptyEnumeration<T> impleme
      * 
      * @see javax.naming.NamingEnumeration#next()
      */
+    @Override
     public T next() throws NamingException
     {
         throw new NoSuchElementException();
@@ -71,6 +74,7 @@ public class EmptyEnumeration<T> impleme
      * 
      * @see java.util.Enumeration#hasMoreElements()
      */
+    @Override
     public boolean hasMoreElements()
     {
         return false;
@@ -82,6 +86,7 @@ public class EmptyEnumeration<T> impleme
      * 
      * @see java.util.Enumeration#nextElement()
      */
+    @Override
     public T nextElement()
     {
         throw new NoSuchElementException();

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/FileUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/FileUtils.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/FileUtils.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/FileUtils.java Tue May 31 09:32:09 2016
@@ -132,7 +132,7 @@ public final class FileUtils
             return false;
         }
 
-        File fileInCanonicalDir = null;
+        File fileInCanonicalDir;
 
         if ( file.getParent() == null )
         {
@@ -464,12 +464,9 @@ public final class FileUtils
         {
             File parent = file.getParentFile();
 
-            if ( parent != null )
+            if ( ( parent != null ) && ( !parent.mkdirs() && !parent.isDirectory() ) )
             {
-                if ( !parent.mkdirs() && !parent.isDirectory() )
-                {
-                    throw new IOException( "Directory '" + parent + "' could not be created" );
-                }
+                throw new IOException( "Directory '" + parent + "' could not be created" );
             }
         }
 
@@ -618,12 +615,9 @@ public final class FileUtils
 
         File parentFile = destFile.getParentFile();
 
-        if ( parentFile != null )
+        if ( ( parentFile != null ) && ( !parentFile.mkdirs() && !parentFile.isDirectory() ) )
         {
-            if ( !parentFile.mkdirs() && !parentFile.isDirectory() )
-            {
-                throw new IOException( "Destination '" + parentFile + "' directory cannot be created" );
-            }
+            throw new IOException( "Destination '" + parentFile + "' directory cannot be created" );
         }
 
         if ( destFile.exists() && !destFile.canWrite() )

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java Tue May 31 09:32:09 2016
@@ -204,22 +204,6 @@ public class GeneralizedTime implements
     }
 
 
-    private void setUp( Calendar newCalendar )
-    {
-        if ( newCalendar == null )
-        {
-            throw new IllegalArgumentException( I18n.err( I18n.ERR_04358 ) );
-        }
-
-        this.calendar = newCalendar;
-        upGeneralizedTime = null;
-        upFormat = Format.YEAR_MONTH_DAY_HOUR_MIN_SEC_FRACTION;
-        upTimeZoneFormat = TimeZoneFormat.Z;
-        upFractionDelimiter = FractionDelimiter.DOT;
-        upFractionLength = 3;
-    }
-
-
     /**
      * Creates a new instance of GeneralizedTime, based on the
      * given generalized time string.
@@ -367,6 +351,22 @@ public class GeneralizedTime implements
     }
 
 
+    private void setUp( Calendar newCalendar )
+    {
+        if ( newCalendar == null )
+        {
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04358 ) );
+        }
+
+        this.calendar = newCalendar;
+        upGeneralizedTime = null;
+        upFormat = Format.YEAR_MONTH_DAY_HOUR_MIN_SEC_FRACTION;
+        upTimeZoneFormat = TimeZoneFormat.Z;
+        upFractionDelimiter = FractionDelimiter.DOT;
+        upFractionLength = 3;
+    }
+
+
     private void parseTimezone( int pos ) throws ParseException
     {
         if ( upGeneralizedTime.length() < pos + 1 )
@@ -778,7 +778,6 @@ public class GeneralizedTime implements
 
                 result[pos++] = ( byte ) ( ( millisecond / 10 ) + '0' );
 
-                //if ( millisecond > 0 )
                 result[pos++] = ( byte ) ( ( millisecond % 10 ) + '0' );
 
                 break;
@@ -971,6 +970,7 @@ public class GeneralizedTime implements
      * 
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
+    @Override
     public int compareTo( GeneralizedTime other )
     {
         return calendar.compareTo( other.calendar );

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Hex.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Hex.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Hex.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/Hex.java Tue May 31 09:32:09 2016
@@ -227,7 +227,9 @@ public final class Hex
         char[] out = new char[l << 1];
 
         // two characters form the hex value.
-        for ( int i = 0, j = 0; i < l; i++ )
+        int j = 0;
+        
+        for ( int i = 0; i < l; i++ )
         {
             out[j++] = HEX_CHAR[( 0xF0 & data[i] ) >>> 4];
             out[j++] = HEX_CHAR[0x0F & data[i]];

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/IOUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/IOUtils.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/IOUtils.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/IOUtils.java Tue May 31 09:32:09 2016
@@ -416,7 +416,7 @@ public final class IOUtils
     public static long copyLarge( InputStream input, OutputStream output, byte[] buffer ) throws IOException 
     {
         long count = 0;
-        int n = 0;
+        int n;
         
         while ( EOF != ( n = input.read( buffer ) ) ) 
         {
@@ -446,7 +446,7 @@ public final class IOUtils
     public static long copyLarge( Reader input, Writer output, char[] buffer ) throws IOException
     {
         long count = 0;
-        int n = 0;
+        int n;
 
         while ( EOF != ( n = input.read( buffer ) ) )
         {
@@ -588,7 +588,7 @@ public final class IOUtils
     public static List<String> readLines( Reader input ) throws IOException 
     {
         BufferedReader reader = toBufferedReader( input );
-        List<String> list = new ArrayList<String>();
+        List<String> list = new ArrayList<>();
         String line = reader.readLine();
         
         while ( line != null ) 

Modified: directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/MandatoryAndOptionalComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/MandatoryAndOptionalComponentsMonitor.java?rev=1746258&r1=1746257&r2=1746258&view=diff
==============================================================================
--- directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/MandatoryAndOptionalComponentsMonitor.java (original)
+++ directory/shared/branches/shared-value/util/src/main/java/org/apache/directory/api/util/MandatoryAndOptionalComponentsMonitor.java Tue May 31 09:32:09 2016
@@ -74,6 +74,7 @@ public class MandatoryAndOptionalCompone
     /**
      * {@inheritDoc}
      */
+    @Override
     public ComponentsMonitor useComponent( String component )
     {
         try
@@ -99,27 +100,30 @@ public class MandatoryAndOptionalCompone
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean allComponentsUsed()
     {
-        return ( mandatoryComponentsMonitor.allComponentsUsed() && optionalComponentsMonitor.allComponentsUsed() );
+        return mandatoryComponentsMonitor.allComponentsUsed() && optionalComponentsMonitor.allComponentsUsed();
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean finalStateValid()
     {
-        return ( mandatoryComponentsMonitor.finalStateValid() && optionalComponentsMonitor.finalStateValid() );
+        return mandatoryComponentsMonitor.finalStateValid() && optionalComponentsMonitor.finalStateValid();
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public List<String> getRemainingComponents()
     {
-        List<String> remainingComponents = new LinkedList<String>();
+        List<String> remainingComponents = new LinkedList<>();
 
         remainingComponents.addAll( mandatoryComponentsMonitor.getRemainingComponents() );
         remainingComponents.addAll( optionalComponentsMonitor.getRemainingComponents() );




Mime
View raw message