directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1170196 - in /directory/apacheds/trunk: core-jndi/src/main/java/org/apache/directory/server/core/jndi/ core/src/main/java/org/apache/directory/server/core/authn/ core/src/main/java/org/apache/directory/server/core/schema/ core/src/main/jav...
Date Tue, 13 Sep 2011 14:34:31 GMT
Author: felixk
Date: Tue Sep 13 14:34:31 2011
New Revision: 1170196

URL: http://svn.apache.org/viewvc?rev=1170196&view=rev
Log:
Fix performance findings by findbugs (DIRSERVER-1658)

Modified:
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/DeadContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java
    directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LRUCache.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationContext.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java

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=1170196&r1=1170195&r2=1170196&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
Tue Sep 13 14:34:31 2011
@@ -55,7 +55,7 @@ import javax.naming.Binding;
  */
 public class DeadContext implements LdapContext, EventDirContext
 {
-    private final String EXCEPTION_MSG = "Context operation unavailable when "
+    private static final String EXCEPTION_MSG = "Context operation unavailable when "
         + "invoked after directory service core provider has been shutdown";
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
Tue Sep 13 14:34:31 2011
@@ -1385,7 +1385,7 @@ public class AuthenticationInterceptor e
     }
 
     
-    private class PwdModDetailsHolder
+    private static class PwdModDetailsHolder
     {
         private boolean pwdModPresent = false;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Tue Sep 13 14:34:31 2011
@@ -503,9 +503,9 @@ public class SchemaInterceptor extends B
 
         int pos = 0;
 
-        for ( String key : filteredAttrs.keySet() )
+        for (Map.Entry<String, String> entry : filteredAttrs.entrySet() )
         {
-            newAttributesList[pos++] = filteredAttrs.get( key );
+            newAttributesList[pos++] = entry.getValue();
         }
 
         searchCtls.setReturningAttributes( newAttributesList );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
Tue Sep 13 14:34:31 2011
@@ -27,7 +27,7 @@ import org.apache.directory.shared.ldap.
 
 public class SimpleTriggerExecutionAuthorizer implements TriggerExecutionAuthorizer
 {
-    private static Dn adminName;
+    // private static Dn adminName;
     
     static
     {

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java
Tue Sep 13 14:34:31 2011
@@ -173,22 +173,22 @@ public class MojoHelperUtils
 
         if ( doSudo )
         {
-            String cmdString = " ";
+            StringBuffer cmdString = new StringBuffer( " " );
             for ( int ii = 0; ii < cmd.length; ii++ )
             {
-                cmdString += cmd[ii] + " ";
+                cmdString.append( cmd[ii] ).append( " " );
             }
 
             String[] temp = new String[2];
             temp[0] = "sudo";
-            temp[1] = cmdString;
+            temp[1] = cmdString.toString();
             cmd = temp;
         }
 
-        String cmdString = " ";
+        StringBuffer cmdString = new StringBuffer( " " );
         for ( int ii = 0; ii < cmd.length; ii++ )
         {
-            cmdString += cmd[ii] + " ";
+            cmdString.append( cmd[ii] ).append( " " );
         }
 
         try

Modified: directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
Tue Sep 13 14:34:31 2011
@@ -438,7 +438,7 @@ public class KeyDerivationInterceptor ex
         }
     }
 
-    class ModifySubContext
+    static class ModifySubContext
     {
         private boolean isPrincipal = false;
         private String principalName;

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java Tue Sep 13 14:34:31
2011
@@ -1079,11 +1079,11 @@ public class BPage<K, V> implements Seri
      */
     private void dump( int height )
     {
-        String prefix = "";
+        StringBuffer prefix = new StringBuffer();
         
         for ( int i = 0; i < height; i++ )
         {
-            prefix += "    ";
+            prefix.append( "    " );
         }
         
         System.out.println( prefix + "-------------------------------------- BPage recordId="
+ recordId );

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LRUCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LRUCache.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LRUCache.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LRUCache.java Tue Sep 13 14:34:31
2011
@@ -1136,9 +1136,6 @@ public class LRUCache<K, V>
         /** Number of snaphot versions created */
         private int numSnapshotsCreated;
         
-        /** True if lru needs to be purged of unusable snapshot versions */
-        private boolean snapshotPurgeNeeded;
-        
         public Lock getLock()
         {
             return lock;
@@ -1187,7 +1184,7 @@ public class LRUCache<K, V>
         /**
          * Increases the hotness of the given entry
          *
-         * @param entry cahce entry for which we will increase hotness
+         * @param entry cache entry for which we will increase hotness
          */
         public void touch( CacheEntry entry )
         {
@@ -1206,7 +1203,6 @@ public class LRUCache<K, V>
         public CacheEntry findVictim( int latchIndex )
         {
             CacheEntry victimEntry = null;
-            boolean victimFound = false;
             int victimBucketIndex;
             int victimLatchIndex;
             

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java Tue Sep
13 14:34:31 2011
@@ -423,7 +423,7 @@ public class CacheRecordManager implemen
     /**
      * A class to store a cached entry. 
      */
-    private class CacheEntry
+    private static class CacheEntry
     {
         long recid;
         Object obj;

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java Tue
Sep 13 14:34:31 2011
@@ -260,7 +260,7 @@ public class SnapshotRecordManager imple
         {
             recid = recordManager.insert( obj, serializer );
             
-            versionedCache.put( new Long( recid ), obj, actionContext.getVersion().getVersion(),
+            versionedCache.put( Long.valueOf( recid ), obj, actionContext.getVersion().getVersion(),
                 serializer, false );
         } 
         catch ( IOException e )
@@ -318,7 +318,7 @@ public class SnapshotRecordManager imple
         // Update the cache
         try 
         {
-            versionedCache.put( new Long( recid ), null, actionContext.getVersion().getVersion(),
+            versionedCache.put( Long.valueOf( recid ), null, actionContext.getVersion().getVersion(),
                 null, false );
         }
         catch ( IOException e )
@@ -387,7 +387,7 @@ public class SnapshotRecordManager imple
 
         try 
         {
-           versionedCache.put( new Long( recid ), obj, actionContext.getVersion().getVersion(),
+           versionedCache.put( Long.valueOf( recid ), obj, actionContext.getVersion().getVersion(),
                serializer, recid < 0 );       
         }
         catch ( IOException e )
@@ -458,7 +458,7 @@ public class SnapshotRecordManager imple
         
         try 
         {
-           obj = versionedCache.get( new Long( recid ), actionContext.getVersion().getVersion(),
+           obj = versionedCache.get( Long.valueOf( recid ), actionContext.getVersion().getVersion(),
                serializer );
         } 
         catch ( IOException e )

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationContext.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationContext.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationContext.java
Tue Sep 13 14:34:31 2011
@@ -21,7 +21,6 @@ package org.apache.directory.server.kerb
 
 
 import org.apache.directory.server.kerberos.kdc.KdcContext;
-import org.apache.directory.server.kerberos.shared.replay.ReplayCache;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntry;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
 import org.apache.directory.shared.kerberos.messages.Ticket;
@@ -38,7 +37,6 @@ public class AuthenticationContext exten
 
     private Ticket ticket;
     private EncryptionKey clientKey;
-    private ReplayCache replayCache;
 
     private PrincipalStoreEntry clientEntry;
     private PrincipalStoreEntry serverEntry;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Tue Sep 13 14:34:31 2011
@@ -306,7 +306,7 @@ public class LdapServer extends Director
         }
     }
 
-    private class AdsKeyStore extends KeyStore
+    private static class AdsKeyStore extends KeyStore
     {
         public AdsKeyStore( KeyStoreSpi keyStoreSpi, Provider provider, String type )
         {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java?rev=1170196&r1=1170195&r2=1170196&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java
Tue Sep 13 14:34:31 2011
@@ -106,7 +106,7 @@ public class StartTlsHandler implements 
         session.getIoSession().write( res );
     }
 
-    class ServerX509TrustManager implements X509TrustManager
+    static class ServerX509TrustManager implements X509TrustManager
     {
         public void checkClientTrusted( X509Certificate[] chain, String authType ) throws
CertificateException
         {



Mime
View raw message