directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1746258 [2/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/exception/LdapUriException.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/LdapUriException.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/exception/LdapUriException.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/exception/LdapUriException.java Tue May 31 09:32:09 2016
@@ -29,21 +29,6 @@ public class LdapUriException extends Ld
 {
     private static final long serialVersionUID = 1L;
 
-
-    /**
-     * The constructor with a reason string argument.
-     * 
-     * @param reason the reason
-     * @param cause the root cause
-     */
-    public LdapUriException( String reason, Throwable cause )
-    {
-        // for backward compatibility of Throwable
-        super( reason, cause );
-        this.reason = reason;
-        this.reasonCode = UNKNOWN;
-    }
-
     /**
      * No specified reason code.
      */
@@ -59,7 +44,21 @@ public class LdapUriException extends Ld
      */
     protected String reason;
 
+    /**
+     * The constructor with a reason string argument.
+     * 
+     * @param reason the reason
+     * @param cause the root cause
+     */
+    public LdapUriException( String reason, Throwable cause )
+    {
+        // for backward compatibility of Throwable
+        super( reason, cause );
+        this.reason = reason;
+        this.reasonCode = UNKNOWN;
+    }
 
+    
     /**
      * Get the reason code.
      * 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AbstractExprNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AbstractExprNode.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/filter/AbstractExprNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AbstractExprNode.java Tue May 31 09:32:09 2016
@@ -56,6 +56,7 @@ public abstract class AbstractExprNode i
      * 
      * @return the node's type
      */
+    @Override
     public AssertionType getAssertionType()
     {
         return assertionType;
@@ -66,6 +67,7 @@ public abstract class AbstractExprNode i
      * @see Object#equals(Object)
      *@return <code>true</code> if both objects are equal 
      */
+    @Override
     public boolean equals( Object o )
     {
         // Shortcut for equals object
@@ -133,6 +135,7 @@ public abstract class AbstractExprNode i
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int h = 37;
@@ -158,6 +161,7 @@ public abstract class AbstractExprNode i
      * 
      * @return the annotation value.
      */
+    @Override
     public Object get( Object key )
     {
         if ( null == annotations )
@@ -173,11 +177,12 @@ public abstract class AbstractExprNode i
      * @see ExprNode#set(java.lang.Object,
      *      java.lang.Object)
      */
+    @Override
     public void set( String key, Object value )
     {
         if ( null == annotations )
         {
-            annotations = new HashMap<String, Object>( 2 );
+            annotations = new HashMap<>( 2 );
         }
 
         annotations.put( key, value );
@@ -200,6 +205,7 @@ public abstract class AbstractExprNode i
      * 
      * @return true if the Node is SchemaAware
      */
+    @Override
     public abstract boolean isSchemaAware();
 
 
@@ -210,6 +216,7 @@ public abstract class AbstractExprNode i
      * @return The buffer in which the refinement has been appended
      * @throws UnsupportedOperationException if this node isn't a part of a refinement.
      */
+    @Override
     public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_04144 ) );
@@ -247,6 +254,7 @@ public abstract class AbstractExprNode i
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         if ( ( null != annotations ) && annotations.containsKey( "count" ) )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AndNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AndNode.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/filter/AndNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AndNode.java Tue May 31 09:32:09 2016
@@ -113,6 +113,7 @@ public class AndNode extends BranchNode
      * @return The buffer in which the refinement has been appended
      * @throws UnsupportedOperationException if this node isn't a part of a refinement.
      */
+    @Override
     public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
         buf.append( "and: {" );
@@ -146,9 +147,10 @@ public class AndNode extends BranchNode
      * @see java.lang.Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         buf.append( "(&" );
 
         buf.append( super.toString() );
@@ -168,6 +170,7 @@ public class AndNode extends BranchNode
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int hash = 37;
@@ -180,6 +183,7 @@ public class AndNode extends BranchNode
     /**
      * @see java.lang.Object#equals(java.lang.Object)
      */
+    @Override
     public boolean equals( Object other )
     {
         if ( this == other )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ApproximateNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ApproximateNode.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/filter/ApproximateNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ApproximateNode.java Tue May 31 09:32:09 2016
@@ -71,6 +71,7 @@ public class ApproximateNode<T> extends
      * @see Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AssertionNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AssertionNode.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/filter/AssertionNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/AssertionNode.java Tue May 31 09:32:09 2016
@@ -79,18 +79,6 @@ public abstract class AssertionNode exte
 
 
     /**
-     * Makes a full clone in new memory space of the current node and children
-     * 
-     * @return the clone
-     */
-    @Override
-    public ExprNode clone()
-    {
-        return ( ExprNode ) super.clone();
-    }
-
-
-    /**
      * Gets the Assertion used by this assertion node.
      * 
      * @return the assertion used by this node
@@ -111,6 +99,7 @@ public abstract class AssertionNode exte
      * @see ExprNode#isLeaf()
      * @return true if the node is a leaf,false otherwise
      */
+    @Override
     public boolean isLeaf()
     {
         return true;
@@ -120,7 +109,8 @@ public abstract class AssertionNode exte
     /**
      * @see ExprNode#printRefinementToBuffer(StringBuilder) 
      */
-    public StringBuilder printRefinementToBuffer( StringBuilder buf ) throws UnsupportedOperationException
+    @Override
+    public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_04145 ) );
     }
@@ -131,6 +121,7 @@ public abstract class AssertionNode exte
      * 
      * @return true if the Node is SchemaAware
      */
+    @Override
     public boolean isSchemaAware()
     {
         return true;
@@ -206,6 +197,7 @@ public abstract class AssertionNode exte
      * @see ExprNode#accept(
      *FilterVisitor)
      */
+    @Override
     public Object accept( FilterVisitor visitor )
     {
         return visitor.visit( this );
@@ -216,6 +208,7 @@ public abstract class AssertionNode exte
      * @see Object#toString
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/BranchNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/BranchNode.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/filter/BranchNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/BranchNode.java Tue May 31 09:32:09 2016
@@ -49,7 +49,7 @@ public abstract class BranchNode extends
 
         if ( null == childList )
         {
-            this.children = new ArrayList<ExprNode>( 2 );
+            this.children = new ArrayList<>( 2 );
         }
         else
         {
@@ -70,7 +70,7 @@ public abstract class BranchNode extends
 
         if ( null == children )
         {
-            this.children = new ArrayList<ExprNode>( childList.length );
+            this.children = new ArrayList<>( childList.length );
         }
 
         CollectionUtils.addAll( children, childList );
@@ -86,7 +86,7 @@ public abstract class BranchNode extends
     {
         super( assertionType );
 
-        this.children = new ArrayList<ExprNode>( 2 );
+        this.children = new ArrayList<>( 2 );
     }
 
 
@@ -94,6 +94,7 @@ public abstract class BranchNode extends
      * @see ExprNode#isLeaf()
      * @return false all the time.
      */
+    @Override
     public final boolean isLeaf()
     {
         return false;
@@ -108,12 +109,12 @@ public abstract class BranchNode extends
     @Override
     public ExprNode clone()
     {
-        ExprNode clone = ( ExprNode ) super.clone();
+        ExprNode clone = super.clone();
 
         // Clone the children
         if ( children != null )
         {
-            ( ( BranchNode ) clone ).children = new ArrayList<ExprNode>();
+            ( ( BranchNode ) clone ).children = new ArrayList<>();
 
             for ( ExprNode child : children )
             {
@@ -181,12 +182,12 @@ public abstract class BranchNode extends
      */
     public ExprNode getFirstChild()
     {
-        if ( children.size() > 0 )
+        if ( children.isEmpty() )
         {
-            return children.get( 0 );
+            return null;
         }
 
-        return null;
+        return children.get( 0 );
     }
 
 
@@ -196,6 +197,7 @@ public abstract class BranchNode extends
      *      
      * @return The modified element
      */
+    @Override
     public final Object accept( FilterVisitor visitor )
     {
         if ( visitor.isPrefix() )
@@ -234,6 +236,7 @@ public abstract class BranchNode extends
      * 
      * @return true if the Node is SchemaAware
      */
+    @Override
     public boolean isSchemaAware()
     {
         if ( children == null )
@@ -259,6 +262,7 @@ public abstract class BranchNode extends
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int h = 37;
@@ -280,6 +284,7 @@ public abstract class BranchNode extends
     /**
      * @see java.lang.Object#equals(java.lang.Object)
      */
+    @Override
     public boolean equals( Object other )
     {
         if ( this == other )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/BranchNormalizedVisitor.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/BranchNormalizedVisitor.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/filter/BranchNormalizedVisitor.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/BranchNormalizedVisitor.java Tue May 31 09:32:09 2016
@@ -44,6 +44,7 @@ import org.apache.directory.api.ldap.mod
  */
 public class BranchNormalizedVisitor implements FilterVisitor
 {
+    @Override
     public Object visit( ExprNode node )
     {
         if ( !( node instanceof BranchNode ) )
@@ -55,7 +56,7 @@ public class BranchNormalizedVisitor imp
 
         Comparator<ExprNode> nodeComparator = new NodeComparator();
 
-        Set<ExprNode> set = new TreeSet<ExprNode>( nodeComparator );
+        Set<ExprNode> set = new TreeSet<>( nodeComparator );
 
         List<ExprNode> children = branch.getChildren();
 
@@ -84,18 +85,21 @@ public class BranchNormalizedVisitor imp
     }
 
 
+    @Override
     public boolean canVisit( ExprNode node )
     {
         return node instanceof BranchNode;
     }
 
 
+    @Override
     public boolean isPrefix()
     {
         return false;
     }
 
 
+    @Override
     public List<ExprNode> getOrder( BranchNode node, List<ExprNode> children )
     {
         return children;
@@ -139,25 +143,11 @@ public class BranchNormalizedVisitor imp
 
     static class NodeComparator implements Comparator<ExprNode>
     {
+        @Override
         public int compare( ExprNode o1, ExprNode o2 )
         {
-            StringBuilder buf = new StringBuilder();
-
-            buf.setLength( 0 );
-
-            String s1 = null;
-
-            buf.append( o1.toString() );
-
-            s1 = buf.toString();
-
-            buf.setLength( 0 );
-
-            String s2 = null;
-
-            buf.append( o2.toString() );
-
-            s2 = buf.toString();
+            String s1 = o1.toString();
+            String s2 = o2.toString();
 
             return s1.compareTo( s2 );
         }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/EqualityNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/EqualityNode.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/filter/EqualityNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/EqualityNode.java Tue May 31 09:32:09 2016
@@ -71,6 +71,7 @@ public class EqualityNode<T> extends Sim
      * @see Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ExprNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ExprNode.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/filter/ExprNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ExprNode.java Tue May 31 09:32:09 2016
@@ -81,7 +81,7 @@ public interface ExprNode extends Clonea
      * @return The buffer in which the refinement has been appended
      * @throws UnsupportedOperationException if this node isn't a part of a refinement.
      */
-    StringBuilder printRefinementToBuffer( StringBuilder buf ) throws UnsupportedOperationException;
+    StringBuilder printRefinementToBuffer( StringBuilder buf );
 
 
     /**

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ExtensibleNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ExtensibleNode.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/filter/ExtensibleNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ExtensibleNode.java Tue May 31 09:32:09 2016
@@ -114,7 +114,7 @@ public class ExtensibleNode extends Leaf
     @Override
     public ExprNode clone()
     {
-        ExprNode clone = ( ExprNode ) super.clone();
+        ExprNode clone = super.clone();
 
         // Copy the value
         if ( value != null )
@@ -264,6 +264,7 @@ public class ExtensibleNode extends Leaf
      * @see java.lang.Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterEncoder.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/filter/FilterEncoder.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterEncoder.java Tue May 31 09:32:09 2016
@@ -53,7 +53,7 @@ public final class FilterEncoder
      * @return the formatted filter with escaped values
      * @throws IllegalArgumentException if the number of values does not match the number of placeholders in the template
      */
-    public static String format( String filterTemplate, String... values ) throws IllegalArgumentException
+    public static String format( String filterTemplate, String... values )
     {
         if ( values == null )
         {
@@ -78,8 +78,7 @@ public final class FilterEncoder
         }
 
         // format the filter
-        String format = mf.format( values );
-        return format;
+        return mf.format( values );
     }
 
 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.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/filter/FilterParser.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java Tue May 31 09:32:09 2016
@@ -134,7 +134,7 @@ public final class FilterParser
     private static ExprNode parseExtensible( SchemaManager schemaManager, String attribute, byte[] filterBytes,
         Position pos, boolean relaxed ) throws LdapException, ParseException
     {
-        ExtensibleNode node = null;
+        ExtensibleNode node;
 
         if ( schemaManager != null )
         {
@@ -965,7 +965,7 @@ public final class FilterParser
     private static ExprNode parseFilterComp( SchemaManager schemaManager, byte[] filterBytes, Position pos,
         boolean relaxed ) throws ParseException, LdapException
     {
-        ExprNode node = null;
+        ExprNode node;
 
         if ( pos.start == pos.length )
         {

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/GreaterEqNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/GreaterEqNode.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/filter/GreaterEqNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/GreaterEqNode.java Tue May 31 09:32:09 2016
@@ -71,6 +71,7 @@ public class GreaterEqNode<T> extends Si
      * @see Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/LeafNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/LeafNode.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/filter/LeafNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/LeafNode.java Tue May 31 09:32:09 2016
@@ -79,6 +79,7 @@ public abstract class LeafNode extends A
      * 
      * @return true always
      */
+    @Override
     public final boolean isLeaf()
     {
         return true;
@@ -141,6 +142,7 @@ public abstract class LeafNode extends A
      * @param visitor the filter expression tree structure visitor
      * @return The modified element
      */
+    @Override
     public final Object accept( FilterVisitor visitor )
     {
         if ( visitor.canVisit( this ) )
@@ -159,7 +161,8 @@ public abstract class LeafNode extends A
      * 
      * @return true if the Node is SchemaAware
      */
-    public boolean isSchemaAware()
+    @Override
+public boolean isSchemaAware()
     {
         return attributeType != null;
     }
@@ -362,6 +365,7 @@ public abstract class LeafNode extends A
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int h = 37;
@@ -384,6 +388,7 @@ public abstract class LeafNode extends A
     /**
      * @see java.lang.Object#equals(java.lang.Object)
      */
+    @Override
     public boolean equals( Object other )
     {
         if ( this == other )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/LessEqNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/LessEqNode.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/filter/LessEqNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/LessEqNode.java Tue May 31 09:32:09 2016
@@ -71,6 +71,7 @@ public class LessEqNode<T> extends Simpl
      * @see Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/NotNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/NotNode.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/filter/NotNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/NotNode.java Tue May 31 09:32:09 2016
@@ -81,14 +81,17 @@ public class NotNode extends BranchNode
      * 
      * @param node the child expression to add to this NOT node
      */
+    @Override
     public void addNode( ExprNode node )
     {
-        if ( ( children == null ) || ( children.size() >= 1 ) )
+        if ( ( children != null ) && children.isEmpty() )
+        {
+            children.add( node );
+        }
+        else
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_04159 ) );
         }
-
-        children.add( node );
     }
 
 
@@ -97,14 +100,17 @@ public class NotNode extends BranchNode
      * 
      * @param node the child expression to add to this branch node
      */
+    @Override
     public void addNodeToHead( ExprNode node )
     {
-        if ( children.size() >= 1 )
+        if ( ( children != null ) && children.isEmpty() )
+        {
+            children.add( node );
+        }
+        else
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_04159 ) );
         }
-
-        children.add( node );
     }
 
 
@@ -113,6 +119,7 @@ public class NotNode extends BranchNode
      * 
      * @param childList the list of children to set.
      */
+    @Override
     public void setChildren( List<ExprNode> childList )
     {
         if ( ( childList != null ) && ( childList.size() > 1 ) )
@@ -174,6 +181,7 @@ public class NotNode extends BranchNode
      * @return The buffer in which the refinement has been appended
      * @throws UnsupportedOperationException if this node isn't a part of a refinement.
      */
+    @Override
     public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
         buf.append( "not: " );
@@ -192,6 +200,7 @@ public class NotNode extends BranchNode
      * @see java.lang.Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ObjectClassNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ObjectClassNode.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/filter/ObjectClassNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ObjectClassNode.java Tue May 31 09:32:09 2016
@@ -45,6 +45,7 @@ public final class ObjectClassNode exten
      * 
      * This implementation always returns true.
      */
+    @Override
     public boolean isLeaf()
     {
         return true;
@@ -56,6 +57,7 @@ public final class ObjectClassNode exten
      * 
      * This implementation always returns null.
      */
+    @Override
     public Object accept( FilterVisitor visitor )
     {
         return null;
@@ -67,6 +69,7 @@ public final class ObjectClassNode exten
      * 
      * @return true if the Node is SchemaAware
      */
+    @Override
     public boolean isSchemaAware()
     {
         return true;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/OrNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/OrNode.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/filter/OrNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/OrNode.java Tue May 31 09:32:09 2016
@@ -112,6 +112,7 @@ public class OrNode extends BranchNode
      * @return The buffer in which the refinement has been appended
      * @throws UnsupportedOperationException if this node isn't a part of a refinement.
      */
+    @Override
     public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
         buf.append( "or: {" );
@@ -145,6 +146,7 @@ public class OrNode extends BranchNode
      * @see java.lang.Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();
@@ -167,6 +169,7 @@ public class OrNode extends BranchNode
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int hash = 37;
@@ -179,6 +182,7 @@ public class OrNode extends BranchNode
     /**
      * @see java.lang.Object#equals(java.lang.Object)
      */
+    @Override
     public boolean equals( Object other )
     {
         if ( this == other )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/PresenceNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/PresenceNode.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/filter/PresenceNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/PresenceNode.java Tue May 31 09:32:09 2016
@@ -57,6 +57,7 @@ public final class PresenceNode extends
      * @see java.lang.Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ScopeNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ScopeNode.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/filter/ScopeNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/ScopeNode.java Tue May 31 09:32:09 2016
@@ -69,6 +69,7 @@ public class ScopeNode extends AbstractE
      * @see ExprNode#isLeaf()
      * @return <code>true</code>
      */
+    @Override
     public boolean isLeaf()
     {
         return true;
@@ -126,6 +127,7 @@ public class ScopeNode extends AbstractE
      * @param visitor the filter expression tree structure visitor
      * @return The modified element
      */
+    @Override
     public Object accept( FilterVisitor visitor )
     {
         if ( visitor.canVisit( this ) )
@@ -144,6 +146,7 @@ public class ScopeNode extends AbstractE
      * 
      * @return true if the Node is SchemaAware
      */
+    @Override
     public boolean isSchemaAware()
     {
         return true;
@@ -224,6 +227,7 @@ public class ScopeNode extends AbstractE
      * @see Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SimpleNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SimpleNode.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/filter/SimpleNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SimpleNode.java Tue May 31 09:32:09 2016
@@ -218,8 +218,6 @@ public abstract class SimpleNode<T> exte
     /**
      * Pretty prints this expression node along with annotation information.
      *
-     * TODO - perhaps this belong in some utility class?
-     *
      * @param buf the buffer to print into
      * @return the same buf argument returned for call chaining
      */
@@ -243,6 +241,7 @@ public abstract class SimpleNode<T> exte
      * @return The buffer in which the refinement has been appended
      * @throws UnsupportedOperationException if this node isn't a part of a refinement.
      */
+    @Override
     public StringBuilder printRefinementToBuffer( StringBuilder buf )
     {
         if ( isSchemaAware() )
@@ -272,6 +271,7 @@ public abstract class SimpleNode<T> exte
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int h = 37;
@@ -286,6 +286,7 @@ public abstract class SimpleNode<T> exte
     /**
      * @see java.lang.Object#equals(java.lang.Object)
      */
+    @Override
     public boolean equals( Object other )
     {
         if ( this == other )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.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/filter/SubstringNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/SubstringNode.java Tue May 31 09:32:09 2016
@@ -23,7 +23,6 @@ package org.apache.directory.api.ldap.mo
 import java.util.ArrayList;
 import java.util.List;
 import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
 
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
@@ -78,7 +77,7 @@ public class SubstringNode extends LeafN
     {
         super( attribute, AssertionType.SUBSTRING );
 
-        anyPattern = new ArrayList<String>( 2 );
+        anyPattern = new ArrayList<>( 2 );
         this.finalPattern = finalPattern;
         this.initialPattern = initialPattern;
     }
@@ -93,7 +92,7 @@ public class SubstringNode extends LeafN
     {
         super( attribute, AssertionType.SUBSTRING );
 
-        anyPattern = new ArrayList<String>( 2 );
+        anyPattern = new ArrayList<>( 2 );
         this.finalPattern = null;
         this.initialPattern = null;
     }
@@ -108,7 +107,7 @@ public class SubstringNode extends LeafN
     {
         super( attributeType, AssertionType.SUBSTRING );
 
-        anyPattern = new ArrayList<String>( 2 );
+        anyPattern = new ArrayList<>( 2 );
         this.finalPattern = null;
         this.initialPattern = null;
     }
@@ -169,9 +168,8 @@ public class SubstringNode extends LeafN
      *             compiled
      */
     public static Pattern getRegex( String initialPattern, String[] anyPattern, String finalPattern )
-        throws PatternSyntaxException
     {
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
 
         if ( initialPattern != null )
         {
@@ -205,11 +203,11 @@ public class SubstringNode extends LeafN
     @Override
     public ExprNode clone()
     {
-        ExprNode clone = ( ExprNode ) super.clone();
+        ExprNode clone = super.clone();
 
         if ( anyPattern != null )
         {
-            ( ( SubstringNode ) clone ).anyPattern = new ArrayList<String>();
+            ( ( SubstringNode ) clone ).anyPattern = new ArrayList<>();
 
             for ( String any : anyPattern )
             {
@@ -433,6 +431,7 @@ public class SubstringNode extends LeafN
      * @see java.lang.Object#toString()
      * @return A string representing the AndNode
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/UndefinedNode.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/UndefinedNode.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/filter/UndefinedNode.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/UndefinedNode.java Tue May 31 09:32:09 2016
@@ -45,6 +45,7 @@ public final class UndefinedNode extends
      * 
      * This implementation always returns false.
      */
+    @Override
     public boolean isLeaf()
     {
         return false;
@@ -56,6 +57,7 @@ public final class UndefinedNode extends
      * 
      * This implementation always returns null.
      */
+    @Override
     public Object accept( FilterVisitor visitor )
     {
         return null;
@@ -67,6 +69,7 @@ public final class UndefinedNode extends
      * 
      * @return true if the Node is SchemaAware
      */
+    @Override
     public boolean isSchemaAware()
     {
         return false;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifAttributesReader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifAttributesReader.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/ldif/LdifAttributesReader.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifAttributesReader.java Tue May 31 09:32:09 2016
@@ -179,7 +179,7 @@ public class LdifAttributesReader extend
         String attributeType = lowerLine.substring( 0, colonIndex );
 
         // We should *not* have a Dn twice
-        if ( attributeType.equals( "dn" ) )
+        if ( "dn".equals( attributeType ) )
         {
             LOG.error( I18n.err( I18n.ERR_12002_ENTRY_WITH_TWO_DNS ) );
             throw new LdapLdifException( I18n.err( I18n.ERR_12003_LDIF_ENTRY_WITH_TWO_DNS ) );
@@ -219,7 +219,7 @@ public class LdifAttributesReader extend
         AttributeType attributeType = null;
 
         // We should *not* have a Dn twice
-        if ( attributeName.equals( "dn" ) )
+        if ( "dn".equals( attributeName ) )
         {
             LOG.error( I18n.err( I18n.ERR_12002_ENTRY_WITH_TWO_DNS ) );
             throw new LdapLdifException( I18n.err( I18n.ERR_12003_LDIF_ENTRY_WITH_TWO_DNS ) );
@@ -239,7 +239,7 @@ public class LdifAttributesReader extend
         Object attributeValue = parseValue( attributeName, line, colonIndex );
 
         // Update the entry
-        Attribute attribute = null;
+        Attribute attribute;
 
         if ( schemaManager == null )
         {
@@ -319,7 +319,7 @@ public class LdifAttributesReader extend
      */
     private Entry parseEntry( SchemaManager schemaManager ) throws LdapLdifException
     {
-        if ( ( lines == null ) || ( lines.size() == 0 ) )
+        if ( ( lines == null ) || lines.isEmpty() )
         {
             LOG.debug( "The entry is empty : end of ldif file" );
             return null;
@@ -381,7 +381,7 @@ public class LdifAttributesReader extend
      */
     private Attributes parseAttributes() throws LdapLdifException
     {
-        if ( ( lines == null ) || ( lines.size() == 0 ) )
+        if ( ( lines == null ) || lines.isEmpty() )
         {
             LOG.debug( "The entry is empty : end of ldif file" );
             return null;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifControl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifControl.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/ldif/LdifControl.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifControl.java Tue May 31 09:32:09 2016
@@ -69,6 +69,7 @@ public class LdifControl implements Cont
     /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         return "LdifControl : {" + getOid() + ", " + isCritical() + ", " + Strings.dumpBytes( getValue() ) + "}";
@@ -78,6 +79,7 @@ public class LdifControl implements Cont
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getOid()
     {
         return oid;
@@ -87,6 +89,7 @@ public class LdifControl implements Cont
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isCritical()
     {
         return criticality;
@@ -96,6 +99,7 @@ public class LdifControl implements Cont
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setCritical( boolean criticality )
     {
         this.criticality = criticality;
@@ -132,6 +136,7 @@ public class LdifControl implements Cont
     /**
      * {@inheritDoc}
      */
+    @Override
     public void writeExternal( ObjectOutput out ) throws IOException
     {
         out.writeUTF( oid );
@@ -159,6 +164,7 @@ public class LdifControl implements Cont
     /**
      * {@inheritDoc}
      */
+    @Override
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
         oid = in.readUTF();
@@ -180,6 +186,7 @@ public class LdifControl implements Cont
     /**
      * @see Object#hashCode()
      */
+    @Override
     public int hashCode()
     {
         int h = 17;
@@ -201,6 +208,7 @@ public class LdifControl implements Cont
     /**
      * @see Object#equals(Object)
      */
+    @Override
     public boolean equals( Object o )
     {
         if ( o == this )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.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/ldif/LdifEntry.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java Tue May 31 09:32:09 2016
@@ -116,8 +116,8 @@ public class LdifEntry implements Clonea
     {
         // Default LDIF content
         changeType = ChangeType.None;
-        modificationList = new LinkedList<Modification>();
-        modifications = new HashMap<String, Modification>();
+        modificationList = new LinkedList<>();
+        modifications = new HashMap<>();
         entry = new DefaultEntry( ( Dn ) null );
         entryDn = null;
         controls = null;
@@ -131,8 +131,8 @@ public class LdifEntry implements Clonea
     {
         // Default LDIF content
         changeType = ChangeType.None;
-        modificationList = new LinkedList<Modification>();
-        modifications = new HashMap<String, Modification>();
+        modificationList = new LinkedList<>();
+        modifications = new HashMap<>();
         entry = new DefaultEntry( schemaManager, ( Dn ) null );
         entryDn = null;
         controls = null;
@@ -146,8 +146,8 @@ public class LdifEntry implements Clonea
     {
         // Default LDIF content
         changeType = ChangeType.None;
-        modificationList = new LinkedList<Modification>();
-        modifications = new HashMap<String, Modification>();
+        modificationList = new LinkedList<>();
+        modifications = new HashMap<>();
         this.entry = entry;
         entryDn = entry.getDn();
         controls = null;
@@ -196,7 +196,7 @@ public class LdifEntry implements Clonea
                 if ( !( ava instanceof String ) )
                 {
                     throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
-                        I18n.ERR_12085, ( pos + 1 ) ) );
+                        I18n.ERR_12085, pos + 1 ) );
                 }
 
                 String attribute = ( String ) ava;
@@ -226,7 +226,7 @@ public class LdifEntry implements Clonea
                 else
                 {
                     throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
-                        I18n.ERR_12086, ( pos + 1 ) ) );
+                        I18n.ERR_12086, pos + 1 ) );
                 }
 
                 valueExpected = false;
@@ -280,7 +280,7 @@ public class LdifEntry implements Clonea
 
                 case Modify:
                     modificationList = ldifEntry.getModifications();
-                    modifications = new HashMap<String, Modification>();
+                    modifications = new HashMap<>();
 
                     for ( Modification modification : modificationList )
                     {
@@ -874,7 +874,7 @@ public class LdifEntry implements Clonea
 
             if ( this.controls == null )
             {
-                this.controls = new ConcurrentHashMap<String, LdifControl>();
+                this.controls = new ConcurrentHashMap<>();
             }
 
             if ( control instanceof LdifControl )
@@ -896,6 +896,7 @@ public class LdifEntry implements Clonea
      * @return a clone of the current instance
      * @exception CloneNotSupportedException If there is some problem while cloning the instance
      */
+    @Override
     public LdifEntry clone() throws CloneNotSupportedException
     {
         LdifEntry clone = ( LdifEntry ) super.clone();
@@ -912,12 +913,12 @@ public class LdifEntry implements Clonea
 
         if ( modifications != null )
         {
-            for ( Map.Entry<String, Modification> entry : modifications.entrySet() )
+            for ( Map.Entry<String, Modification> modificationEntry : modifications.entrySet() )
             {
-                Modification modif = entry.getValue();
+                Modification modif = modificationEntry.getValue();
                 Modification modifClone = new DefaultModification( modif.getOperation(),
                     modif.getAttribute().clone() );
-                clone.modifications.put( entry.getKey(), modifClone );
+                clone.modifications.put( modificationEntry.getKey(), modifClone );
             }
 
         }
@@ -979,6 +980,7 @@ public class LdifEntry implements Clonea
      *
      * @return an enumeration of all contained attributes
      */
+    @Override
     public Iterator<Attribute> iterator()
     {
         return entry.iterator();
@@ -988,6 +990,7 @@ public class LdifEntry implements Clonea
     /**
      * @return a String representing the Entry, as a LDIF 
      */
+    @Override
     public String toString()
     {
         try
@@ -1006,6 +1009,7 @@ public class LdifEntry implements Clonea
      * 
      * @return the instance's hash code
      */
+    @Override
     public int hashCode()
     {
         int result = 37;
@@ -1096,6 +1100,7 @@ public class LdifEntry implements Clonea
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean equals( Object o )
     {
         // Basic equals checks
@@ -1256,16 +1261,16 @@ public class LdifEntry implements Clonea
                 return false;
             }
 
-            for ( Map.Entry<String, LdifControl> entry : controls.entrySet() )
+            for ( Map.Entry<String, LdifControl> controlEntry : controls.entrySet() )
             {
-                String controlOid = entry.getKey();
+                String controlOid = controlEntry.getKey();
 
                 if ( !otherControls.containsKey( controlOid ) )
                 {
                     return false;
                 }
 
-                Control thisControl = entry.getValue();
+                Control thisControl = controlEntry.getValue();
                 Control otherControl = otherControls.get( controlOid );
 
                 if ( thisControl == null )
@@ -1300,6 +1305,7 @@ public class LdifEntry implements Clonea
      * @throws IOException If the stream can't be read
      * @throws ClassNotFoundException If the LdifEntry can't be created 
      */
+    @Override
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
         // Read the changeType
@@ -1372,7 +1378,7 @@ public class LdifEntry implements Clonea
         // We have at least a control
         if ( nbControls > 0 )
         {
-            controls = new ConcurrentHashMap<String, LdifControl>( nbControls );
+            controls = new ConcurrentHashMap<>( nbControls );
 
             for ( int i = 0; i < nbControls; i++ )
             {
@@ -1391,6 +1397,7 @@ public class LdifEntry implements Clonea
      * @param out The stream in which the ChangeLogEvent will be serialized.
      * @throws IOException If the serialization fail
      */
+    @Override
     public void writeExternal( ObjectOutput out ) throws IOException
     {
         // Write the changeType

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.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/ldif/LdifReader.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java Tue May 31 09:32:09 2016
@@ -983,7 +983,7 @@ public class LdifReader implements Itera
         String attributeType = lowerLine.substring( 0, colonIndex );
 
         // We should *not* have a Dn twice
-        if ( attributeType.equals( "dn" ) )
+        if ( "dn".equals( attributeType ) )
         {
             LOG.error( I18n.err( I18n.ERR_12002_ENTRY_WITH_TWO_DNS, lineNumber ) );
             throw new LdapLdifException( I18n.err( I18n.ERR_12003_LDIF_ENTRY_WITH_TWO_DNS ) );
@@ -1236,7 +1236,7 @@ public class LdifReader implements Itera
                 }
 
                 // We should *not* have a Dn twice
-                if ( attributeType.equalsIgnoreCase( "dn" ) )
+                if ( "dn".equalsIgnoreCase( attributeType ) )
                 {
                     LOG.error( I18n.err( I18n.ERR_12002_ENTRY_WITH_TWO_DNS, lineNumber ) );
                     throw new LdapLdifException( I18n.err( I18n.ERR_12003_LDIF_ENTRY_WITH_TWO_DNS ) );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.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/ldif/LdifRevertor.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifRevertor.java Tue May 31 09:32:09 2016
@@ -136,7 +136,7 @@ public final class LdifRevertor
 
         // As the reversed modifications should be pushed in reversed order,
         // we create a list to temporarily store the modifications.
-        List<Modification> reverseModifications = new ArrayList<Modification>();
+        List<Modification> reverseModifications = new ArrayList<>();
 
         // Loop through all the modifications. For each modification, we will
         // have to apply it to the modified entry in order to be able to generate
@@ -236,7 +236,7 @@ public final class LdifRevertor
         }
 
         // Special case if we don't have any reverse modifications
-        if ( reverseModifications.size() == 0 )
+        if ( reverseModifications.isEmpty() )
         {
             throw new IllegalArgumentException( I18n.err( I18n.ERR_12073, forwardModifications ) );
         }
@@ -265,9 +265,9 @@ public final class LdifRevertor
     public static LdifEntry reverseMove( Dn newSuperiorDn, Dn modifiedDn ) throws LdapException
     {
         LdifEntry entry = new LdifEntry();
-        Dn currentParent = null;
-        Rdn currentRdn = null;
-        Dn newDn = null;
+        Dn currentParent;
+        Rdn currentRdn;
+        Dn newDn;
 
         if ( newSuperiorDn == null )
         {
@@ -445,7 +445,7 @@ public final class LdifRevertor
         throws LdapInvalidDnException
     {
         Dn parentDn = entry.getDn();
-        Dn newDn = null;
+        Dn newDn;
 
         if ( newRdn == null )
         {
@@ -469,7 +469,7 @@ public final class LdifRevertor
         newDn = newDn.getParent();
         newDn = newDn.add( newRdn );
 
-        List<LdifEntry> entries = new ArrayList<LdifEntry>( 1 );
+        List<LdifEntry> entries = new ArrayList<>( 1 );
         LdifEntry reverted = new LdifEntry();
 
         // Start with the cases here
@@ -530,7 +530,7 @@ public final class LdifRevertor
                 boolean overlapping = false;
                 boolean existInEntry = false;
 
-                Set<Ava> oldAtavs = new HashSet<Ava>();
+                Set<Ava> oldAtavs = new HashSet<>();
 
                 // We first build a set with all the oldRDN ATAVs
                 for ( Ava atav : oldRdn )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.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/ldif/LdifUtils.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java Tue May 31 09:32:09 2016
@@ -431,7 +431,7 @@ public final class LdifUtils
                 // Fallthrough
 
             case Add:
-                if ( ( entry.getEntry() == null ) )
+                if ( entry.getEntry() == null )
                 {
                     throw new LdapException( I18n.err( I18n.ERR_12082 ) );
                 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/AbstractAnonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/AbstractAnonymizer.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/ldif/anonymizer/AbstractAnonymizer.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/AbstractAnonymizer.java Tue May 31 09:32:09 2016
@@ -37,7 +37,7 @@ public abstract class AbstractAnonymizer
     protected SchemaManager schemaManager;
     
     /** The map of AttributeType'sOID we want to anonymize. They are all associated with anonymizers */
-    protected Map<String, Anonymizer> attributeAnonymizers = new HashMap<String, Anonymizer>();
+    protected Map<String, Anonymizer<K>> attributeAnonymizers = new HashMap<>();
     
     /** A flag set to <tt>true</tt> if the AttributeType is case sensitive */
     protected boolean caseSensitive = false;
@@ -86,6 +86,7 @@ public abstract class AbstractAnonymizer
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setSchemaManager( SchemaManager schemaManager )
     {
         this.schemaManager = schemaManager;
@@ -97,7 +98,8 @@ public abstract class AbstractAnonymizer
      *
      * @param attributeAnonymizers The list of existing anonymizers
      */
-    public void setAnonymizers( Map<String, Anonymizer> attributeAnonymizers )
+    @Override
+    public void setAnonymizers( Map<String, Anonymizer<K>> attributeAnonymizers )
     {
         this.attributeAnonymizers = attributeAnonymizers;
     }
@@ -106,6 +108,7 @@ public abstract class AbstractAnonymizer
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<Integer, String> getLatestStringMap()
     {
         return null;
@@ -115,6 +118,7 @@ public abstract class AbstractAnonymizer
     /**
      * @param latestValueMap The latest String anonymized value map
      */
+    @Override
     public void setLatestStringMap( Map<Integer, String> latestStringMap )
     {
         // Do nothing
@@ -124,6 +128,7 @@ public abstract class AbstractAnonymizer
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<Integer, byte[]> getLatestBytesMap()
     {
         return null;
@@ -133,6 +138,7 @@ public abstract class AbstractAnonymizer
     /**
      * @param latestBytesMap The latest byte[] anonymized value map
      */
+    @Override
     public void setLatestBytesMap( Map<Integer, byte[]> latestBytesMap )
     {
         // Do nothing

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/Anonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/Anonymizer.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/ldif/anonymizer/Anonymizer.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/Anonymizer.java Tue May 31 09:32:09 2016
@@ -60,7 +60,7 @@ public interface Anonymizer<K>
      *
      * @param attributeAnonymizers The list of existing anonymizers
      */
-    void setAnonymizers( Map<String, Anonymizer> attributeAnonymizers );
+    void setAnonymizers( Map<String, Anonymizer<K>> attributeAnonymizers );
     
     
     /**

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/BinaryAnonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/BinaryAnonymizer.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/ldif/anonymizer/BinaryAnonymizer.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/BinaryAnonymizer.java Tue May 31 09:32:09 2016
@@ -39,14 +39,14 @@ import org.apache.directory.api.ldap.mod
 public class BinaryAnonymizer extends AbstractAnonymizer<byte[]>
 {
     /** The latest anonymized byte[] value map */
-    protected Map<Integer, byte[]> latestBytesMap = new HashMap<Integer, byte[]>();
+    protected Map<Integer, byte[]> latestBytesMap = new HashMap<>();
 
     /**
      * Creates a new instance of BinaryAnonymizer.
      */
     public BinaryAnonymizer()
     {
-        latestBytesMap = new HashMap<Integer, byte[]>();
+        latestBytesMap = new HashMap<>();
     }
 
     
@@ -59,7 +59,7 @@ public class BinaryAnonymizer extends Ab
     {
         if ( latestBytesMap == null )
         {
-            this.latestBytesMap = new HashMap<Integer, byte[]>();
+            this.latestBytesMap = new HashMap<>();
         }
         else
         {
@@ -70,6 +70,7 @@ public class BinaryAnonymizer extends Ab
     /**
      * Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)
      */
+    @Override
     public Attribute anonymize( Map<Value, Value> valueMap, Set<Value> valueSet, Attribute attribute )
     {
         Attribute result = new DefaultAttribute( attribute.getAttributeType() );
@@ -88,7 +89,6 @@ public class BinaryAnonymizer extends Ab
             }
             catch ( LdapInvalidAttributeValueException e )
             {
-                // TODO Auto-generated catch block
                 throw new RuntimeException( "Error while anonymizing the value" + value );
             }
         }
@@ -100,6 +100,7 @@ public class BinaryAnonymizer extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<Integer, byte[]> getLatestBytesMap()
     {
         return latestBytesMap;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/CaseSensitiveStringAnonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/CaseSensitiveStringAnonymizer.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/ldif/anonymizer/CaseSensitiveStringAnonymizer.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/CaseSensitiveStringAnonymizer.java Tue May 31 09:32:09 2016
@@ -47,7 +47,7 @@ public class CaseSensitiveStringAnonymiz
      */
     public CaseSensitiveStringAnonymizer()
     {
-        latestStringMap = new HashMap<Integer, String>();
+        latestStringMap = new HashMap<>();
         caseSensitive = true;
     }
 
@@ -61,7 +61,7 @@ public class CaseSensitiveStringAnonymiz
     {
         if ( latestStringMap == null ) 
         {
-            this.latestStringMap = new HashMap<Integer, String>();
+            this.latestStringMap = new HashMap<>();
         }
         else
         {
@@ -75,6 +75,7 @@ public class CaseSensitiveStringAnonymiz
     /**
      * Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)
      */
+    @Override
     public Attribute anonymize( Map<Value, Value> valueMap, Set<Value> valueSet, Attribute attribute )
     {
         AttributeType attributeType = attribute.getAttributeType();
@@ -94,7 +95,6 @@ public class CaseSensitiveStringAnonymiz
                     }
                     catch ( LdapInvalidAttributeValueException e )
                     {
-                        // TODO : handle that
                     }
                 }
                 else
@@ -111,7 +111,6 @@ public class CaseSensitiveStringAnonymiz
                     }
                     catch ( LdapInvalidAttributeValueException e )
                     {
-                        // TODO Auto-generated catch block
                         throw new RuntimeException( "Error while anonymizing the value" + strValue );
                     }
                 }
@@ -125,6 +124,7 @@ public class CaseSensitiveStringAnonymiz
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<Integer, String> getLatestStringMap()
     {
         return latestStringMap;
@@ -134,6 +134,7 @@ public class CaseSensitiveStringAnonymiz
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setLatestStringMap( Map<Integer, String> latestStringMap )
     {
         this.latestStringMap = latestStringMap;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/IntegerAnonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/IntegerAnonymizer.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/ldif/anonymizer/IntegerAnonymizer.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/IntegerAnonymizer.java Tue May 31 09:32:09 2016
@@ -47,7 +47,7 @@ public class IntegerAnonymizer extends A
      */
     public IntegerAnonymizer()
     {
-        latestIntegerMap = new HashMap<Integer, String>();
+        latestIntegerMap = new HashMap<>();
     }
 
     
@@ -60,7 +60,7 @@ public class IntegerAnonymizer extends A
     {
         if ( latestIntegerMap == null ) 
         {
-            this.latestIntegerMap = new HashMap<Integer, String>();
+            this.latestIntegerMap = new HashMap<>();
         }
         else
         {
@@ -71,6 +71,7 @@ public class IntegerAnonymizer extends A
     /**
      * Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)
      */
+    @Override
     public Attribute anonymize( Map<Value, Value> valueMap, Set<Value> valueSet, Attribute attribute )
     {
         Attribute result = new DefaultAttribute( attribute.getAttributeType() );
@@ -94,7 +95,7 @@ public class IntegerAnonymizer extends A
                 }
                 else
                 {
-                    String strValue = value.getValue().toString();
+                    String strValue = value.getValue();
                     String newValue = computeNewIntegerValue( strValue );
     
                     try

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/StringAnonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/StringAnonymizer.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/ldif/anonymizer/StringAnonymizer.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/StringAnonymizer.java Tue May 31 09:32:09 2016
@@ -47,7 +47,7 @@ public class StringAnonymizer extends Ab
      */
     public StringAnonymizer()
     {
-        latestStringMap = new HashMap<Integer, String>();
+        latestStringMap = new HashMap<>();
         caseSensitive = false;
     }
 
@@ -61,7 +61,7 @@ public class StringAnonymizer extends Ab
     {
         if ( latestStringMap == null ) 
         {
-            this.latestStringMap = new HashMap<Integer, String>();
+            this.latestStringMap = new HashMap<>();
         }
         else
         {
@@ -75,6 +75,7 @@ public class StringAnonymizer extends Ab
     /**
      * Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)
      */
+    @Override
     public Attribute anonymize( Map<Value, Value> valueMap, Set<Value> valueSet, Attribute attribute )
     {
         AttributeType attributeType = attribute.getAttributeType();
@@ -99,7 +100,7 @@ public class StringAnonymizer extends Ab
                 }
                 else
                 {
-                    String strValue = value.getValue().toString();
+                    String strValue = value.getValue();
                     String newValue = computeNewValue( strValue );
                     
                     try
@@ -111,7 +112,6 @@ public class StringAnonymizer extends Ab
                     }
                     catch ( LdapInvalidAttributeValueException e )
                     {
-                        // TODO Auto-generated catch block
                         throw new RuntimeException( "Error while anonymizing the value" + strValue );
                     }
                 }
@@ -125,6 +125,7 @@ public class StringAnonymizer extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<Integer, String> getLatestStringMap()
     {
         return latestStringMap;
@@ -134,6 +135,7 @@ public class StringAnonymizer extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setLatestStringMap( Map<Integer, String> latestStringMap )
     {
         this.latestStringMap = latestStringMap;

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/TelephoneNumberAnonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/TelephoneNumberAnonymizer.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/ldif/anonymizer/TelephoneNumberAnonymizer.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/anonymizer/TelephoneNumberAnonymizer.java Tue May 31 09:32:09 2016
@@ -50,90 +50,4 @@ public class TelephoneNumberAnonymizer e
     {
         super( latestIntegerMap );
     }
-
-    /**
-     * Anonymize an attribute using pure random values (either chars of bytes, depending on the Attribute type)
-     *
-    public Attribute anonymize( Map<Value, Value> valueMap, Set<Value> valueSet, Attribute attribute )
-    {
-        Attribute result = new DefaultAttribute( attribute.getAttributeType() );
-
-        for ( Value value : attribute )
-        {
-            Value anonymized =  valueMap.get( value );
-            
-            if ( anonymized != null )
-            {
-                try
-                {
-                    result.add( anonymized.getString() );
-                }
-                catch ( LdapInvalidAttributeValueException e )
-                {
-                    // TODO : handle that
-                }
-            }
-            else
-            {
-                if ( value instanceof StringValue )
-                {
-                    String strValue = value.getNormValue().toString();
-                    int length = strValue.length();
-    
-                    // Same size
-                    char[] newValue = new char[length];
-    
-                    for ( int i = 0; i < length; i++ )
-                    {
-                        char c = ( strValue.charAt( i ) );
-                        
-                        if ( Character.isDigit( c ) )
-                        {
-                            newValue[i] = ( char ) ( random.nextInt( '9' - '0' ) + '0' );
-                        }
-                        else
-                        {
-                            newValue[i] = c;
-                        }
-                    }
-    
-                    try
-                    {
-                        String newValueStr = new String( newValue );
-                        result.add( newValueStr );
-                        
-                        Value anonValue = new Value( attribute.getAttributeType(), newValueStr );
-                        valueMap.put( ( Value ) value, anonValue );
-                    }
-                    catch ( LdapInvalidAttributeValueException e )
-                    {
-                        // TODO : handle that
-                    }
-                }
-                else
-                {
-                    byte[] byteValue = value.getBytes();
-    
-                    // Same size
-                    byte[] newValue = new byte[byteValue.length];
-    
-                    for ( int i = 0; i < byteValue.length; i++ )
-                    {
-                        newValue[i] = ( byte ) random.nextInt();
-                    }
-    
-                    try
-                    {
-                        result.add( newValue );
-                    }
-                    catch ( LdapInvalidAttributeValueException e )
-                    {
-                        // TODO : handle that
-                    }
-                }
-            }
-        }
-
-        return result;
-    }*/
 }

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbandonRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbandonRequestImpl.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/message/AbandonRequestImpl.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbandonRequestImpl.java Tue May 31 09:32:09 2016
@@ -60,6 +60,7 @@ public class AbandonRequestImpl extends
      * 
      * @return the id of the request message to abandon
      */
+    @Override
     public int getAbandoned()
     {
         return abandonId;
@@ -69,6 +70,7 @@ public class AbandonRequestImpl extends
     /**
      * {@inheritDoc}
      */
+    @Override
     public AbandonRequest setAbandoned( int abandonId )
     {
         this.abandonId = abandonId;
@@ -90,6 +92,7 @@ public class AbandonRequestImpl extends
     /**
      * {@inheritDoc}
      */
+    @Override
     public AbandonRequest setMessageId( int messageId )
     {
         super.setMessageId( messageId );
@@ -101,7 +104,8 @@ public class AbandonRequestImpl extends
     /**
      * {@inheritDoc}
      */
-    public AbandonRequest addControl( Control control )
+    @Override
+public AbandonRequest addControl( Control control )
     {
         return ( AbandonRequest ) super.addControl( control );
     }
@@ -110,6 +114,7 @@ public class AbandonRequestImpl extends
     /**
      * {@inheritDoc}
      */
+    @Override
     public AbandonRequest addAllControls( Control[] controls )
     {
         return ( AbandonRequest ) super.addAllControls( controls );
@@ -119,6 +124,7 @@ public class AbandonRequestImpl extends
     /**
      * {@inheritDoc}
      */
+    @Override
     public AbandonRequest removeControl( Control control )
     {
         return ( AbandonRequest ) super.removeControl( control );
@@ -133,6 +139,7 @@ public class AbandonRequestImpl extends
      * @param obj the object to test for equality to this AbandonRequest
      * @return true if the obj equals this request, false otherwise
      */
+    @Override
     public boolean equals( Object obj )
     {
         if ( this == obj )
@@ -160,6 +167,7 @@ public class AbandonRequestImpl extends
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int hash = 37;
@@ -175,6 +183,7 @@ public class AbandonRequestImpl extends
      * 
      * @return A String representing the AbandonRequest
      */
+    @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/message/AbstractAbandonableRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractAbandonableRequest.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/message/AbstractAbandonableRequest.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractAbandonableRequest.java Tue May 31 09:32:09 2016
@@ -54,6 +54,7 @@ public class AbstractAbandonableRequest
     }
 
 
+    @Override
     public void abandon()
     {
         if ( abandoned )
@@ -72,6 +73,7 @@ public class AbstractAbandonableRequest
     }
 
 
+    @Override
     public boolean isAbandoned()
     {
         return abandoned;
@@ -81,6 +83,7 @@ public class AbstractAbandonableRequest
     /**
      * {@inheritDoc}
      */
+    @Override
     public AbandonableRequest addAbandonListener( final AbandonListener listener )
     {
         if ( o == null )
@@ -90,6 +93,7 @@ public class AbstractAbandonableRequest
 
         o.addObserver( new Observer()
         {
+            @Override
             public void update( Observable o, Object arg )
             {
                 listener.requestAbandoned( AbstractAbandonableRequest.this );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractExtendedRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractExtendedRequest.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/message/AbstractExtendedRequest.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractExtendedRequest.java Tue May 31 09:32:09 2016
@@ -68,6 +68,7 @@ public abstract class AbstractExtendedRe
      * 
      * @return the dotted-decimal representation as a String of the OID
      */
+    @Override
     public String getRequestName()
     {
         return oid;
@@ -79,6 +80,7 @@ public abstract class AbstractExtendedRe
      * 
      * @param newOid the dotted-decimal representation as a String of the OID
      */
+    @Override
     public ExtendedRequest setRequestName( String newOid )
     {
         this.oid = newOid;
@@ -90,6 +92,7 @@ public abstract class AbstractExtendedRe
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedRequest setMessageId( int messageId )
     {
         super.setMessageId( messageId );
@@ -101,6 +104,7 @@ public abstract class AbstractExtendedRe
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedRequest addControl( Control control )
     {
         return ( ExtendedRequest ) super.addControl( control );
@@ -110,6 +114,7 @@ public abstract class AbstractExtendedRe
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedRequest addAllControls( Control[] controls )
     {
         return ( ExtendedRequest ) super.addAllControls( controls );
@@ -119,6 +124,7 @@ public abstract class AbstractExtendedRe
     /**
      * {@inheritDoc}
      */
+    @Override
     public ExtendedRequest removeControl( Control control )
     {
         return ( ExtendedRequest ) super.removeControl( control );
@@ -135,6 +141,7 @@ public abstract class AbstractExtendedRe
      * 
      * @return the message type of the response.
      */
+    @Override
     public MessageTypeEnum getResponseType()
     {
         return MessageTypeEnum.EXTENDED_RESPONSE;
@@ -146,6 +153,7 @@ public abstract class AbstractExtendedRe
      * 
      * @return the result containing response for this request
      */
+    @Override
     public abstract ExtendedResponse getResultResponse();
 
 
@@ -190,6 +198,7 @@ public abstract class AbstractExtendedRe
      * @param obj the object to be checked for equality
      * @return true if the obj equals this ExtendedRequest, false otherwise
      */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )
@@ -233,9 +242,10 @@ public abstract class AbstractExtendedRe
      * 
      * @return an Extended Request String
      */
+    @Override
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( "    Extended request\n" );
         sb.append( "        Request name : '" ).append( oid ).append( "'\n" );

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractMessage.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractMessage.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/message/AbstractMessage.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractMessage.java Tue May 31 09:32:09 2016
@@ -55,8 +55,8 @@ public abstract class AbstractMessage im
     {
         this.id = id;
         this.type = type;
-        controls = new HashMap<String, Control>();
-        parameters = new HashMap<Object, Object>();
+        controls = new HashMap<>();
+        parameters = new HashMap<>();
     }
 
 
@@ -68,6 +68,7 @@ public abstract class AbstractMessage im
      * 
      * @return the session unique message id.
      */
+    @Override
     public int getMessageId()
     {
         return id;
@@ -77,6 +78,7 @@ public abstract class AbstractMessage im
     /**
      * {@inheritDoc}
      */
+    @Override
     public Message setMessageId( int id )
     {
         this.id = id;
@@ -88,6 +90,7 @@ public abstract class AbstractMessage im
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<String, Control> getControls()
     {
         return Collections.unmodifiableMap( controls );
@@ -97,6 +100,7 @@ public abstract class AbstractMessage im
     /**
      * {@inheritDoc}
      */
+    @Override
     public Control getControl( String oid )
     {
         return controls.get( oid );
@@ -106,6 +110,7 @@ public abstract class AbstractMessage im
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean hasControl( String oid )
     {
         return controls.containsKey( oid );
@@ -115,6 +120,7 @@ public abstract class AbstractMessage im
     /**
      * {@inheritDoc}
      */
+    @Override
     public Message addControl( Control control )
     {
         controls.put( control.getOid(), control );
@@ -128,6 +134,7 @@ public abstract class AbstractMessage im
      * 
      * @param control the control to remove.
      */
+    @Override
     public Message removeControl( Control control )
     {
         controls.remove( control.getOid() );
@@ -143,6 +150,7 @@ public abstract class AbstractMessage im
      * 
      * @return the message type code.
      */
+    @Override
     public MessageTypeEnum getType()
     {
         return type;
@@ -162,6 +170,7 @@ public abstract class AbstractMessage im
      * @param key the key used to access a message parameter.
      * @return the transient message parameter value.
      */
+    @Override
     public Object get( Object key )
     {
         return parameters.get( key );
@@ -177,6 +186,7 @@ public abstract class AbstractMessage im
      * @param value the parameter value
      * @return the old value or null
      */
+    @Override
     public Object put( Object key, Object value )
     {
         return parameters.put( key, value );
@@ -191,6 +201,7 @@ public abstract class AbstractMessage im
      * 
      * @param obj the object to compare this Message to for equality
      */
+    @Override
     public boolean equals( Object obj )
     {
         if ( obj == this )
@@ -198,7 +209,7 @@ public abstract class AbstractMessage im
             return true;
         }
 
-        if ( ( obj == null ) || !( obj instanceof Message ) )
+        if ( !( obj instanceof Message ) )
         {
             return false;
         }
@@ -238,6 +249,7 @@ public abstract class AbstractMessage im
      * @see Object#hashCode()
      * @return the instance's hash code 
      */
+    @Override
     public int hashCode()
     {
         int hash = 37;
@@ -253,6 +265,7 @@ public abstract class AbstractMessage im
     /**
      * {@inheritDoc}
      */
+    @Override
     public Message addAllControls( Control[] controls )
     {
         for ( Control c : controls )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractRequest.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/message/AbstractRequest.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/AbstractRequest.java Tue May 31 09:32:09 2016
@@ -54,6 +54,7 @@ public class AbstractRequest extends Abs
      * 
      * @return true if any reply is generated, false if no response is generated
      */
+    @Override
     public boolean hasResponse()
     {
         return hasResponse;
@@ -71,7 +72,7 @@ public class AbstractRequest extends Abs
             return true;
         }
 
-        if ( ( obj == null ) || !( obj instanceof Request ) )
+        if ( !( obj instanceof Request ) )
         {
             return false;
         }




Mime
View raw message