directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r574985 - in /directory/apacheds/trunk/server-tools/src: main/java/org/apache/directory/server/tools/ main/java/org/apache/directory/server/tools/commands/diagnosticcmd/ main/java/org/apache/directory/server/tools/commands/disconnectnotific...
Date Wed, 12 Sep 2007 15:10:30 GMT
Author: elecharny
Date: Wed Sep 12 08:10:27 2007
New Revision: 574985

URL: http://svn.apache.org/viewvc?rev=574985&view=rev
Log:
Removed all the warnings by using generics

Modified:
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandCL.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandGui.java
    directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/AbstractTestCase.java
    directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandTest.java
    directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandTest.java

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
Wed Sep 12 08:10:27 2007
@@ -55,9 +55,9 @@
  */
 public class BaseCommand
 {
-    private Map commands = new HashMap();
+    private Map<String, ToolCommand> commands = new HashMap<String, ToolCommand>();
 
-    private List commandsOrdered = new ArrayList();
+    private List<String> commandsOrdered = new ArrayList<String>();
 
     private Options global = new Options();
 
@@ -345,7 +345,7 @@
     }
 
 
-    public void setCommands( Map commands )
+    public void setCommands( Map<String, ToolCommand> commands )
     {
         this.commands = commands;
     }

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java
Wed Sep 12 08:10:27 2007
@@ -53,15 +53,15 @@
     public static final String PORT_RANGE = "(" + AvailablePortFinder.MIN_PORT_NUMBER + ",
"
         + AvailablePortFinder.MAX_PORT_NUMBER + ")";
 
-    private int port = 10389;
-    private String host = "localhost";
-    private String password = "secret";
-    private String baseDn = "ou=users,dc=example,dc=com";
+    private static final String baseDn = "ou=users,dc=example,dc=com";
     
     
     public CapacityTestCommand()
     {
         super( "capacity" );
+        port = DEFAULT_PORT;
+        host = DEFAULT_HOST;
+        password = DEFAULT_PASSWORD;
     }
 
 
@@ -89,7 +89,7 @@
             out.println( "password = " + password );
         }
 
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory"
);
         env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
Wed Sep 12 08:10:27 2007
@@ -105,7 +105,7 @@
             notifyOutputListener( "password = " + password );
         }
 
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory"
);
         env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
@@ -124,10 +124,10 @@
 
     private void processParameters( Parameter[] params )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < params.length; i++ )
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        
+        for ( Parameter parameter:params )
         {
-            Parameter parameter = params[i];
             parameters.put( parameter.getName(), parameter.getValue() );
         }
 
@@ -238,29 +238,32 @@
 
     private void processListeners( ListenerParameter[] listeners )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < listeners.length; i++ )
+        Map<String, ToolCommandListener> parameters = new HashMap<String, ToolCommandListener>();
+        
+        for ( ListenerParameter parameter:listeners )
         {
-            ListenerParameter parameter = listeners[i];
             parameters.put( parameter.getName(), parameter.getListener() );
         }
 
         // OutputListener param
-        ToolCommandListener outputListener = ( ToolCommandListener ) parameters.get( OUTPUTLISTENER_PARAMETER
);
+        ToolCommandListener outputListener = parameters.get( OUTPUTLISTENER_PARAMETER );
+        
         if ( outputListener != null )
         {
             this.outputListener = outputListener;
         }
 
         // ErrorListener param
-        ToolCommandListener errorListener = ( ToolCommandListener ) parameters.get( ERRORLISTENER_PARAMETER
);
+        ToolCommandListener errorListener = parameters.get( ERRORLISTENER_PARAMETER );
+        
         if ( errorListener != null )
         {
             this.errorListener = errorListener;
         }
 
         // ExceptionListener param
-        ToolCommandListener exceptionListener = ( ToolCommandListener ) parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        ToolCommandListener exceptionListener = parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        
         if ( exceptionListener != null )
         {
             this.exceptionListener = exceptionListener;

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
Wed Sep 12 08:10:27 2007
@@ -117,7 +117,7 @@
 
     private void execute() throws Exception
     {
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory"
);
         env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", bindDN );
@@ -139,7 +139,8 @@
 
     private void processParameters( Parameter[] params )
     {
-        Map parameters = new HashMap();
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        
         for ( int i = 0; i < params.length; i++ )
         {
             Parameter parameter = params[i];
@@ -269,29 +270,32 @@
 
     private void processListeners( ListenerParameter[] listeners )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < listeners.length; i++ )
+        Map<String, ToolCommandListener> parameters = new HashMap<String, ToolCommandListener>();
+        
+        for ( ListenerParameter parameter:listeners )
         {
-            ListenerParameter parameter = listeners[i];
             parameters.put( parameter.getName(), parameter.getListener() );
         }
 
         // OutputListener param
-        ToolCommandListener outputListener = ( ToolCommandListener ) parameters.get( OUTPUTLISTENER_PARAMETER
);
+        ToolCommandListener outputListener = parameters.get( OUTPUTLISTENER_PARAMETER );
+        
         if ( outputListener != null )
         {
             this.outputListener = outputListener;
         }
 
         // ErrorListener param
-        ToolCommandListener errorListener = ( ToolCommandListener ) parameters.get( ERRORLISTENER_PARAMETER
);
+        ToolCommandListener errorListener = parameters.get( ERRORLISTENER_PARAMETER );
+        
         if ( errorListener != null )
         {
             this.errorListener = errorListener;
         }
 
         // ExceptionListener param
-        ToolCommandListener exceptionListener = ( ToolCommandListener ) parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        ToolCommandListener exceptionListener = parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        
         if ( exceptionListener != null )
         {
             this.exceptionListener = exceptionListener;

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
Wed Sep 12 08:10:27 2007
@@ -233,7 +233,7 @@
         
         DirectoryServiceConfiguration dsc = new DirectoryServiceConfiguration()
         {
-            public Hashtable getEnvironment()
+            public Hashtable<String, Object> getEnvironment()
             {
                 return null;
             }

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java
Wed Sep 12 08:10:27 2007
@@ -42,7 +42,7 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
-import org.apache.commons.collections.MultiHashMap;
+import org.apache.commons.collections.map.MultiValueMap;
 import org.apache.directory.server.configuration.ServerStartupConfiguration;
 import org.apache.directory.server.tools.ToolCommandListener;
 import org.apache.directory.server.tools.execution.BaseToolCommandExecutor;
@@ -167,85 +167,84 @@
         LdifComposer composer = new LdifComposerImpl();
         MultiMap map = new MultiMap()
         {
-            // FIXME Stop forking commons-collections.
-            private final MultiHashMap map = new MultiHashMap();
+            private final MultiValueMap mvmap = new MultiValueMap();
 
 
             public Object remove( Object arg0, Object arg1 )
             {
-                return map.remove( arg0, arg1 );
+                return mvmap.remove( arg0, arg1 );
             }
 
 
             public int size()
             {
-                return map.size();
+                return mvmap.size();
             }
 
 
             public Object get( Object arg0 )
             {
-                return map.get( arg0 );
+                return mvmap.get( arg0 );
             }
 
 
             public boolean containsValue( Object arg0 )
             {
-                return map.containsValue( arg0 );
+                return mvmap.containsValue( arg0 );
             }
 
 
             public Object put( Object arg0, Object arg1 )
             {
-                return map.put( arg0, arg1 );
+                return mvmap.put( arg0, arg1 );
             }
 
 
             public Object remove( Object arg0 )
             {
-                return map.remove( arg0 );
+                return mvmap.remove( arg0 );
             }
 
 
             public Collection values()
             {
-                return map.values();
+                return mvmap.values();
             }
 
 
             public boolean isEmpty()
             {
-                return map.isEmpty();
+                return mvmap.isEmpty();
             }
 
 
             public boolean containsKey( Object key )
             {
-                return map.containsKey( key );
+                return mvmap.containsKey( key );
             }
 
 
             public void putAll( Map arg0 )
             {
-                map.putAll( arg0 );
+                mvmap.putAll( arg0 );
             }
 
 
             public void clear()
             {
-                map.clear();
+                mvmap.clear();
             }
 
 
             public Set keySet()
             {
-                return map.keySet();
+                return mvmap.keySet();
             }
 
 
             public Set entrySet()
             {
-                return map.entrySet();
+                return mvmap.entrySet();
             }
         };
 

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
Wed Sep 12 08:10:27 2007
@@ -128,7 +128,7 @@
             notifyOutputListener( "timeOffline = " + timeOffline );
         }
 
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory"
);
         env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
@@ -174,15 +174,16 @@
 
     private void processParameters( Parameter[] params )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < params.length; i++ )
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        
+        for ( Parameter parameter:params )
         {
-            Parameter parameter = params[i];
             parameters.put( parameter.getName(), parameter.getValue() );
         }
 
         // Quiet param
         Boolean quietParam = ( Boolean ) parameters.get( QUIET_PARAMETER );
+        
         if ( quietParam != null )
         {
             setQuietEnabled( quietParam.booleanValue() );
@@ -190,6 +191,7 @@
 
         // Debug param
         Boolean debugParam = ( Boolean ) parameters.get( DEBUG_PARAMETER );
+        
         if ( debugParam != null )
         {
             setDebugEnabled( debugParam.booleanValue() );
@@ -197,6 +199,7 @@
 
         // Verbose param
         Boolean verboseParam = ( Boolean ) parameters.get( VERBOSE_PARAMETER );
+        
         if ( verboseParam != null )
         {
             setVerboseEnabled( verboseParam.booleanValue() );
@@ -204,6 +207,7 @@
 
         // Install-path param
         String installPathParam = ( String ) parameters.get( INSTALLPATH_PARAMETER );
+        
         if ( installPathParam != null )
         {
             try
@@ -229,6 +233,7 @@
 
         // Host param
         String hostParam = ( String ) parameters.get( HOST_PARAMETER );
+        
         if ( hostParam != null )
         {
             host = hostParam;
@@ -245,6 +250,7 @@
 
         // Port param
         Integer portParam = ( Integer ) parameters.get( PORT_PARAMETER );
+        
         if ( portParam != null )
         {
             port = portParam.intValue();
@@ -270,6 +276,7 @@
 
         // Password param
         String passwordParam = ( String ) parameters.get( PASSWORD_PARAMETER );
+        
         if ( passwordParam != null )
         {
             password = passwordParam;
@@ -286,6 +293,7 @@
 
         // Delay param
         Integer delayParam = ( Integer ) parameters.get( DELAY_PARAMETER );
+        
         if ( delayParam != null )
         {
             delay = delayParam.intValue();
@@ -302,6 +310,7 @@
 
         // Time-Offline param
         Integer timeOfflineParam = ( Integer ) parameters.get( TIMEOFFLINE_PARAMETER );
+        
         if ( timeOfflineParam != null )
         {
             timeOffline = timeOfflineParam.intValue();
@@ -320,29 +329,32 @@
 
     private void processListeners( ListenerParameter[] listeners )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < listeners.length; i++ )
+        Map<String, ToolCommandListener> parameters = new HashMap<String, ToolCommandListener>();
+        
+        for ( ListenerParameter parameter:listeners )
         {
-            ListenerParameter parameter = listeners[i];
             parameters.put( parameter.getName(), parameter.getListener() );
         }
 
         // OutputListener param
-        ToolCommandListener outputListener = ( ToolCommandListener ) parameters.get( OUTPUTLISTENER_PARAMETER
);
+        ToolCommandListener outputListener = parameters.get( OUTPUTLISTENER_PARAMETER );
+
         if ( outputListener != null )
         {
             this.outputListener = outputListener;
         }
 
         // ErrorListener param
-        ToolCommandListener errorListener = ( ToolCommandListener ) parameters.get( ERRORLISTENER_PARAMETER
);
+        ToolCommandListener errorListener = parameters.get( ERRORLISTENER_PARAMETER );
+        
         if ( errorListener != null )
         {
             this.errorListener = errorListener;
         }
 
         // ExceptionListener param
-        ToolCommandListener exceptionListener = ( ToolCommandListener ) parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        ToolCommandListener exceptionListener = parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        
         if ( exceptionListener != null )
         {
             this.exceptionListener = exceptionListener;

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java
Wed Sep 12 08:10:27 2007
@@ -150,7 +150,7 @@
     }
 
 
-    private LdapMessage readResponse( ByteBuffer bb ) throws IOException, DecoderException,
NamingException
+    private LdapMessage readResponse( ByteBuffer bb ) throws IOException, DecoderException
     {
 
         LdapMessage messageResp = null;
@@ -606,7 +606,7 @@
      * @throws DecoderException
      * @throws IOException
      */
-    private void unbind( int messageId ) throws InvalidNameException, EncoderException, DecoderException,
IOException
+    private void unbind( int messageId ) throws EncoderException, IOException
     {
         UnBindRequest unbindRequest = new UnBindRequest();
         LdapMessage message = new LdapMessage();
@@ -627,15 +627,16 @@
 
     private void processParameters( Parameter[] params )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < params.length; i++ )
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        
+        for (Parameter parameter:params )
         {
-            Parameter parameter = params[i];
             parameters.put( parameter.getName(), parameter.getValue() );
         }
 
         // Quiet param
         Boolean quietParam = ( Boolean ) parameters.get( QUIET_PARAMETER );
+        
         if ( quietParam != null )
         {
             setQuietEnabled( quietParam.booleanValue() );
@@ -643,6 +644,7 @@
 
         // Debug param
         Boolean debugParam = ( Boolean ) parameters.get( DEBUG_PARAMETER );
+        
         if ( debugParam != null )
         {
             setDebugEnabled( debugParam.booleanValue() );
@@ -650,6 +652,7 @@
 
         // Verbose param
         Boolean verboseParam = ( Boolean ) parameters.get( VERBOSE_PARAMETER );
+        
         if ( verboseParam != null )
         {
             setVerboseEnabled( verboseParam.booleanValue() );
@@ -657,6 +660,7 @@
 
         // Install-path param
         String installPathParam = ( String ) parameters.get( INSTALLPATH_PARAMETER );
+        
         if ( installPathParam != null )
         {
             try
@@ -682,6 +686,7 @@
 
         // Host param
         String hostParam = ( String ) parameters.get( HOST_PARAMETER );
+        
         if ( hostParam != null )
         {
             host = hostParam;
@@ -698,6 +703,7 @@
 
         // Port param
         Integer portParam = ( Integer ) parameters.get( PORT_PARAMETER );
+        
         if ( portParam != null )
         {
             port = portParam.intValue();
@@ -723,6 +729,7 @@
 
         // User param
         String userParam = ( String ) parameters.get( USER_PARAMETER );
+        
         if ( userParam != null )
         {
             user = userParam;
@@ -739,6 +746,7 @@
 
         // Password param
         String passwordParam = ( String ) parameters.get( PASSWORD_PARAMETER );
+        
         if ( passwordParam != null )
         {
             password = passwordParam;
@@ -755,6 +763,7 @@
 
         // Auth param
         String authParam = ( String ) parameters.get( AUTH_PARAMETER );
+        
         if ( authParam != null )
         {
             auth = authParam;
@@ -771,6 +780,7 @@
 
         // LdifFile param
         File ldifFileParam = ( File ) parameters.get( FILE_PARAMETER );
+        
         if ( ldifFileParam != null )
         {
             ldifFile = ldifFileParam;
@@ -778,6 +788,7 @@
 
         // Ignore-Errors param
         Boolean ignoreErrorsParam = ( Boolean ) parameters.get( IGNOREERRORS_PARAMETER );
+        
         if ( ignoreErrorsParam != null )
         {
             ignoreErrors = ignoreErrorsParam.booleanValue();
@@ -1041,44 +1052,48 @@
      */
     private void processListeners( ListenerParameter[] listeners )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < listeners.length; i++ )
+        Map<String, ToolCommandListener> parameters = new HashMap<String, ToolCommandListener>();
+        
+        for ( ListenerParameter parameter:listeners )
         {
-            ListenerParameter parameter = listeners[i];
             parameters.put( parameter.getName(), parameter.getListener() );
         }
 
         // OutputListener param
-        ToolCommandListener outputListener = ( ToolCommandListener ) parameters.get( OUTPUTLISTENER_PARAMETER
);
+        ToolCommandListener outputListener = parameters.get( OUTPUTLISTENER_PARAMETER );
+        
         if ( outputListener != null )
         {
             this.outputListener = outputListener;
         }
 
         // ErrorListener param
-        ToolCommandListener errorListener = ( ToolCommandListener ) parameters.get( ERRORLISTENER_PARAMETER
);
+        ToolCommandListener errorListener = parameters.get( ERRORLISTENER_PARAMETER );
+        
         if ( errorListener != null )
         {
             this.errorListener = errorListener;
         }
 
         // ExceptionListener param
-        ToolCommandListener exceptionListener = ( ToolCommandListener ) parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        ToolCommandListener exceptionListener = parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        
         if ( exceptionListener != null )
         {
             this.exceptionListener = exceptionListener;
         }
 
         // EntryAddedListener param
-        ToolCommandListener entryAddedListener = ( ToolCommandListener ) parameters.get(
ENTRYADDEDLISTENER_PARAMETER );
+        ToolCommandListener entryAddedListener = parameters.get( ENTRYADDEDLISTENER_PARAMETER
);
+        
         if ( entryAddedListener != null )
         {
             this.entryAddedListener = entryAddedListener;
         }
 
         // EntryAddFailedListener param
-        ToolCommandListener entryAddFailedListener = ( ToolCommandListener ) parameters
-            .get( ENTRYADDFAILEDLISTENER_PARAMETER );
+        ToolCommandListener entryAddFailedListener = parameters.get( ENTRYADDFAILEDLISTENER_PARAMETER
);
+        
         if ( entryAddFailedListener != null )
         {
             this.entryAddFailedListener = entryAddFailedListener;

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
Wed Sep 12 08:10:27 2007
@@ -103,7 +103,7 @@
             notifyOutputListener( "password = " + password );
         }
 
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory"
);
         env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
@@ -126,15 +126,16 @@
 
     private void processParameters( Parameter[] params )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < params.length; i++ )
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        
+        for ( Parameter parameter:params )
         {
-            Parameter parameter = params[i];
             parameters.put( parameter.getName(), parameter.getValue() );
         }
 
         // Quiet param
         Boolean quietParam = ( Boolean ) parameters.get( QUIET_PARAMETER );
+        
         if ( quietParam != null )
         {
             setQuietEnabled( quietParam.booleanValue() );
@@ -142,6 +143,7 @@
 
         // Debug param
         Boolean debugParam = ( Boolean ) parameters.get( DEBUG_PARAMETER );
+        
         if ( debugParam != null )
         {
             setDebugEnabled( debugParam.booleanValue() );
@@ -149,6 +151,7 @@
 
         // Verbose param
         Boolean verboseParam = ( Boolean ) parameters.get( VERBOSE_PARAMETER );
+        
         if ( verboseParam != null )
         {
             setVerboseEnabled( verboseParam.booleanValue() );
@@ -156,15 +159,18 @@
 
         // Install-path param
         String installPathParam = ( String ) parameters.get( INSTALLPATH_PARAMETER );
+        
         if ( installPathParam != null )
         {
             try
             {
                 setLayout( installPathParam );
+                
                 if ( !isQuietEnabled() )
                 {
                     notifyOutputListener( "loading settings from: " + getLayout().getConfigurationFile()
);
                 }
+                
                 ApplicationContext factory = null;
                 URL configUrl;
 
@@ -197,6 +203,7 @@
 
         // Port param
         Integer portParam = ( Integer ) parameters.get( PORT_PARAMETER );
+        
         if ( portParam != null )
         {
             port = portParam.intValue();
@@ -222,6 +229,7 @@
 
         // Password param
         String passwordParam = ( String ) parameters.get( PASSWORD_PARAMETER );
+        
         if ( passwordParam != null )
         {
             password = passwordParam;
@@ -239,29 +247,32 @@
     
     private void processListeners( ListenerParameter[] listeners )
     {
-        Map parameters = new HashMap();
-        for ( int i = 0; i < listeners.length; i++ )
+        Map<String, ToolCommandListener> parameters = new HashMap<String, ToolCommandListener>();
+        
+        for ( ListenerParameter parameter:listeners )
         {
-            ListenerParameter parameter = listeners[i];
             parameters.put( parameter.getName(), parameter.getListener() );
         }
 
         // OutputListener param
-        ToolCommandListener outputListener = ( ToolCommandListener ) parameters.get( OUTPUTLISTENER_PARAMETER
);
+        ToolCommandListener outputListener = parameters.get( OUTPUTLISTENER_PARAMETER );
+        
         if ( outputListener != null )
         {
             this.outputListener = outputListener;
         }
 
         // ErrorListener param
-        ToolCommandListener errorListener = ( ToolCommandListener ) parameters.get( ERRORLISTENER_PARAMETER
);
+        ToolCommandListener errorListener = parameters.get( ERRORLISTENER_PARAMETER );
+        
         if ( errorListener != null )
         {
             this.errorListener = errorListener;
         }
 
         // ExceptionListener param
-        ToolCommandListener exceptionListener = ( ToolCommandListener ) parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        ToolCommandListener exceptionListener = parameters.get( EXCEPTIONLISTENER_PARAMETER
);
+        
         if ( exceptionListener != null )
         {
             this.exceptionListener = exceptionListener;

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandCL.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandCL.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandCL.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandCL.java
Wed Sep 12 08:10:27 2007
@@ -21,7 +21,6 @@
 
 
 import java.util.ArrayList;
-import java.util.List;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.directory.server.tools.BaseToolCommand;
@@ -38,7 +37,7 @@
 public abstract class BaseToolCommandCL extends BaseToolCommand implements ToolCommandCL
 {
     /** The List of parameters that will be filled when parsing the command line */
-    protected List<Parameter> parameters;
+    protected ArrayList<Parameter> parameters;
 
 
     /**
@@ -64,6 +63,6 @@
         processOptions( cmd );
 
         ToolCommandExecutorStub toolCommandExecutorStub = getStub();
-        toolCommandExecutorStub.execute( ( Parameter[] ) parameters.toArray( new Parameter[0]
), listeners );
+        toolCommandExecutorStub.execute( parameters.toArray( new Parameter[0] ), listeners
);
     }
 }

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandGui.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandGui.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandGui.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/request/BaseToolCommandGui.java
Wed Sep 12 08:10:27 2007
@@ -36,14 +36,14 @@
  */
 public abstract class BaseToolCommandGui extends BaseToolCommand implements ToolCommandGui
 {
-    protected List parameters;
+    protected List<Parameter> parameters;
 
 
     public BaseToolCommandGui( String name )
     {
         super( name );
 
-        parameters = new ArrayList();
+        parameters = new ArrayList<Parameter>();
     }
 
 
@@ -55,6 +55,6 @@
         processParams( params );
 
         ToolCommandExecutorStub toolCommandExecutorStub = getStub();
-        toolCommandExecutorStub.execute( ( Parameter[] ) parameters.toArray( new Parameter[0]
), listeners );
+        toolCommandExecutorStub.execute( parameters.toArray( new Parameter[0] ), listeners
);
     }
 }

Modified: directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/AbstractTestCase.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/AbstractTestCase.java
(original)
+++ directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/AbstractTestCase.java
Wed Sep 12 08:10:27 2007
@@ -57,7 +57,7 @@
         bindSuccessful = false;
 
         // Set up the environment for creating the initial context
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
         env.put( Context.PROVIDER_URL, "ldap://" + host + ":" + port );
 

Modified: directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandTest.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandTest.java
(original)
+++ directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandTest.java
Wed Sep 12 08:10:27 2007
@@ -82,7 +82,7 @@
             // Checking if the server is down with a simple bind
 
             // Set up the environment for creating the initial context
-            Hashtable env = new Hashtable();
+            Hashtable<String, Object> env = new Hashtable<String, Object>();
             env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"
);
             env.put( Context.PROVIDER_URL, "ldap://" + host + ":" + port );
 

Modified: directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandTest.java?rev=574985&r1=574984&r2=574985&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandTest.java
(original)
+++ directory/apacheds/trunk/server-tools/src/test/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandTest.java
Wed Sep 12 08:10:27 2007
@@ -22,7 +22,6 @@
 
 import java.io.File;
 import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
 import java.net.URISyntaxException;
 
 import javax.naming.NamingEnumeration;



Mime
View raw message