You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2010/09/30 15:39:05 UTC
svn commit: r1003063 - in
/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap:
aci/protectedItem/ entry/ exception/ filter/ schema/comparators/ util/
util/tree/
Author: seelmann
Date: Thu Sep 30 13:39:04 2010
New Revision: 1003063
URL: http://svn.apache.org/viewvc?rev=1003063&view=rev
Log:
Fix checkstyle errors: UnusedImports and some Javadoc
Modified:
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeValueItem.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapConfigurationException.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ComparableComparator.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeValueItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeValueItem.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeValueItem.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/AttributeValueItem.java Thu Sep 30 13:39:04 2010
@@ -19,15 +19,15 @@
*/
package org.apache.directory.shared.ldap.aci.protectedItem;
+
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
-import javax.naming.directory.Attribute;
-
import org.apache.directory.shared.ldap.aci.ProtectedItem;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+
/**
* A specific value of specific attributes.
*/
@@ -40,7 +40,7 @@ public class AttributeValueItem extends
/**
* Creates a new instance.
*
- * @param attributes the collection of {@link Attribute}s.
+ * @param attributes the collection of {@link EntryAttribute}s.
*/
public AttributeValueItem( Set<EntryAttribute> attributes )
{
@@ -49,7 +49,9 @@ public class AttributeValueItem extends
/**
- * Returns an iterator of all {@link Attribute}s.
+ * Returns an iterator of all {@link EntryAttribute}s.
+ *
+ * @return the iterator
*/
public Iterator<EntryAttribute> iterator()
{
@@ -88,7 +90,7 @@ public class AttributeValueItem extends
if ( o instanceof AttributeValueItem )
{
AttributeValueItem that = ( AttributeValueItem ) o;
-
+
return this.attributes.equals( that.attributes );
}
@@ -97,14 +99,14 @@ public class AttributeValueItem extends
/**
- * @see Object#toString()
+ * {@inheritDoc}
*/
public String toString()
{
StringBuilder buf = new StringBuilder();
buf.append( "attributeValue {" );
-
+
boolean isFirst = true;
for ( EntryAttribute attribute : attributes )
@@ -117,7 +119,7 @@ public class AttributeValueItem extends
{
buf.append( ", " );
}
-
+
buf.append( attribute.getId() );
buf.append( '=' );
buf.append( attribute.get( 0 ) );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/BinaryValue.java Thu Sep 30 13:39:04 2010
@@ -19,7 +19,6 @@
package org.apache.directory.shared.ldap.entry;
-import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
@@ -552,7 +551,7 @@ public class BinaryValue extends Abstrac
/**
- * @see Externalizable#readExternal(ObjectInput)
+ * {@inheritDoc}
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
@@ -595,7 +594,7 @@ public class BinaryValue extends Abstrac
/**
- * @see Externalizable#writeExternal(ObjectOutput)
+ * {@inheritDoc}
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java Thu Sep 30 13:39:04 2010
@@ -19,7 +19,6 @@
package org.apache.directory.shared.ldap.entry;
-import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
@@ -2537,7 +2536,7 @@ public class DefaultEntry implements Ent
* </li>
* </ul>
*
- * @see Externalizable#writeExternal(ObjectOutput)
+ * {@inheritDoc}
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
@@ -2569,7 +2568,7 @@ public class DefaultEntry implements Ent
/**
- * @see Externalizable#readExternal(ObjectInput)
+ * {@inheritDoc}
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java Thu Sep 30 13:39:04 2010
@@ -19,7 +19,6 @@
package org.apache.directory.shared.ldap.entry;
-import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
@@ -2396,8 +2395,6 @@ public class DefaultEntryAttribute imple
*
* The inner structure is the same as the client attribute, but we can't call
* it as we won't be able to serialize the serverValues
- *
- * @see Externalizable#writeExternal(ObjectOutput)
*/
public void serialize( ObjectOutput out ) throws IOException
{
@@ -2438,7 +2435,7 @@ public class DefaultEntryAttribute imple
/**
- * @see Externalizable#readExternal(ObjectInput)
+ *
*/
// This will suppress PMD.EmptyCatchBlock warnings in this method
@SuppressWarnings("PMD.EmptyCatchBlock")
@@ -2497,7 +2494,7 @@ public class DefaultEntryAttribute imple
*
* The inner structure is :
*
- * @see Externalizable#writeExternal(ObjectOutput)
+ * {@inheritDoc}
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
@@ -2533,7 +2530,7 @@ public class DefaultEntryAttribute imple
/**
- * @see Externalizable#readExternal(ObjectInput)
+ * {@inheritDoc}
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ImmutableEntry.java Thu Sep 30 13:39:04 2010
@@ -19,7 +19,6 @@
package org.apache.directory.shared.ldap.entry;
-import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
@@ -674,7 +673,7 @@ public class ImmutableEntry implements E
* </li>
* </ul>
*
- * @see Externalizable#writeExternal(ObjectOutput)
+ * {@inheritDoc}
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
@@ -683,7 +682,7 @@ public class ImmutableEntry implements E
/**
- * @see Externalizable#readExternal(ObjectInput)
+ * {@inheritDoc}
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java Thu Sep 30 13:39:04 2010
@@ -19,7 +19,6 @@
package org.apache.directory.shared.ldap.entry;
-import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
@@ -481,7 +480,7 @@ public class StringValue extends Abstrac
/**
- * @see Externalizable#readExternal(ObjectInput)
+ * {@inheritDoc}
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
@@ -505,7 +504,7 @@ public class StringValue extends Abstrac
/**
- * @see Externalizable#writeExternal(ObjectOutput)
+ * {@inheritDoc}
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapConfigurationException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapConfigurationException.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapConfigurationException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapConfigurationException.java Thu Sep 30 13:39:04 2010
@@ -31,12 +31,13 @@ import org.apache.directory.shared.ldap.
*/
public class LdapConfigurationException extends LdapOperationException
{
- /** The serial version UUID */
+ /** The serial version UID */
static final long serialVersionUID = 1L;
-
+
/** The exception cause */
private Throwable cause;
+
/**
* Creates a new instance of LdapAuthenticationException.
*
@@ -44,7 +45,7 @@ public class LdapConfigurationException
*/
public LdapConfigurationException( String message )
{
- super( message );
+ super( ResultCodeEnum.OTHER, message );
}
@@ -53,32 +54,36 @@ public class LdapConfigurationException
*/
public LdapConfigurationException()
{
- super( null );
+ super( ResultCodeEnum.OTHER, null );
}
-
-
+
+
/**
+ * Creates a new instance of LdapAuthenticationException.
+ *
+ * @param message the exception message
+ * @param cause the cause
*/
public LdapConfigurationException( String message, Throwable cause )
{
- super( message );
+ super( ResultCodeEnum.OTHER, message );
this.cause = cause;
}
-
-
+
+
/**
- * @return Returns the Exception's cause
+ * @return the exception's cause
*/
public Throwable getCause()
{
return cause;
}
-
-
+
+
/**
- * Set the root cause
+ * Set the root cause.
*
- * @param cause The cause
+ * @param cause the cause
*/
public void setCause( Throwable cause )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java Thu Sep 30 13:39:04 2010
@@ -26,7 +26,6 @@ import java.util.regex.Pattern;
import org.apache.directory.shared.ldap.entry.StringValue;
import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.Normalizer;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -251,7 +250,7 @@ public class SubstringNode extends LeafN
*
* @param normalizer the normalizer to use for pattern component normalization
* @return the equivalent compiled regular expression
- * @throws LdapInvalidDnException if there are problems while normalizing
+ * @throws LdapException if there are problems while normalizing
*/
public final Pattern getRegex( Normalizer normalizer ) throws LdapException
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ComparableComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ComparableComparator.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ComparableComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/ComparableComparator.java Thu Sep 30 13:39:04 2010
@@ -20,8 +20,6 @@
package org.apache.directory.shared.ldap.schema.comparators;
-import java.util.Comparator;
-
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.schema.LdapComparator;
import org.slf4j.Logger;
@@ -32,6 +30,7 @@ import org.slf4j.LoggerFactory;
* Compares two objects taking into account that one might be a Comparable.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @param <T> the type, must extend {@link Comparable}
*/
public class ComparableComparator<T> extends LdapComparator<Comparable<T>>
{
@@ -41,15 +40,18 @@ public class ComparableComparator<T> ext
/** The serialVersionUID */
private static final long serialVersionUID = 1L;
+
/**
- * The BooleanComparator constructor. Its OID is the BooleanMatch matching
- * rule OID.
+ * The ComparableComparator constructor.
+ *
+ * @param oid the comparator OID
*/
public ComparableComparator( String oid )
{
super( oid );
}
+
/**
* Compares two objects taking into account that one may be a Comparable. If
* the first is a comparable then its compareTo operation is called and the
@@ -57,18 +59,20 @@ public class ComparableComparator<T> ext
* then its compareTo method is called and the result is returned after
* being negated. If none are comparables the hashCode of o1 minus the
* hashCode of o2 is returned.
- *
- * @see Comparator#compare(Object, Object)
+ *
+ * @param o1 the first comparable
+ * @param o2 the second comparable
+ * @return {@inheritDoc}
*/
public int compare( Comparable<T> o1, Comparable<T> o2 )
{
LOG.debug( "comparing objects '{}' with '{}'", o1, o2 );
-
+
if ( ( o1 == null ) && ( o2 == null ) )
{
return 0;
}
-
+
if ( o1 instanceof Comparable<?> )
{
if ( o2 == null )
@@ -77,6 +81,7 @@ public class ComparableComparator<T> ext
}
else
{
+ // TODO: check type parameter
return o1.compareTo( ( T ) o2 );
}
}
@@ -93,13 +98,14 @@ public class ComparableComparator<T> ext
}
else
{
- return - o2.compareTo( ( T ) o1 );
+ // TODO: check type parameter
+ return -o2.compareTo( ( T ) o1 );
}
}
// before https://issues.apache.org/jira/browse/DIRSERVER-928 it was
// return o1.hashCode() - o2.hashCode();
-
+
// now we will blow a stack trace if none of the objects are Comparable
throw new IllegalArgumentException( I18n.err( I18n.ERR_04217, o1, o2 ) );
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java Thu Sep 30 13:39:04 2010
@@ -20,8 +20,6 @@
package org.apache.directory.shared.ldap.schema.comparators;
-import java.util.Comparator;
-
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.schema.LdapComparator;
import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -67,8 +65,6 @@ import org.slf4j.LoggerFactory;
/**
* If any normalization attempt fails we compare using the unnormalized
* object.
- *
- * @see Comparator#compare(Object, Object)
*/
public int compare( String o1, String o2 )
{
@@ -100,10 +96,10 @@ import org.slf4j.LoggerFactory;
/**
- * Makes sure we update the oid property of the contained normalizer and
- * comparator.
+ * {@inheritDoc}
*
- * @param oid the object identifier
+ * This implementation makes sure we update the oid property of the contained normalizer and
+ * comparator.
*/
@Override
public void setOid( String oid )
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java Thu Sep 30 13:39:04 2010
@@ -31,7 +31,6 @@ import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.InvalidAttributeIdentifierException;
import org.apache.commons.lang.ArrayUtils;
import org.apache.directory.shared.i18n.I18n;
@@ -1195,7 +1194,7 @@ public final class AttributeUtils
* @param dn The DN which is needed by the ServerEntry
* @return An instance of a ServerEntry object
*
- * @throws InvalidAttributeIdentifierException If we get an invalid attribute
+ * @throws LdapException If we get an invalid attribute
*/
public static Entry toClientEntry( Attributes attributes, DN dn ) throws LdapException
{
@@ -1293,8 +1292,6 @@ public final class AttributeUtils
*
* @param attribute the BasicAttributes or AttributesImpl instance to convert
* @return An instance of a ClientEntry object
- *
- * @throws InvalidAttributeIdentifierException If we had an incorrect attribute
*/
public static EntryAttribute toClientAttribute( Attribute attribute )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java?rev=1003063&r1=1003062&r2=1003063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/tree/DnNode.java Thu Sep 30 13:39:04 2010
@@ -24,8 +24,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import javax.naming.NamingException;
-
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -538,7 +536,7 @@ public class DnNode<N> implements Clonea
* Add a new node in the tree. The added node won't have any element.
*
* @param dn The node's DN
- * @throws NamingException
+ * @throws LdapException
*/
public void add( DN dn ) throws LdapException
{
@@ -552,7 +550,7 @@ public class DnNode<N> implements Clonea
*
* @param dn The node's DN
* @param element The element to associate with this Node. Can be null.
- * @throws NamingException
+ * @throws LdapException
*/
public void add( DN dn, N element ) throws LdapException
{