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/05/16 17:16:38 UTC
svn commit: r1744092 - in
/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry:
AttributeUtils.java DefaultAttribute.java DefaultEntry.java
DefaultModification.java Entry.java
Author: elecharny
Date: Mon May 16 17:16:38 2016
New Revision: 1744092
URL: http://svn.apache.org/viewvc?rev=1744092&view=rev
Log:
Fixed numerous warnings
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
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=1744092&r1=1744091&r2=1744092&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 Mon May 16 17:16:38 2016
@@ -518,8 +518,6 @@ public final class AttributeUtils
if ( Chars.isAlpha( b ) )
{
// A DESCR
- //pos.start++;
-
while ( Chars.isAlphaDigitMinus( bytes, pos.start ) || ( relaxed && Strings.isCharASCII( bytes, pos.start, '_' ) ) )
{
pos.start++;
@@ -535,9 +533,6 @@ public final class AttributeUtils
}
else if ( Chars.isDigit( b ) )
{
- // An OID
- //pos.start++;
-
// Parse the OID
parseOID( bytes, pos );
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=1744092&r1=1744091&r2=1744092&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 Mon May 16 17:16:38 2016
@@ -54,7 +54,7 @@ public class DefaultAttribute implements
private AttributeType attributeType;
/** The set of contained values */
- private Set<Value> values = new LinkedHashSet<Value>();
+ private Set<Value> values = new LinkedHashSet<>();
/** The User provided ID */
private String upId;
@@ -68,53 +68,8 @@ public class DefaultAttribute implements
/** The computed hashcode. We don't want to compute it each time the hashcode() method is called */
private volatile int h;
-
-
- //-------------------------------------------------------------------------
- // Helper methods
- //-------------------------------------------------------------------------
- private Value createStringValue( AttributeType attributeType, String value )
- {
- Value newValue = null;
-
- if ( attributeType != null )
- {
- try
- {
- newValue = new Value( attributeType, value );
- }
- catch ( LdapInvalidAttributeValueException iae )
- {
- return null;
- }
- }
- else
- {
- newValue = new Value( value );
- }
-
- return newValue;
- }
-
-
- private Value createBinaryValue( AttributeType attributeType, byte[] value )
- throws LdapInvalidAttributeValueException
- {
- Value binaryValue = null;
-
- if ( attributeType != null )
- {
- binaryValue = new Value( attributeType, value );
- }
- else
- {
- binaryValue = new Value( value );
- }
-
- return binaryValue;
- }
-
-
+
+
//-------------------------------------------------------------------------
// Constructors
//-------------------------------------------------------------------------
@@ -478,9 +433,55 @@ public class DefaultAttribute implements
}
+ //-------------------------------------------------------------------------
+ // Helper methods
+ //-------------------------------------------------------------------------
+ private Value createStringValue( AttributeType attributeType, String value )
+ {
+ Value newValue;
+
+ if ( attributeType != null )
+ {
+ try
+ {
+ newValue = new Value( attributeType, value );
+ }
+ catch ( LdapInvalidAttributeValueException iae )
+ {
+ return null;
+ }
+ }
+ else
+ {
+ newValue = new Value( value );
+ }
+
+ return newValue;
+ }
+
+
+ private Value createBinaryValue( AttributeType attributeType, byte[] value )
+ throws LdapInvalidAttributeValueException
+ {
+ Value binaryValue;
+
+ if ( attributeType != null )
+ {
+ binaryValue = new Value( attributeType, value );
+ }
+ else
+ {
+ binaryValue = new Value( value );
+ }
+
+ return binaryValue;
+ }
+
+
/**
* {@inheritDoc}
*/
+ @Override
public byte[] getBytes() throws LdapInvalidAttributeValueException
{
Value value = get();
@@ -499,6 +500,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public String getString() throws LdapInvalidAttributeValueException
{
Value value = get();
@@ -517,6 +519,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public String getId()
{
return id;
@@ -526,6 +529,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public String getUpId()
{
return upId;
@@ -535,6 +539,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public void setUpId( String upId )
{
setUpId( upId, attributeType );
@@ -581,6 +586,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public void setUpId( String upId, AttributeType attributeType )
{
String trimmed = Strings.trim( upId );
@@ -682,6 +688,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public boolean isHumanReadable()
{
return isHR != null ? isHR : false;
@@ -691,6 +698,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public boolean isValid( AttributeType attributeType ) throws LdapInvalidAttributeValueException
{
LdapSyntax syntax = attributeType.getSyntax();
@@ -708,7 +716,7 @@ public class DefaultAttribute implements
}
// Check that we can have no value for this attributeType
- if ( values.size() == 0 )
+ if ( values.isEmpty() )
{
return syntaxChecker.isValidSyntax( null );
}
@@ -742,6 +750,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public int add( Value... vals )
{
int nbAdded = 0;
@@ -1007,6 +1016,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public int add( String... vals ) throws LdapInvalidAttributeValueException
{
int nbAdded = 0;
@@ -1156,7 +1166,7 @@ public class DefaultAttribute implements
{
for ( byte[] val : valArray )
{
- Value value = null;
+ Value value;
if ( attributeType == null )
{
@@ -1191,6 +1201,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public void clear()
{
values.clear();
@@ -1200,6 +1211,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public boolean contains( Value... vals )
{
if ( isHR == null )
@@ -1325,6 +1337,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public boolean contains( String... vals )
{
if ( isHR == null )
@@ -1484,6 +1497,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public Value get()
{
if ( values.isEmpty() )
@@ -1498,6 +1512,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public int size()
{
return values.size();
@@ -1507,9 +1522,10 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public boolean remove( Value... vals )
{
- if ( ( isHR == null ) || ( values.size() == 0 ) )
+ if ( ( isHR == null ) || ( values.isEmpty() ) )
{
// Trying to remove a value from an empty list will fail
return false;
@@ -1611,7 +1627,7 @@ public class DefaultAttribute implements
*/
public boolean remove( byte[]... vals )
{
- if ( ( isHR == null ) || ( values.size() == 0 ) )
+ if ( ( isHR == null ) || ( values.isEmpty() ) )
{
// Trying to remove a value from an empty list will fail
return false;
@@ -1671,9 +1687,10 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public boolean remove( String... vals )
{
- if ( ( isHR == null ) || ( values.size() == 0 ) )
+ if ( ( isHR == null ) || ( values.isEmpty() ) )
{
// Trying to remove a value from an empty list will fail
return false;
@@ -1735,6 +1752,7 @@ public class DefaultAttribute implements
*
* @return an iterator over the stored values.
*/
+ @Override
public Iterator<Value> iterator()
{
return values.iterator();
@@ -1744,6 +1762,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public AttributeType getAttributeType()
{
return attributeType;
@@ -1753,6 +1772,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException
{
if ( attributeType == null )
@@ -1777,7 +1797,7 @@ public class DefaultAttribute implements
if ( values != null )
{
- Set<Value> newValues = new LinkedHashSet<Value>( values.size() );
+ Set<Value> newValues = new LinkedHashSet<>( values.size() );
for ( Value value : values )
{
@@ -1804,6 +1824,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public boolean isInstanceOf( AttributeType attributeType ) throws LdapInvalidAttributeValueException
{
return ( attributeType != null )
@@ -1845,6 +1866,7 @@ public class DefaultAttribute implements
* @see Object#hashCode()
* @return the instance's hashcode
*/
+ @Override
public int hashCode()
{
if ( h == 0 )
@@ -1859,6 +1881,7 @@ public class DefaultAttribute implements
/**
* @see Object#equals(Object)
*/
+ @Override
public boolean equals( Object obj )
{
if ( obj == this )
@@ -1932,6 +1955,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public Attribute clone()
{
try
@@ -1944,7 +1968,7 @@ public class DefaultAttribute implements
attribute.attributeType = attributeType;
}
- attribute.values = new LinkedHashSet<Value>( values.size() );
+ attribute.values = new LinkedHashSet<>( values.size() );
for ( Value value : values )
{
@@ -1967,6 +1991,7 @@ public class DefaultAttribute implements
*
* {@inheritDoc}
*/
+ @Override
public void writeExternal( ObjectOutput out ) throws IOException
{
// Write the UPId (the id will be deduced from the upID)
@@ -2003,6 +2028,7 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
// Read the ID and the UPId
@@ -2024,7 +2050,7 @@ public class DefaultAttribute implements
{
for ( int i = 0; i < nbValues; i++ )
{
- Value value = null;
+ Value value;
if ( isHR )
{
@@ -2046,6 +2072,7 @@ public class DefaultAttribute implements
/**
* @see Object#toString()
*/
+ @Override
public String toString()
{
return toString( "" );
@@ -2055,11 +2082,12 @@ public class DefaultAttribute implements
/**
* {@inheritDoc}
*/
+ @Override
public String toString( String tabs )
{
StringBuilder sb = new StringBuilder();
- if ( ( values != null ) && ( values.size() != 0 ) )
+ if ( ( values != null ) && ( !values.isEmpty() ) )
{
boolean isFirst = true;
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=1744092&r1=1744091&r2=1744092&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 Mon May 16 17:16:38 2016
@@ -67,13 +67,13 @@ public final class DefaultEntry implemen
private Dn dn;
/** A map containing all the attributes for this entry */
- private Map<String, Attribute> attributes = new HashMap<String, Attribute>();
+ private Map<String, Attribute> attributes = new HashMap<>();
/** A speedup to get the ObjectClass attribute */
private static AttributeType objectClassAttributeType;
/** The SchemaManager */
- private SchemaManager schemaManager;
+ private transient SchemaManager schemaManager;
/** The computed hashcode. We don't want to compute it each time the hashcode() method is called */
private volatile int h;
@@ -300,7 +300,7 @@ public final class DefaultEntry implemen
}
// Init the attributes map
- attributes = new HashMap<String, Attribute>( entry.size() );
+ attributes = new HashMap<>( entry.size() );
// and copy all the attributes
for ( Attribute attribute : entry )
@@ -348,7 +348,7 @@ public final class DefaultEntry implemen
if ( !( element instanceof String ) )
{
throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
- I18n.ERR_12085, ( pos + 1 ) ) );
+ I18n.ERR_12085, pos + 1 ) );
}
String attribute = ( String ) element;
@@ -378,7 +378,7 @@ public final class DefaultEntry implemen
else
{
throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
- I18n.ERR_12086, ( pos + 1 ) ) );
+ I18n.ERR_12086, pos + 1 ) );
}
valueExpected = false;
@@ -396,9 +396,8 @@ public final class DefaultEntry implemen
try
{
reader = new LdifAttributesReader();
- Entry entry = reader.parseEntry( schemaManager, sb.toString() );
- return entry;
+ return reader.parseEntry( schemaManager, sb.toString() );
}
finally
{
@@ -411,7 +410,6 @@ public final class DefaultEntry implemen
}
catch ( IOException e )
{
- e.printStackTrace();
}
}
}
@@ -445,7 +443,7 @@ public final class DefaultEntry implemen
{
String normUpId = Strings.trim( upId );
- if ( ( attributeType == null ) )
+ if ( attributeType == null )
{
if ( Strings.isEmpty( normUpId ) )
{
@@ -656,6 +654,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Entry add( AttributeType attributeType, String... values ) throws LdapException
{
if ( attributeType == null )
@@ -688,6 +687,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Entry add( AttributeType attributeType, Value... values ) throws LdapException
{
if ( attributeType == null )
@@ -755,6 +755,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Entry add( String upId, AttributeType attributeType, Value... values ) throws LdapException
{
if ( attributeType == null )
@@ -787,6 +788,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Entry add( String upId, AttributeType attributeType, String... values ) throws LdapException
{
if ( attributeType == null )
@@ -821,6 +823,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Entry add( Attribute... attributes ) throws LdapException
{
// Loop on all the added attributes
@@ -924,6 +927,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Entry add( String upId, String... values ) throws LdapException
{
if ( Strings.isEmpty( upId ) )
@@ -968,6 +972,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Entry add( String upId, Value... values ) throws LdapException
{
if ( Strings.isEmpty( upId ) )
@@ -1014,6 +1019,7 @@ public final class DefaultEntry implemen
* the original object won't affect the cloned object, as a modification
* on the cloned object has no impact on the original object
*/
+ @Override
public Entry clone()
{
// First, clone the structure
@@ -1048,6 +1054,7 @@ public final class DefaultEntry implemen
* Shallow clone an entry. We don't clone the Attributes
*/
@SuppressWarnings("unchecked")
+ @Override
public Entry shallowClone()
{
try
@@ -1076,6 +1083,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean contains( Attribute... attributes )
{
if ( schemaManager == null )
@@ -1118,6 +1126,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean containsAttribute( String... attributes )
{
if ( schemaManager == null )
@@ -1159,6 +1168,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean containsAttribute( AttributeType attributeType )
{
if ( attributeType == null )
@@ -1196,6 +1206,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean contains( AttributeType attributeType, String... values )
{
if ( attributeType == null )
@@ -1219,6 +1230,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean contains( AttributeType attributeType, Value... values )
{
if ( attributeType == null )
@@ -1277,6 +1289,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean contains( String upId, String... values )
{
if ( Strings.isEmpty( upId ) )
@@ -1312,6 +1325,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean contains( String upId, Value... values )
{
if ( Strings.isEmpty( upId ) )
@@ -1347,6 +1361,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute get( String alias )
{
try
@@ -1384,6 +1399,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute get( AttributeType attributeType )
{
if ( attributeType != null )
@@ -1400,6 +1416,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Collection<Attribute> getAttributes()
{
return Collections.unmodifiableMap( attributes ).values();
@@ -1448,6 +1465,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute put( String upId, String... values )
{
if ( Strings.isEmpty( upId ) )
@@ -1487,6 +1505,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute put( String upId, Value... values )
{
if ( Strings.isEmpty( upId ) )
@@ -1563,10 +1582,11 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public List<Attribute> put( Attribute... attributes ) throws LdapException
{
// First, get the existing attributes
- List<Attribute> previous = new ArrayList<Attribute>();
+ List<Attribute> previous = new ArrayList<>();
if ( schemaManager == null )
{
@@ -1628,6 +1648,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute put( AttributeType attributeType, String... values ) throws LdapException
{
return put( null, attributeType, values );
@@ -1637,6 +1658,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute put( AttributeType attributeType, Value... values ) throws LdapException
{
return put( null, attributeType, values );
@@ -1696,6 +1718,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute put( String upId, AttributeType attributeType, String... values ) throws LdapException
{
if ( attributeType == null )
@@ -1739,6 +1762,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public Attribute put( String upId, AttributeType attributeType, Value... values ) throws LdapException
{
if ( attributeType == null )
@@ -1782,9 +1806,10 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public List<Attribute> remove( Attribute... attributes ) throws LdapException
{
- List<Attribute> removedAttributes = new ArrayList<Attribute>();
+ List<Attribute> removedAttributes = new ArrayList<>();
if ( schemaManager == null )
{
@@ -1868,6 +1893,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean remove( AttributeType attributeType, String... values ) throws LdapException
{
if ( attributeType == null )
@@ -1911,6 +1937,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean remove( AttributeType attributeType, Value... values ) throws LdapException
{
if ( attributeType == null )
@@ -1966,6 +1993,7 @@ public final class DefaultEntry implemen
* @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 )
{
if ( ( attributes == null ) || ( attributes.length == 0 ) || ( schemaManager == null ) )
@@ -1988,6 +2016,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public void removeAttributes( String... attributes )
{
if ( attributes.length == 0 )
@@ -2137,6 +2166,7 @@ public final class DefaultEntry implemen
* @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.
*/
+ @Override
public boolean remove( String upId, String... values ) throws LdapException
{
if ( Strings.isEmpty( upId ) )
@@ -2216,6 +2246,7 @@ public final class DefaultEntry implemen
* @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.
*/
+ @Override
public boolean remove( String upId, Value... values ) throws LdapException
{
if ( Strings.isEmpty( upId ) )
@@ -2279,6 +2310,7 @@ public final class DefaultEntry implemen
*
* @return The entry's Dn
*/
+ @Override
public Dn getDn()
{
return dn;
@@ -2288,6 +2320,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public void setDn( Dn dn )
{
this.dn = dn;
@@ -2300,6 +2333,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public void setDn( String dn ) throws LdapInvalidDnException
{
setDn( new Dn( dn ) );
@@ -2309,6 +2343,7 @@ public final class DefaultEntry implemen
/**
* Remove all the attributes for this entry. The Dn is not reset
*/
+ @Override
public void clear()
{
attributes.clear();
@@ -2322,6 +2357,7 @@ public final class DefaultEntry implemen
*
* @return an enumeration of all contained attributes
*/
+ @Override
public Iterator<Attribute> iterator()
{
return Collections.unmodifiableMap( attributes ).values().iterator();
@@ -2333,6 +2369,7 @@ public final class DefaultEntry implemen
*
* @return the number of attributes
*/
+ @Override
public int size()
{
return attributes.size();
@@ -2358,6 +2395,7 @@ public final class DefaultEntry implemen
*
* {@inheritDoc}
*/
+ @Override
public void writeExternal( ObjectOutput out ) throws IOException
{
// First, the Dn
@@ -2390,6 +2428,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
// Read the Dn
@@ -2437,6 +2476,7 @@ public final class DefaultEntry implemen
* @see java.lang.Object#hashCode()
* @return the instance's hash code
*/
+ @Override
public int hashCode()
{
if ( h == 0 )
@@ -2451,6 +2491,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean hasObjectClass( String... objectClasses )
{
if ( ( objectClasses == null ) || ( objectClasses.length == 0 ) || ( objectClasses[0] == null ) )
@@ -2483,6 +2524,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean hasObjectClass( Attribute... objectClasses )
{
if ( ( objectClasses == null ) || ( objectClasses.length == 0 ) || ( objectClasses[0] == null ) )
@@ -2523,6 +2565,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public boolean isSchemaAware()
{
return schemaManager != null;
@@ -2532,6 +2575,7 @@ public final class DefaultEntry implemen
/**
* @see Object#equals(Object)
*/
+ @Override
public boolean equals( Object o )
{
// Short circuit
@@ -2585,6 +2629,7 @@ public final class DefaultEntry implemen
/**
* @see Object#toString()
*/
+ @Override
public String toString()
{
return toString( "" );
@@ -2594,6 +2639,7 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
+ @Override
public String toString( String tabs )
{
StringBuilder sb = new StringBuilder();
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=1744092&r1=1744091&r2=1744092&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 Mon May 16 17:16:38 2016
@@ -59,6 +59,7 @@ public class DefaultModification impleme
*/
public DefaultModification()
{
+ // Default empty constructor
}
@@ -223,6 +224,7 @@ public class DefaultModification impleme
/**
* {@inheritDoc}
*/
+ @Override
public ModificationOperation getOperation()
{
return operation;
@@ -232,6 +234,7 @@ public class DefaultModification impleme
/**
* {@inheritDoc}
*/
+ @Override
public void setOperation( int operation )
{
this.operation = ModificationOperation.getOperation( operation );
@@ -241,6 +244,7 @@ public class DefaultModification impleme
/**
* {@inheritDoc}
*/
+ @Override
public void setOperation( ModificationOperation operation )
{
this.operation = operation;
@@ -250,6 +254,7 @@ public class DefaultModification impleme
/**
* {@inheritDoc}
*/
+ @Override
public Attribute getAttribute()
{
return attribute;
@@ -259,6 +264,7 @@ public class DefaultModification impleme
/**
* {@inheritDoc}
*/
+ @Override
public void setAttribute( Attribute attribute )
{
this.attribute = attribute;
@@ -268,6 +274,7 @@ public class DefaultModification impleme
/**
* {@inheritDoc}
*/
+ @Override
public void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException
{
this.attributeType = attributeType;
@@ -292,6 +299,7 @@ public class DefaultModification impleme
* @see Object#equals(Object)
* @return <code>true</code> if both values are equal
*/
+ @Override
public boolean equals( Object that )
{
// Basic equals checks
@@ -327,6 +335,7 @@ public class DefaultModification impleme
* Compute the modification @see Object#hashCode
* @return the instance's hash code
*/
+ @Override
public int hashCode()
{
int h = 37;
@@ -341,6 +350,7 @@ public class DefaultModification impleme
/**
* @see java.io.Externalizable#readExternal(ObjectInput)
*/
+ @Override
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
// The operation
@@ -360,6 +370,7 @@ public class DefaultModification impleme
/**
* @see java.io.Externalizable#writeExternal(ObjectOutput)
*/
+ @Override
public void writeExternal( ObjectOutput out ) throws IOException
{
// The operation
@@ -383,6 +394,7 @@ public class DefaultModification impleme
/**
* {@inheritDoc}
*/
+ @Override
public DefaultModification clone()
{
try
@@ -402,6 +414,7 @@ public class DefaultModification impleme
/**
* @see Object#toString()
*/
+ @Override
public String toString()
{
StringBuilder sb = new StringBuilder();
Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/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=1744092&r1=1744091&r2=1744092&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 Mon May 16 17:16:38 2016
@@ -147,6 +147,7 @@ public interface Entry extends Cloneable
*
* @return an iterator on top of all contained attributes
*/
+ @Override
Iterator<Attribute> iterator();