You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2016/09/02 07:12:42 UTC

svn commit: r1758883 - in /directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model: entry/ ldif/ schema/

Author: elecharny
Date: Fri Sep  2 07:12:42 2016
New Revision: 1758883

URL: http://svn.apache.org/viewvc?rev=1758883&view=rev
Log:
Updated Javadocs

Modified:
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifReader.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/MatchingRuleUse.java

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java Fri Sep  2 07:12:42 2016
@@ -119,6 +119,7 @@ public final class AttributeUtils
      * (Ldap attributeTypes are *always* case insensitive)
      * 
      * @param attributes The Attributes to check
+     * @return The modified Attributes
      */
     public static Attributes toCaseInsensitive( Attributes attributes )
     {
@@ -426,7 +427,10 @@ public final class AttributeUtils
      *
      * @param str The parsed attribute,
      * @param pos The position of the attribute in the current string
+     * @param withOption A flag set if we want to parse the options
+     * @param relaxed A flag set if we want to parse without being too strict
      * @return The parsed attribute if valid
+     * @throws ParseException If we had an issue while parsing the attribute
      */
     public static String parseAttribute( char[] str, Position pos, boolean withOption, boolean relaxed )
         throws ParseException
@@ -500,7 +504,10 @@ public final class AttributeUtils
      *
      * @param bytes The parsed attribute,
      * @param pos The position of the attribute in the current string
+     * @param withOption A flag set if we want to parse the options
+     * @param relaxed A flag set if we want to parse without being too strict
      * @return The parsed attribute if valid
+     * @throws ParseException If we had an issue while parsing the attribute
      */
     public static String parseAttribute( byte[] bytes, Position pos, boolean withOption, boolean relaxed )
         throws ParseException
@@ -556,7 +563,7 @@ public final class AttributeUtils
      * 
      * @param entry The entry on which we want to apply a modification
      * @param modification the Modification to be applied
-     * @throws org.apache.directory.api.ldap.model.exception.LdapException if some operation fails.
+     * @throws LdapException if some operation fails.
      */
     public static void applyModification( Entry entry, Modification modification ) throws LdapException
     {
@@ -748,6 +755,7 @@ public final class AttributeUtils
      *
      * @param jndiAttribute the JNDI Attribute instance to convert
      * @return An instance of a LDAP API Attribute object
+     * @throws LdapInvalidAttributeValueException If the attribute is invalid
      */
     public static Attribute toApiAttribute( javax.naming.directory.Attribute jndiAttribute )
         throws LdapInvalidAttributeValueException

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java Fri Sep  2 07:12:42 2016
@@ -289,6 +289,7 @@ public class DefaultAttribute implements
      * </p>
      * @param attributeType the attribute type according to the schema
      * @param vals an initial set of values for this attribute
+     * @throws LdapInvalidAttributeValueException If one of the value is invalid
      */
     public DefaultAttribute( AttributeType attributeType, Value... vals ) throws LdapInvalidAttributeValueException
     {
@@ -383,6 +384,7 @@ public class DefaultAttribute implements
      *
      * @param attributeType The attribute's type
      * @param attribute The attribute to be copied
+     * @throws LdapException If the attribute can't be created
      */
     public DefaultAttribute( AttributeType attributeType, Attribute attribute ) throws LdapException
     {

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java Fri Sep  2 07:12:42 2016
@@ -49,8 +49,8 @@ import org.slf4j.LoggerFactory;
 
 /**
  * A default implementation of a ServerEntry which should suite most
- * use cases.<br/>
- * <br/>
+ * use cases.<br>
+ * <br>
  * This class is final, it should not be extended.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -208,7 +208,9 @@ public final class DefaultEntry implemen
      * Dn and a list of IDs.
      *
      * @param dn The Dn for this serverEntry. Can be null.
-     * @param upIds The list of attributes to create.
+     * @param elements The list of elements to inject in the entry
+     * @throws LdapException If the elements are invalid
+     * @throws LdapException If the provided Dn or elements are invalid
      */
     public DefaultEntry( String dn, Object... elements ) throws LdapException
     {
@@ -221,7 +223,8 @@ public final class DefaultEntry implemen
      * Dn and a list of IDs.
      *
      * @param dn The Dn for this serverEntry. Can be null.
-     * @param upIds The list of attributes to create.
+     * @param elements The list of attributes to create.
+     * @throws LdapException If the provided Dn or elements are invalid
      */
     public DefaultEntry( Dn dn, Object... elements ) throws LdapException
     {
@@ -233,8 +236,10 @@ public final class DefaultEntry implemen
      * Creates a new instance of DefaultEntry, with a
      * Dn and a list of IDs.
      *
+     * @param schemaManager The SchemaManager
      * @param dn The Dn for this serverEntry. Can be null.
-     * @param upIds The list of attributes to create.
+     * @param elements The list of attributes to create.
+     * @throws LdapException If the provided Dn or elements are invalid
      */
     public DefaultEntry( SchemaManager schemaManager, String dn, Object... elements ) throws LdapException
     {
@@ -246,8 +251,10 @@ public final class DefaultEntry implemen
      * Creates a new instance of DefaultEntry, with a
      * Dn and a list of IDs.
      *
+     * @param schemaManager The reference to the schemaManager
      * @param dn The Dn for this serverEntry. Can be null.
-     * @param upIds The list of attributes to create.
+     * @param elements The list of attributes to create.
+     * @throws LdapException If the provided Dn or Elements are invalid
      */
     public DefaultEntry( SchemaManager schemaManager, Dn dn, Object... elements ) throws LdapException
     {
@@ -280,6 +287,7 @@ public final class DefaultEntry implemen
      *
      * @param schemaManager The reference to the schemaManager
      * @param entry the entry to copy
+     * @throws LdapException If the provided entry is invalid
      */
     public DefaultEntry( SchemaManager schemaManager, Entry entry ) throws LdapException
     {
@@ -1544,43 +1552,6 @@ public final class DefaultEntry implemen
 
     /**
      * {@inheritDoc}
-     **
-    public List<Attribute> set( AttributeType... attributeTypes )
-    {
-        List<Attribute> removed = new ArrayList<Attribute>();
-
-        // Now, loop on all the attributeType to add
-        for ( AttributeType attributeType : attributeTypes )
-        {
-            if ( attributeType == null )
-            {
-                String message = I18n.err( I18n.ERR_04467 );
-                LOG.error( message );
-                continue;
-            }
-
-            Attribute attribute = attributes.put( attributeType.getOid(),
-                new DefaultAttribute( attributeType ) );
-
-            if ( attribute != null )
-            {
-                removed.add( attribute );
-            }
-        }
-
-        if ( removed.size() == 0 )
-        {
-            return null;
-        }
-        else
-        {
-            return removed;
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
      */
     @Override
     public List<Attribute> put( Attribute... attributes ) throws LdapException
@@ -1991,7 +1962,6 @@ public final class DefaultEntry implemen
      * </p>
      *
      * @param attributes the AttributeTypes to be removed
-     * @return the removed attributes, if any, as a list; otherwise <code>null</code>
      */
     @Override
     public void removeAttributes( AttributeType... attributes )
@@ -2379,7 +2349,7 @@ public final class DefaultEntry implemen
     /**
      * This is the place where we serialize entries, and all theirs
      * elements.
-     * <br/>
+     * <br>
      * The structure used to store the entry is the following :
      * <ul>
      *   <li>

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java Fri Sep  2 07:12:42 2016
@@ -137,6 +137,7 @@ public class DefaultModification impleme
      * @param operation The modification operation
      * @param attributeType The associated attributeType
      * @param values the associated values
+     * @throws LdapInvalidAttributeValueException If the value is invalid
      */
     public DefaultModification( ModificationOperation operation, AttributeType attributeType, String... values )
         throws LdapInvalidAttributeValueException
@@ -152,6 +153,7 @@ public class DefaultModification impleme
      * @param operation The modification operation
      * @param attributeType The associated attributeType
      * @param values the associated values
+     * @throws LdapInvalidAttributeValueException If the value is invalid
      */
     public DefaultModification( ModificationOperation operation, AttributeType attributeType, byte[]... values )
         throws LdapInvalidAttributeValueException
@@ -167,6 +169,7 @@ public class DefaultModification impleme
      * @param operation The modification operation
      * @param attributeType The associated attributeType
      * @param values the associated values
+     * @throws LdapInvalidAttributeValueException If the value is invalid
      */
     public DefaultModification( ModificationOperation operation, AttributeType attributeType, Value... values )
         throws LdapInvalidAttributeValueException
@@ -181,6 +184,7 @@ public class DefaultModification impleme
      *
      * @param operation The modification operation
      * @param attributeType The associated attributeType
+     * @throws LdapInvalidAttributeValueException If the value is invalid
      */
     public DefaultModification( ModificationOperation operation, AttributeType attributeType )
         throws LdapInvalidAttributeValueException

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java Fri Sep  2 07:12:42 2016
@@ -31,11 +31,11 @@ import org.apache.directory.api.ldap.mod
 
 
 /**
- * <p>
  * This interface represent a LDAP entry. An LDAP entry contains :
- * <li> A distinguished name (Dn)</li>
- * <li> A list of attributes</li>
- * </p>
+ * <ul>
+ *   <li> A distinguished name (Dn)</li>
+ *   <li> A list of attributes</li>
+ * </ul>
  * <p>
  * The available methods on this object are described in this interface.
  * </p>
@@ -54,12 +54,16 @@ public interface Entry extends Cloneable
 
     /**
      * Clone the current entry
+     * 
+     * @return a full copy of this entry
      */
     Entry clone();
 
 
     /**
      * Shallow Clone the current entry. We don't deep clone the attributes
+     * 
+     * @return a shallow copy of this entry
      */
     Entry shallowClone();
 
@@ -432,7 +436,8 @@ public interface Entry extends Cloneable
      * <code>null</code> value: the value may be <code>null</code>.
      *
      * @param upId The User Provided ID to be stored into the AttributeEntry
-     * @param values the binary values of the new attribute to be put
+     * @param attributeType The attributeType to use
+     * @param values The values to store
      * @return the old attribute with the same identifier, if exists; otherwise
      * <code>null</code>
      * @throws LdapException if there are failures.
@@ -560,6 +565,7 @@ public interface Entry extends Cloneable
      * @param values the values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if not all the values have been removed or if the attribute does not exist. 
+     * @throws LdapException If the removal failed
      */
     boolean remove( AttributeType attributeType, byte[]... values ) throws LdapException;
 
@@ -584,6 +590,7 @@ public interface Entry extends Cloneable
      * @param values the values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if not all the values have been removed or if the attribute does not exist. 
+     * @throws LdapException If the removal failed
      */
     boolean remove( AttributeType attributeType, String... values ) throws LdapException;
 
@@ -608,6 +615,7 @@ public interface Entry extends Cloneable
      * @param values the values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if not all the values have been removed or if the attribute does not exist. 
+     * @throws LdapException If the removal failed
      */
     boolean remove( AttributeType attributeType, Value... values ) throws LdapException;
 
@@ -619,6 +627,7 @@ public interface Entry extends Cloneable
      *
      * @param attributes the attributes to be removed
      * @return the removed attribute, if exists; otherwise <code>null</code>
+     * @throws LdapException If the removal failed
      */
     List<Attribute> remove( Attribute... attributes ) throws LdapException;
 
@@ -636,7 +645,6 @@ public interface Entry extends Cloneable
      * </p>
      *
      * @param attributes the AttributeTypes to be removed
-     * @return the removed attributes, if any, as a list; otherwise <code>null</code>
      */
     void removeAttributes( AttributeType... attributes );
 
@@ -661,6 +669,7 @@ public interface Entry extends Cloneable
      * @param values the attribute's values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if not all the values have been removed or if the attribute does not exist. 
+     * @throws LdapException If the removal failed
      */
     boolean remove( String upId, byte[]... values ) throws LdapException;
 
@@ -685,6 +694,7 @@ public interface Entry extends Cloneable
      * @param values the attribute's values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if no values have been removed or if the attribute does not exist. 
+     * @throws LdapException If the provided values are invalid
      */
     boolean remove( String upId, String... values ) throws LdapException;
 
@@ -727,7 +737,6 @@ public interface Entry extends Cloneable
       * </p>
       *
       * @param attributes an aliased name of the attribute to be removed
-      * @return the removed attributes, if any, as a list; otherwise <code>null</code>
       */
     void removeAttributes( String... attributes );
 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java Fri Sep  2 07:12:42 2016
@@ -57,6 +57,8 @@ public class ImmutableEntry implements E
      * Creates a new instance of DefaultEntry. 
      * <p>
      * This entry <b>must</b> be initialized before being used !
+     * 
+     * @param entry The encapsulated entry
      */
     public ImmutableEntry( Entry entry )
     {
@@ -477,7 +479,6 @@ public Entry add( String upId, Value...
      * </p>
      *
      * @param attributes the AttributeTypes to be removed
-     * @return the removed attributes, if any, as a list; otherwise <code>null</code>
      */
     @Override
     public void removeAttributes( AttributeType... attributes )
@@ -658,7 +659,7 @@ public Entry add( String upId, Value...
     /**
      * This is the place where we serialize entries, and all theirs
      * elements.
-     * <br/>
+     * <br>
      * The structure used to store the entry is the following :
      * <ul>
      *   <li>

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java Fri Sep  2 07:12:42 2016
@@ -81,7 +81,8 @@ public interface Modification extends Cl
     /**
      * Apply the AttributeType to the Modification
      * 
-     * @param AttributeType the injected AttributeType
+     * @param attributeType the injected AttributeType
+     * @throws LdapInvalidAttributeValueException If the Modification is invalid
      */
     void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException;
 }
\ No newline at end of file

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java Fri Sep  2 07:12:42 2016
@@ -363,6 +363,7 @@ public class Value implements Cloneable,
      *
      * @param attributeType the schema attribute type associated with this StringValue
      * @param value the original Value
+     * @throws LdapInvalidAttributeValueException If the value is invalid
      */
     public Value( AttributeType attributeType, Value value ) throws LdapInvalidAttributeValueException
     {
@@ -820,7 +821,7 @@ public class Value implements Cloneable,
      * @return A new Value instance
      * @throws IOException If the stream can't be read
      * @throws ClassNotFoundException If we can't instanciate a Value
-     * @throws LdapInvalidAttributeValueException 
+     * @throws LdapInvalidAttributeValueException If the value is invalid
      */
     public static Value deserialize( ObjectInput in ) throws IOException, ClassNotFoundException, LdapInvalidAttributeValueException
     {
@@ -839,7 +840,6 @@ public class Value implements Cloneable,
      * @return A new Value instance
      * @throws IOException If the stream can't be read
      * @throws ClassNotFoundException If we can't instanciate a Value
-     * @throws LdapInvalidAttributeValueException 
      */
     public static Value deserialize( AttributeType attributeType, ObjectInput in ) throws IOException, ClassNotFoundException
     {
@@ -857,7 +857,7 @@ public class Value implements Cloneable,
      * @param pos The position in the buffer
      * @return The new position
      * @throws IOException If the serialized value is not a StringValue
-     * @throws LdapInvalidAttributeValueException 
+     * @throws LdapInvalidAttributeValueException If the value is invalid
      */
     public int deserialize( byte[] buffer, int pos ) throws IOException, LdapInvalidAttributeValueException
     {

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=1758883&r1=1758882&r2=1758883&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 Fri Sep  2 07:12:42 2016
@@ -277,6 +277,35 @@ public class LdifReader implements Itera
 
 
     /**
+     * Store the reader and intialize the LdifReader
+     */
+    private void initReader( BufferedReader reader ) throws LdapException
+    {
+        this.reader = reader;
+        init();
+    }
+
+
+    /**
+     * Initialize the LdifReader
+     * 
+     * @throws LdapException If the initialization failed
+     */
+    public void init() throws LdapException
+    {
+        lines = new ArrayList<String>();
+        position = 0;
+        version = DEFAULT_VERSION;
+        containsChanges = false;
+        containsEntries = false;
+
+        // First get the version - if any -
+        version = parseVersion();
+        prefetched = parseEntry();
+    }
+
+
+    /**
      * A constructor which takes a file name. Default charset is used.
      *
      * @param ldifFileName A file name containing ldif formated input
@@ -372,35 +401,6 @@ public class LdifReader implements Itera
 
 
     /**
-     * Store the reader and intialize the LdifReader
-     */
-    private void initReader( BufferedReader reader ) throws LdapException
-    {
-        this.reader = reader;
-        init();
-    }
-
-
-    /**
-     * Initialize the LdifReader
-     * 
-     * @throws LdapException If the initialization failed
-     */
-    public void init() throws LdapException
-    {
-        lines = new ArrayList<>();
-        position = 0;
-        version = DEFAULT_VERSION;
-        containsChanges = false;
-        containsEntries = false;
-
-        // First get the version - if any -
-        version = parseVersion();
-        prefetched = parseEntry();
-    }
-
-
-    /**
      * @return The ldif file version
      */
     public int getVersion()
@@ -985,7 +985,7 @@ public class LdifReader implements Itera
         String attributeType = lowerLine.substring( 0, colonIndex );
 
         // We should *not* have a Dn twice
-        if ( "dn".equals( attributeType ) )
+        if ( attributeType.equals( "dn" ) )
         {
             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 ) );
@@ -1110,7 +1110,8 @@ public class LdifReader implements Itera
      * <pre>
      * &lt;changerecord&gt; ::= "changetype:" FILL "modify" SEP &lt;mod-spec&gt; &lt;mod-specs-e&gt;
      * &lt;mod-spec&gt; ::= "add:" &lt;mod-val&gt; | "delete:" &lt;mod-val-del&gt; | "replace:" &lt;mod-val&gt;
-     * &lt;mod-specs-e&gt; ::= &lt;mod-spec&gt; | e
+     * &lt;mod-specs-e&gt; ::= &lt;mod-spec&gt;
+     * &lt;mod-specs-e&gt; | e
      * &lt;mod-val&gt; ::= FILL ATTRIBUTE-DESCRIPTION SEP ATTRVAL-SPEC &lt;attrval-specs-e&gt; "-" SEP
      * &lt;mod-val-del&gt; ::= FILL ATTRIBUTE-DESCRIPTION SEP &lt;attrval-specs-e&gt; "-" SEP
      * &lt;attrval-specs-e&gt; ::= ATTRVAL-SPEC &lt;attrval-specs&gt; | e
@@ -1238,7 +1239,7 @@ public class LdifReader implements Itera
                 }
 
                 // We should *not* have a Dn twice
-                if ( "dn".equalsIgnoreCase( attributeType ) )
+                if ( attributeType.equalsIgnoreCase( "dn" ) )
                 {
                     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 ) );
@@ -1399,7 +1400,7 @@ public class LdifReader implements Itera
      */
     protected LdifEntry parseEntry() throws LdapException
     {
-        if ( ( lines == null ) || lines.isEmpty() )
+        if ( ( lines == null ) || ( lines.size() == 0 ) )
         {
             LOG.debug( "The entry is empty : end of ldif file" );
             return null;
@@ -1589,7 +1590,7 @@ public class LdifReader implements Itera
         // First, read a list of lines
         readLines();
 
-        if ( lines.isEmpty() )
+        if ( lines.size() == 0 )
         {
             LOG.warn( "The ldif file is empty" );
             return ver;
@@ -1633,7 +1634,7 @@ public class LdifReader implements Itera
             lines.remove( 0 );
 
             // and read the next lines if the current buffer is empty
-            if ( lines.isEmpty() )
+            if ( lines.size() == 0 )
             {
                 // include the version line as part of the first entry
                 int tmpEntryLen = entryLen;
@@ -1682,7 +1683,7 @@ public class LdifReader implements Itera
         entryLen = 0;
         entryOffset = offset;
 
-        StringBuilder sb = new StringBuilder();
+        StringBuffer sb = new StringBuffer();
 
         try
         {
@@ -1742,7 +1743,7 @@ public class LdifReader implements Itera
                             lines.add( sb.toString() );
                         }
 
-                        sb = new StringBuilder( line );
+                        sb = new StringBuffer( line );
                         insideComment = false;
                         break;
                 }
@@ -1853,7 +1854,7 @@ public class LdifReader implements Itera
 
         if ( Strings.isEmpty( ldif ) )
         {
-            return new ArrayList<>();
+            return new ArrayList<LdifEntry>();
         }
 
         BufferedReader bufferReader = new BufferedReader( new StringReader( ldif ) );
@@ -2016,19 +2017,16 @@ public class LdifReader implements Itera
     /**
      * @return An iterator on the file
      */
-    @Override
     public Iterator<LdifEntry> iterator()
     {
         return new Iterator<LdifEntry>()
         {
-            @Override
             public boolean hasNext()
             {
                 return hasNextInternal();
             }
 
 
-            @Override
             public LdifEntry next()
             {
                 try
@@ -2043,7 +2041,6 @@ public class LdifReader implements Itera
             }
 
 
-            @Override
             public void remove()
             {
                 throw new UnsupportedOperationException();
@@ -2081,7 +2078,7 @@ public class LdifReader implements Itera
     public List<LdifEntry> parseLdif( BufferedReader reader ) throws LdapException
     {
         // Create a list that will contain the read entries
-        List<LdifEntry> entries = new ArrayList<>();
+        List<LdifEntry> entries = new ArrayList<LdifEntry>();
 
         this.reader = reader;
 
@@ -2175,7 +2172,6 @@ public class LdifReader implements Itera
     /**
      * {@inheritDoc}
      */
-    @Override
     public void close() throws IOException
     {
         if ( reader != null )

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/MatchingRuleUse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/MatchingRuleUse.java?rev=1758883&r1=1758882&r2=1758883&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/MatchingRuleUse.java (original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/MatchingRuleUse.java Fri Sep  2 07:12:42 2016
@@ -214,7 +214,7 @@ public class MatchingRuleUse extends Abs
      * @see Object#toString()
      */
     @Override
-	public String toString()
+    public String toString()
     {
         return SchemaObjectRenderer.OPEN_LDAP_SCHEMA_RENDERER.render( this );
     }