directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r541827 - in /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support: ./ bind/ extended/
Date Sat, 26 May 2007 00:18:31 GMT
Author: erodriguez
Date: Fri May 25 17:18:30 2007
New Revision: 541827

URL: http://svn.apache.org/viewvc?view=rev&rev=541827
Log:
Warnings clean-up in protocol-ldap, mostly unnecessary casts.

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/CramMd5CallbackHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/DigestMd5CallbackHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GetLdapContext.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GssapiCallbackHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
Fri May 25 17:18:30 2007
@@ -76,7 +76,7 @@
             {
                 ctx.addToEnvironment( Context.REFERRAL, "throw" );
             }
-            ctx.setRequestControls( ( Control[] ) req.getControls().values().toArray( EMPTY_CONTROLS
) );
+            ctx.setRequestControls( req.getControls().values().toArray( EMPTY_CONTROLS )
);
             ctx.createSubcontext( req.getEntry(), req.getAttributes() );
         }
         catch ( ReferralException e )

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
Fri May 25 17:18:30 2007
@@ -74,7 +74,7 @@
             {
                 newCtx.addToEnvironment( Context.REFERRAL, "throw" );
             }
-            newCtx.setRequestControls( ( Control[] ) req.getControls().values().toArray(
EMPTY_CONTROLS ) );
+            newCtx.setRequestControls( req.getControls().values().toArray( EMPTY_CONTROLS
) );
 
             if ( newCtx.compare( req.getName(), req.getAttributeId(), req.getAssertionValue()
) )
             {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
Fri May 25 17:18:30 2007
@@ -71,7 +71,7 @@
             {
                 ctx.addToEnvironment( Context.REFERRAL, "throw" );
             }
-            ctx.setRequestControls( ( Control[] ) req.getControls().values().toArray( EMPTY_CONTROLS
) );
+            ctx.setRequestControls( req.getControls().values().toArray( EMPTY_CONTROLS )
);
             ctx.destroySubcontext( req.getName() );
         }
         catch ( ReferralException e )

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
Fri May 25 17:18:30 2007
@@ -73,7 +73,7 @@
             {
                 ctx.addToEnvironment( Context.REFERRAL, "throw" );
             }
-            ctx.setRequestControls( ( Control[] ) req.getControls().values().toArray( EMPTY_CONTROLS
) );
+            ctx.setRequestControls( req.getControls().values().toArray( EMPTY_CONTROLS )
);
             Object[] mods = req.getModificationItems().toArray( EMPTY );
             ctx.modifyAttributes( req.getName(), ( ModificationItemImpl[] ) mods );
         }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
Fri May 25 17:18:30 2007
@@ -113,7 +113,7 @@
         else
         {
             controls.setCountLimit( Math.min( req.getSizeLimit(), maxSize ) );
-            controls.setTimeLimit( ( int ) Math.min( req.getTimeLimit(), maxTime ) );
+            controls.setTimeLimit( Math.min( req.getTimeLimit(), maxTime ) );
         }
         
         controls.setSearchScope( req.getScope().getValue() );
@@ -208,7 +208,7 @@
                 {
                     ctx = ( ServerLdapContext ) unknown;
                 }
-                Control[] controls = ( Control[] ) req.getControls().values().toArray( new
Control[0] );
+                Control[] controls = req.getControls().values().toArray( new Control[0] );
                 ctx.setRequestControls( controls );
             }
             
@@ -228,7 +228,7 @@
             // ===============================================================
 
             boolean allowAnonymousBinds = cfg.isAllowAnonymousAccess();
-            boolean isAnonymousUser = ( ( ServerLdapContext ) ctx ).getPrincipal().getName().trim().equals(
"" );
+            boolean isAnonymousUser = ctx.getPrincipal().getName().trim().equals( "" );
 
             if ( isAnonymousUser && !allowAnonymousBinds && !isRootDSESearch
)
             {
@@ -266,7 +266,7 @@
             {
                 controls = getSearchControls( req, ids, false, maxSize, maxTime );
             }
-            else if ( ( ( ServerLdapContext ) ctx ).getPrincipal().getName()
+            else if ( ctx.getPrincipal().getName()
                 .trim().equals( PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED ) )
             {
                 controls = getSearchControls( req, ids, true, maxSize, maxTime );
@@ -291,7 +291,7 @@
 
                 if ( !psearchControl.isChangesOnly() )
                 {
-                    list = ( ( ServerLdapContext ) ctx ).search( req.getBase(), req.getFilter(),
+                    list = ctx.search( req.getBase(), req.getFilter(),
                         controls );
                     if ( list instanceof AbandonListener )
                     {
@@ -370,7 +370,7 @@
              * Iterate through all search results building and sending back responses 
              * for each search result returned.  
              */
-            list = ( ( ServerLdapContext ) ctx ).search( req.getBase(), req.getFilter(),
controls );
+            list = ctx.search( req.getBase(), req.getFilter(), controls );
             if ( list instanceof AbandonListener )
             {
                 req.addAbandonListener( ( AbandonListener ) list );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java
Fri May 25 17:18:30 2007
@@ -49,7 +49,7 @@
 
         try
         {
-            LdapContext ctx = ( LdapContext ) SessionRegistry.getSingleton().getLdapContext(
session, null, false );
+            LdapContext ctx = SessionRegistry.getSingleton().getLdapContext( session, null,
false );
 
             if ( ctx != null )
             {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
Fri May 25 17:18:30 2007
@@ -208,7 +208,7 @@
             }
             else
             {
-                Control[] connCtls = ( Control[] ) request.getControls().values().toArray(
EMPTY );
+                Control[] connCtls = request.getControls().values().toArray( EMPTY );
                 ctx = new InitialLdapContext( env, connCtls );
             }
         }
@@ -256,13 +256,12 @@
      * an {@link LdapContext} for the client.
      * 
      * @param session The current session.
-     * @param message The current message.
      * @return An environment suitable for acquiring an {@link LdapContext} for the client.
      */
-    protected Hashtable<String, Object> getEnvironment( IoSession session, Object message
)
+    protected Hashtable<String, Object> getEnvironment( IoSession session )
     {
         Hashtable<String, Object> env = new Hashtable<String, Object>();
-        env.put( Context.PROVIDER_URL, ( String ) session.getAttribute( "baseDn" ) );
+        env.put( Context.PROVIDER_URL, session.getAttribute( "baseDn" ) );
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/CramMd5CallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/CramMd5CallbackHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/CramMd5CallbackHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/CramMd5CallbackHandler.java
Fri May 25 17:18:30 2007
@@ -61,7 +61,7 @@
 
     protected String lookupPassword( String username, String realm )
     {
-        Hashtable env = getEnvironment( session, message );
+        Hashtable env = getEnvironment( session );
 
         LdapContext ctx = getContext( session, message, env );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/DigestMd5CallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/DigestMd5CallbackHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/DigestMd5CallbackHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/DigestMd5CallbackHandler.java
Fri May 25 17:18:30 2007
@@ -61,7 +61,7 @@
 
     protected String lookupPassword( String username, String realm )
     {
-        Hashtable env = getEnvironment( session, message );
+        Hashtable env = getEnvironment( session );
 
         LdapContext ctx = getContext( session, message, env );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GetLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GetLdapContext.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GetLdapContext.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GetLdapContext.java
Fri May 25 17:18:30 2007
@@ -79,7 +79,7 @@
             }
             else
             {
-                Control[] connCtls = ( Control[] ) request.getControls().values().toArray(
EMPTY );
+                Control[] connCtls = request.getControls().values().toArray( EMPTY );
                 ctx = new InitialLdapContext( env, connCtls );
             }
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GssapiCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GssapiCallbackHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GssapiCallbackHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/GssapiCallbackHandler.java
Fri May 25 17:18:30 2007
@@ -68,7 +68,7 @@
     {
         log.debug( "Processing conversion of principal name to DN." );
 
-        Hashtable env = getEnvironment( session, message );
+        Hashtable env = getEnvironment( session );
 
         LdapContext ctx = getContext( session, message, env );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java?view=diff&rev=541827&r1=541826&r2=541827
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/StoredProcedureExtendedOperationHandler.java
Fri May 25 17:18:30 2007
@@ -54,8 +54,8 @@
 {
     public void handleExtendedOperation( IoSession session, SessionRegistry registry, ExtendedRequest
req ) throws Exception
     {
-        Control[] connCtls = ( Control[] ) req.getControls().values().toArray( new Control[
req.getControls().size() ] );
-        LdapContext ldapContext = ( LdapContext ) registry.getLdapContext( session, connCtls,
false);
+        Control[] connCtls = req.getControls().values().toArray( new Control[ req.getControls().size()
] );
+        LdapContext ldapContext = registry.getLdapContext( session, connCtls, false);
         ServerLdapContext serverLdapContext;
         
         if ( ldapContext instanceof ServerLdapContext )



Mime
View raw message