Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 42479188E2 for ; Mon, 24 Aug 2015 09:12:10 +0000 (UTC) Received: (qmail 71141 invoked by uid 500); 24 Aug 2015 09:12:10 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 71094 invoked by uid 500); 24 Aug 2015 09:12:10 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 71085 invoked by uid 99); 24 Aug 2015 09:12:10 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Aug 2015 09:12:10 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 06D86AC0294 for ; Mon, 24 Aug 2015 09:12:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1697335 - in /directory/shared/trunk: asn1/api/src/main/java/org/apache/directory/api/asn1/util/ ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/conv... Date: Mon, 24 Aug 2015 09:12:09 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150824091210.06D86AC0294@hades.apache.org> Author: elecharny Date: Mon Aug 24 09:12:09 2015 New Revision: 1697335 URL: http://svn.apache.org/r1697335 Log: Fixed some missing Javadoc Modified: directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java Modified: directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java?rev=1697335&r1=1697334&r2=1697335&view=diff ============================================================================== --- directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java (original) +++ directory/shared/trunk/asn1/api/src/main/java/org/apache/directory/api/asn1/util/Oid.java Mon Aug 24 09:12:09 2015 @@ -76,10 +76,19 @@ import org.apache.directory.api.i18n.I18 */ public final class Oid { + /** A byte[] representation of an OID */ private byte[] oidBytes; + + /** The OID as a String */ private String oidString; + /** + * Creates a new instance of Oid. + * + * @param oidString The OID as a String + * @param oidBytes The OID as a byte[] + */ private Oid( String oidString, byte[] oidBytes ) { this.oidString = oidString; @@ -88,6 +97,9 @@ public final class Oid } + /** + * {@inheritDoc} + */ @Override public boolean equals( Object other ) { @@ -101,7 +113,7 @@ public final class Oid * * @param oidBytes The encodedbyte[] * @return A new Oid - * @throws DecoderException + * @throws DecoderException When the OID is not valid */ public static Oid fromBytes( byte[] oidBytes ) throws DecoderException { @@ -176,7 +188,7 @@ public final class Oid * * @param oidString The string representation of the OID * @return A new Oid - * @throws DecoderException + * @throws DecoderException When the OID is not valid */ public static Oid fromString( String oidString ) throws DecoderException { @@ -239,6 +251,9 @@ public final class Oid } + /** + * {@inheritDoc} + */ @Override public int hashCode() { @@ -304,8 +319,8 @@ public final class Oid * should be used in preference to the {@link #toBytes()} method in order * to prevent the creation of copies of the actual byte[]. * - * @param buffer The buffer to write the bytes to - * @throws IOException + * @param buffer The buffer to write the bytes into + * @throws IOException If we can't inject the OID into a ByteBuffer */ public void writeBytesTo( java.nio.ByteBuffer buffer ) { @@ -319,40 +334,64 @@ public final class Oid * to prevent the creation of copies of the actual byte[]. * * @param outputStream The stream to write the bytes to - * @throws IOException + * @throws IOException When we can't write the OID into a Stream */ public void writeBytesTo( OutputStream outputStream ) throws IOException { outputStream.write( oidBytes ); } - // Internal helper class for converting a long value to a properly encoded - // byte[] + /** + * + * Internal helper class for converting a long value to a properly encoded byte[] + */ private static final class ByteBuffer { + /** The Buffer the OID will be written in */ private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + /** + * Writes a Long into a ByteBuffer + * + * @param value The long value to write + * @return A ByteBufffer containing the converted Long + */ public ByteBuffer append( long value ) { write( value, false ); + return this; } + /** + * Write a long into the buffe, and a flag indicating that there are more + * to write + * + * @param value The value to write + * @param hasMore The flag indicati,ng there is more to write into the buffer + */ private void write( long value, boolean hasMore ) { long remaining = value >> 7; + if ( remaining > 0 ) { write( remaining, true ); } + buffer.write( hasMore ? ( byte ) ( ( 0x7F & value ) | 0x80 ) : ( byte ) ( 0x7F & value ) ); } + /** + * Convert the Buffer to a byte[] + * + * @return The byte[] containing the Long + */ public byte[] toByteArray() { return buffer.toByteArray(); Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java?rev=1697335&r1=1697334&r2=1697335&view=diff ============================================================================== --- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java (original) +++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java Mon Aug 24 09:12:09 2015 @@ -60,6 +60,7 @@ public abstract class UserClass protected UserClass() { } + /** * Every directory user (with possible requirements for @@ -67,6 +68,9 @@ public abstract class UserClass */ public static final class AllUsers extends UserClass { + /** + * Creates a new instance of AllUsers. + */ private AllUsers() { } @@ -81,6 +85,7 @@ public abstract class UserClass return "allUsers"; } } + /** * The user with the same distinguished name as the entry being accessed, or @@ -89,6 +94,9 @@ public abstract class UserClass */ public static final class ThisEntry extends UserClass { + /** + * Creates a new instance of ThisEntry. + */ private ThisEntry() { } @@ -103,12 +111,16 @@ public abstract class UserClass return "thisEntry"; } } + /** * The user as parent (ancestor) of accessed entry. */ public static final class ParentOfEntry extends UserClass { + /** + * Creates a new instance of ParentOfEntry. + */ private ParentOfEntry() { } @@ -122,8 +134,8 @@ public abstract class UserClass { return "parentOfEntry"; } - } + /** * A base class for all user classes which has a set of DNs. @@ -154,6 +166,8 @@ public abstract class UserClass /** * Returns the set of all names. + * + * @return The set of all names */ public Set getNames() { @@ -180,7 +194,8 @@ public abstract class UserClass if ( getClass().isAssignableFrom( o.getClass() ) ) { Name that = ( Name ) o; - return this.names.equals( that.names ); + + return names.equals( that.names ); } return false; @@ -204,6 +219,9 @@ public abstract class UserClass } + /** + * {@inheritDoc} + */ public String toString() { StringBuilder buffer = new StringBuilder(); @@ -232,6 +250,7 @@ public abstract class UserClass return buffer.toString(); } } + /** * The user with the specified distinguished name. @@ -241,8 +260,7 @@ public abstract class UserClass /** * Creates a new instance. * - * @param usernames - * the set of user DNs. + * @param usernames the set of user DNs. */ public Name( Set usernames ) { @@ -259,6 +277,7 @@ public abstract class UserClass return "name " + super.toString(); } } + /** * The set of users who are members of the groupOfUniqueNames entry, @@ -271,8 +290,7 @@ public abstract class UserClass /** * Creates a new instance. * - * @param groupNames - * the set of group DNs. + * @param groupNames the set of group DNs. */ public UserGroup( Set groupNames ) { @@ -289,6 +307,7 @@ public abstract class UserClass return "userGroup " + super.toString(); } } + /** * The set of users whose distinguished names fall within the definition of @@ -303,12 +322,11 @@ public abstract class UserClass /** * Creates a new instance. * - * @param subtreeSpecs - * the collection of unrefined {@link SubtreeSpecification}s. + * @param subtreeSpecs the collection of unrefined {@link SubtreeSpecification}s. */ public Subtree( Set subtreeSpecs ) { - this.subtreeSpecifications = Collections.unmodifiableSet( subtreeSpecs ); + subtreeSpecifications = Collections.unmodifiableSet( subtreeSpecs ); } @@ -350,7 +368,8 @@ public abstract class UserClass if ( o instanceof Subtree ) { Subtree that = ( Subtree ) o; - return this.subtreeSpecifications.equals( that.subtreeSpecifications ); + + return subtreeSpecifications.equals( that.subtreeSpecifications ); } return false; Modified: directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java?rev=1697335&r1=1697334&r2=1697335&view=diff ============================================================================== --- directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java (original) +++ directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java Mon Aug 24 09:12:09 2015 @@ -106,7 +106,7 @@ public class SchemaParser */ public synchronized List parse( String schemaObject ) throws IOException, ParseException { - if ( ( schemaObject == null ) || ( schemaObject.trim().equals( "" ) ) ) + if ( ( schemaObject == null ) || ( schemaObject.trim().equals( Strings.EMPTY_STRING ) ) ) { throw new ParseException( I18n.err( I18n.ERR_06001_EMPTY_OR_NULL_SCHEMA_OBJECT ), 0 ); } @@ -119,15 +119,16 @@ public class SchemaParser } producerThread.start(); + return invokeParser( schemaObject ); } /** * Invoke the parser + * * @param schemaName The schema to be parsed * @return A list of schema elements - * * @throws java.io.IOException If the schema file can't be processed * @throws java.text.ParseException If we weren't able to parse the schema */ @@ -186,7 +187,7 @@ public class SchemaParser */ public synchronized void parse( File schemaFile ) throws IOException, ParseException { - this.schemaIn = new FileInputStream( schemaFile ); + schemaIn = new FileInputStream( schemaFile ); if ( producerThread == null ) { @@ -196,6 +197,7 @@ public class SchemaParser producerThread.start(); invokeParser( "schema file ==> " + schemaFile.getAbsolutePath() ); } + /** * The thread which read the schema files and fill the @@ -203,6 +205,9 @@ public class SchemaParser */ private class DataProducer implements Runnable { + /** + * {@inheritDoc} + */ public void run() { int count = -1;