directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1695984 - in /directory/apacheds/trunk: core-jndi/src/main/java/org/apache/directory/server/core/jndi/ core-shared/src/main/java/org/apache/directory/server/core/shared/ core-shared/src/main/java/org/apache/directory/server/core/shared/par...
Date Fri, 14 Aug 2015 20:45:12 GMT
Author: seelmann
Date: Fri Aug 14 20:45:12 2015
New Revision: 1695984

URL: http://svn.apache.org/r1695984
Log:
Fix checkstyle issues

Modified:
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/DeadContext.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
Fri Aug 14 20:45:12 2015
@@ -20,9 +20,6 @@
 package org.apache.directory.server.core.jndi;
 
 
-import org.apache.directory.server.core.api.DirectoryService;
-
-import javax.naming.InitialContext;
 import javax.naming.spi.InitialContextFactory;
 
 

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/DeadContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/DeadContext.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/DeadContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/DeadContext.java
Fri Aug 14 20:45:12 2015
@@ -107,7 +107,7 @@ public class DeadContext implements Ldap
     }
 
 
-    public void modifyAttributes( String name, int mod_op, Attributes attrs ) throws NamingException
+    public void modifyAttributes( String name, int modOp, Attributes attrs ) throws NamingException
     {
         throw new ServiceUnavailableException( EXCEPTION_MSG );
     }
@@ -119,7 +119,7 @@ public class DeadContext implements Ldap
     }
 
 
-    public void modifyAttributes( Name name, int mod_op, Attributes attrs ) throws NamingException
+    public void modifyAttributes( Name name, int modOp, Attributes attrs ) throws NamingException
     {
         throw new ServiceUnavailableException( EXCEPTION_MSG );
     }

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
Fri Aug 14 20:45:12 2015
@@ -47,8 +47,12 @@ import org.apache.directory.server.i18n.
  * @see <a href="http://www.faqs.org/rfcs/rfc2713.html">RFC 2713</a>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-class JavaLdapSupport
+final class JavaLdapSupport
 {
+    private JavaLdapSupport()
+    {
+    }
+
     // ------------------------------------------------------------------------
     // Attribute Id Constants Used By The Java LDAP BootstrapSchema
     // ------------------------------------------------------------------------

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Fri Aug 14 20:45:12 2015
@@ -144,7 +144,7 @@ public abstract class ServerContext impl
     protected SchemaManager schemaManager;
 
     /** A reference to the ObjectClass AT */
-    protected AttributeType OBJECT_CLASS_AT;
+    protected AttributeType objectClassAT;
 
     /** The cloned environment used by this Context */
     private final Hashtable<String, Object> env;
@@ -231,7 +231,7 @@ public abstract class ServerContext impl
         schemaManager = service.getSchemaManager();
 
         // setup attribute type value
-        OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
+        objectClassAT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
     }
 
 
@@ -266,7 +266,7 @@ public abstract class ServerContext impl
         schemaManager = service.getSchemaManager();
 
         // setup attribute type value
-        OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
+        objectClassAT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
     }
 
 
@@ -290,7 +290,7 @@ public abstract class ServerContext impl
         schemaManager = service.getSchemaManager();
 
         // setup attribute type value
-        OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
+        objectClassAT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
     }
 
 
@@ -450,6 +450,9 @@ public abstract class ServerContext impl
                 control = new SyncStateValueDecorator( getDirectoryService().getLdapCodecService()
);
 
                 break;
+
+            default:
+                throw new IllegalArgumentException( "Unsupported control " + controlIDStr
);
         }
 
         control.setCritical( jndiControl.isCritical() );
@@ -587,7 +590,7 @@ public abstract class ServerContext impl
     protected EntryFilteringCursor doListOperation( Dn target ) throws Exception
     {
         // setup the op context and populate with request controls
-        PresenceNode filter = new PresenceNode( OBJECT_CLASS_AT );
+        PresenceNode filter = new PresenceNode( objectClassAT );
         SearchOperationContext searchContext = new SearchOperationContext( session, target,
SearchScope.ONELEVEL, filter, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
         searchContext.addRequestControls( convertControls( true, requestControls ) );
 
@@ -656,9 +659,10 @@ public abstract class ServerContext impl
             lookupContext.getResponseControls() );
 
         // Now remove the ObjectClass attribute if it has not been requested
-        if ( ( lookupContext.getReturningAttributes() != null ) && ( lookupContext.getReturningAttributes().size()
!= 0 ) &&
-            ( ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ) != null )
-            && ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ).size() == 0 )
) )
+        if ( ( lookupContext.getReturningAttributes() != null )
+            && ( lookupContext.getReturningAttributes().size() != 0 )
+            && ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ) != null )
+            && ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ).size() == 0 )
)
         {
             serverEntry.removeAttributes( SchemaConstants.OBJECT_CLASS_AT );
         }
@@ -1536,7 +1540,7 @@ public abstract class ServerContext impl
     {
         // Conduct a special one level search at base for all objects
         Dn base = buildTarget( JndiUtils.fromName( name ) );
-        PresenceNode filter = new PresenceNode( OBJECT_CLASS_AT );
+        PresenceNode filter = new PresenceNode( objectClassAT );
         SearchControls ctls = new SearchControls();
         ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
         AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
@@ -1608,7 +1612,7 @@ public abstract class ServerContext impl
 
     public void addNamingListener( Name name, int scope, NamingListener namingListener )
throws NamingException
     {
-        ExprNode filter = new PresenceNode( OBJECT_CLASS_AT );
+        ExprNode filter = new PresenceNode( objectClassAT );
 
         try
         {

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
Fri Aug 14 20:45:12 2015
@@ -688,7 +688,7 @@ public abstract class ServerDirContext e
 
         if ( ( null == matchingAttributes ) || ( matchingAttributes.size() <= 0 ) )
         {
-            PresenceNode filter = new PresenceNode( OBJECT_CLASS_AT );
+            PresenceNode filter = new PresenceNode( objectClassAT );
             AliasDerefMode aliasDerefMode = AliasDerefMode.getEnum( getEnvironment() );
             try
             {

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Fri Aug 14 20:45:12 2015
@@ -118,7 +118,7 @@ public class DefaultCoreSession implemen
     private LdapPrincipal authorizedPrincipal;
 
     /** A reference to the ObjectClass AT */
-    protected AttributeType OBJECT_CLASS_AT;
+    protected AttributeType objectClassAT;
 
     /** The associated IoSession */
     private IoSession ioSession;
@@ -146,7 +146,7 @@ public class DefaultCoreSession implemen
         }
 
         // setup attribute type value
-        OBJECT_CLASS_AT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
+        objectClassAT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
     }
 
 
@@ -540,7 +540,7 @@ public class DefaultCoreSession implemen
     {
         OperationManager operationManager = directoryService.getOperationManager();
 
-        PresenceNode filter = new PresenceNode( OBJECT_CLASS_AT );
+        PresenceNode filter = new PresenceNode( objectClassAT );
         SearchOperationContext searchContext = new SearchOperationContext( this, dn, SearchScope.ONELEVEL,
filter,
             returningAttributes );
         searchContext.setAliasDerefMode( aliasDerefMode );

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/ReferralManagerImpl.java
Fri Aug 14 20:45:12 2015
@@ -61,7 +61,7 @@ public class ReferralManagerImpl impleme
     private ReentrantReadWriteLock mutex = new ReentrantReadWriteLock();
 
     /** A storage for the ObjectClass attributeType */
-    private AttributeType OBJECT_CLASS_AT;
+    private AttributeType objectClassAT;
 
 
     /**
@@ -81,7 +81,7 @@ public class ReferralManagerImpl impleme
             PartitionNexus nexus = directoryService.getPartitionNexus();
     
             Set<String> suffixes = nexus.listSuffixes();
-            OBJECT_CLASS_AT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
+            objectClassAT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
     
             init( directoryService, suffixes.toArray( new String[]
                 {} ) );
@@ -156,7 +156,7 @@ public class ReferralManagerImpl impleme
      */
     public void init( DirectoryService directoryService, String... suffixes ) throws LdapException
     {
-        ExprNode referralFilter = new EqualityNode<String>( OBJECT_CLASS_AT,
+        ExprNode referralFilter = new EqualityNode<String>( objectClassAT,
             new StringValue( SchemaConstants.REFERRAL_OC ) );
 
         // Lookup for each entry with the ObjectClass = Referral value
@@ -216,7 +216,7 @@ public class ReferralManagerImpl impleme
      */
     public void remove( DirectoryService directoryService, Dn suffix ) throws Exception
     {
-        ExprNode referralFilter = new EqualityNode<String>( OBJECT_CLASS_AT,
+        ExprNode referralFilter = new EqualityNode<String>( objectClassAT,
             new StringValue( SchemaConstants.REFERRAL_OC ) );
 
         // Lookup for each entry with the ObjectClass = Referral value

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SchemaService.java
Fri Aug 14 20:45:12 2015
@@ -54,7 +54,7 @@ import org.apache.directory.server.core.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SchemaService
+public final class SchemaService
 {
     /** cached version of the schema subentry with all attributes in it */
     private static Entry schemaSubentry;
@@ -63,6 +63,11 @@ public class SchemaService
     private static Object schemaSubentrLock = new Object();
 
 
+    private SchemaService()
+    {
+    }
+
+
     /**
      * Generate the comparators attribute from the registry
      */

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryComparator.java
Fri Aug 14 20:45:12 2015
@@ -77,7 +77,7 @@ class SortedEntryComparator implements C
 
         hr = at.getSyntax().isHumanReadable();
 
-        if( mrule != null )
+        if ( mrule != null )
         {
             comparator = schemaManager.lookupComparatorRegistry( mrule );
         }
@@ -85,7 +85,7 @@ class SortedEntryComparator implements C
         {
             MatchingRule mr = at.getOrdering();
             
-            if( mr == null )
+            if ( mr == null )
             {
                 mr = at.getEquality();
             }
@@ -143,10 +143,6 @@ class SortedEntryComparator implements C
             }
         }
 
-        if( o1 == null || o2 == null )
-        {
-            System.out.println("");
-        }
         int c = 1;
 
         if ( reverse )

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntryCursor.java
Fri Aug 14 20:45:12 2015
@@ -65,7 +65,8 @@ public class SortedEntryCursor extends A
     
     private BTree<Entry, String> btree;
     
-    public SortedEntryCursor( BTree<Entry,String> btree, RecordManager recMan, File
dataFile ) throws IOException
+
+    public SortedEntryCursor( BTree<Entry, String> btree, RecordManager recMan, File
dataFile ) throws IOException
     {
         this.recMan = recMan;
         this.dataFile = dataFile;
@@ -261,17 +262,17 @@ public class SortedEntryCursor extends A
     
     private void deleteFile()
     {
-        if( recMan == null )
+        if ( recMan == null )
         {
             return;
         }
-        
+
         try
         {
             recMan.close();
             dataFile.delete();
         }
-        catch( IOException e )
+        catch ( IOException e )
         {
             LOG.warn( "Failed to delete the sorted entry data file {}", dataFile, e );
         }

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java?rev=1695984&r1=1695983&r2=1695984&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
Fri Aug 14 20:45:12 2015
@@ -120,19 +120,8 @@ public class DefaultPartitionNexus exten
     /** A structure to hold all the partitions */
     private DnNode<Partition> partitionLookupTree = new DnNode<Partition>();
 
-    /** the system partition */
-    //private Partition system;
-
-    /** A reference to the EntryCSN attributeType */
-    private static AttributeType ENTRY_CSN_AT;
-
-    /** A reference to the ObjectClass attributeType */
-    private static AttributeType OBJECT_CLASS_AT;
-
     private final List<Modification> mods = new ArrayList<Modification>( 2 );
 
-    private String lastSyncedCtxCsn = null;
-
     /** The cn=schema Dn */
     private Dn subschemSubentryDn;
 
@@ -202,8 +191,6 @@ public class DefaultPartitionNexus exten
             }
 
             schemaManager = directoryService.getSchemaManager();
-            ENTRY_CSN_AT = schemaManager.getAttributeType( SchemaConstants.ENTRY_CSN_AT );
-            OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT
);
 
             // Initialize and normalize the localy used DNs
             Dn adminDn = directoryService.getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN
);



Mime
View raw message