geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r411673 - in /geronimo/sandbox/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/ gshell-api/src/main/java/org/apache/geronimo/gshell/console/ gshell-core/src/main/grammar/ gshell-core/src/main/java/org/apache/geroni...
Date Mon, 05 Jun 2006 05:27:17 GMT
Author: jdillon
Date: Sun Jun  4 22:27:16 2006
New Revision: 411673

URL: http://svn.apache.org/viewvc?rev=411673&view=rev
Log:
Use NullArgumentException instead of IllegalArgumentException

Modified:
    geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java
    geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
    geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/console/IO.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandManagerImpl.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/MessageSourceImpl.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/VariablesImpl.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/ExecutingVisitor.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/InteractiveConsole.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/SimpleConsole.java
    geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/ShellServer.java
    geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/SocketServerDaemon.java
    geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/ConsoleFactoryImpl.java

Modified: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandDefinition.java
Sun Jun  4 22:27:16 2006
@@ -17,6 +17,7 @@
 package org.apache.geronimo.gshell.command;
 
 import org.apache.geronimo.gshell.util.Arguments;
+import org.apache.commons.lang.NullArgumentException;
 
 import java.util.Properties;
 
@@ -39,7 +40,7 @@
 
     public CommandDefinition(final Properties props) throws InvalidDefinitionException {
         if (props == null) {
-            throw new IllegalArgumentException("Properties is null");
+            throw new NullArgumentException("props");
         }
 
         this.name = props.getProperty("name");
@@ -133,7 +134,7 @@
         extends InvalidDefinitionException
     {
         ///CLOVER:OFF
-        
+
         MissingPropertyException(String name, Properties props) {
             super("Missing '" + name + "' property in command definition: " + props);
         }

Modified: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandSupport.java
Sun Jun  4 22:27:16 2006
@@ -18,6 +18,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 import org.apache.geronimo.gshell.console.IO;
 import org.apache.geronimo.gshell.util.Arguments;
 import org.apache.geronimo.gshell.ExitNotification;
@@ -48,7 +49,7 @@
 
     public void setName(final String name) {
         if (name == null) {
-            throw new IllegalArgumentException("Name is null");
+            throw new NullArgumentException("name");
         }
         if (name.trim().length() == 0) {
             throw new IllegalArgumentException("Name is empty");

Modified: geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/console/IO.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/console/IO.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/console/IO.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/console/IO.java
Sun Jun  4 22:27:16 2006
@@ -16,6 +16,8 @@
 
 package org.apache.geronimo.gshell.console;
 
+import org.apache.commons.lang.NullArgumentException;
+
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
@@ -75,13 +77,13 @@
      */
     public IO(final InputStream in, final OutputStream out, final OutputStream err) {
         if (in == null) {
-            throw new IllegalArgumentException("Input stream is null");
+            throw new NullArgumentException("in");
         }
         if (out == null) {
-            throw new IllegalArgumentException("Output stream is null");
+            throw new NullArgumentException("out");
         }
         if (err == null) {
-            throw new IllegalArgumentException("Error output stream is null");
+            throw new NullArgumentException("err");
         }
 
         this.inputStream = in;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt Sun Jun
 4 22:27:16 2006
@@ -33,6 +33,8 @@
 import java.io.Reader;
 import java.io.StringReader;
 
+import org.apache.commons.lang.NullArgumentException;
+
 /**
  * Command line parser.
  *
@@ -46,6 +48,10 @@
     }
 
     public ASTCommandLine parse(final Reader reader) throws ParseException {
+        if (reader == null) {
+            throw new NullArgumentException("reader");
+        }
+
         this.ReInit(reader);
 
         return this.commandLine();

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java
Sun Jun  4 22:27:16 2006
@@ -19,6 +19,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.lang.time.StopWatch;
+import org.apache.commons.lang.NullArgumentException;
 import org.apache.geronimo.gshell.console.IO;
 import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandManager;
@@ -61,7 +62,7 @@
 
     public Shell(final IO io) throws CommandException {
         if (io == null) {
-            throw new IllegalArgumentException("IO is null");
+            throw new NullArgumentException("io");
         }
 
         this.io = io;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandManagerImpl.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandManagerImpl.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/CommandManagerImpl.java
Sun Jun  4 22:27:16 2006
@@ -20,6 +20,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 
 import java.util.Map;
 import java.util.Properties;
@@ -99,7 +100,7 @@
 
     public CommandDefinition getCommandDefinition(String name) throws CommandNotFoundException
{
         if (name == null) {
-            throw new IllegalArgumentException("Name is null");
+            throw new NullArgumentException("name");
         }
         if (name.trim().length() == 0) {
             throw new IllegalArgumentException("Name is empty");

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/MessageSourceImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/MessageSourceImpl.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/MessageSourceImpl.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/MessageSourceImpl.java
Sun Jun  4 22:27:16 2006
@@ -16,11 +16,13 @@
 
 package org.apache.geronimo.gshell.command;
 
+import org.apache.commons.lang.NullArgumentException;
+
 import java.util.ResourceBundle;
 import java.util.Formatter;
 
 /**
- * ???
+ * Message source backed up by a {@link ResourceBundle}.
  *
  * @version $Id$
  */
@@ -30,7 +32,9 @@
     private final ResourceBundle bundle;
 
     public MessageSourceImpl(final String name) {
-        assert name != null;
+        if (name == null) {
+            throw new NullArgumentException("name");
+        }
 
         bundle = ResourceBundle.getBundle(name);
     }

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/VariablesImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/VariablesImpl.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/VariablesImpl.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/command/VariablesImpl.java
Sun Jun  4 22:27:16 2006
@@ -16,6 +16,8 @@
 
 package org.apache.geronimo.gshell.command;
 
+import org.apache.commons.lang.NullArgumentException;
+
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -24,7 +26,7 @@
 import java.util.Collections;
 
 /**
- * ???
+ * Variables backed up by a map.
  *
  * @version $Id$
  */
@@ -39,10 +41,10 @@
 
     public VariablesImpl(final Map<String,Object> map, final Variables parent) {
         if (map == null) {
-            throw new IllegalArgumentException("Map is null");
+            throw new NullArgumentException("map");
         }
         if (parent == null) {
-            throw new IllegalArgumentException("Parent is null");
+            throw new NullArgumentException("parent");
         }
 
         this.map = map;
@@ -51,7 +53,7 @@
 
     public VariablesImpl(final Variables parent) {
         if (parent == null) {
-            throw new IllegalArgumentException("Parent is null");
+            throw new NullArgumentException("parent");
         }
 
         this.map = new HashMap<String,Object>();
@@ -60,7 +62,7 @@
 
     public VariablesImpl(final Map<String,Object> map) {
         if (map == null) {
-            throw new IllegalArgumentException("Map is null");
+            throw new NullArgumentException("map");
         }
 
         this.map = map;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java
Sun Jun  4 22:27:16 2006
@@ -23,6 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 
 import java.io.Reader;
 import java.io.StringReader;
@@ -42,7 +43,7 @@
 
     public CommandLineBuilder(final Shell shell) {
         if (shell == null) {
-            throw new IllegalArgumentException("Shell is null");
+            throw new NullArgumentException("shell");
         }
 
         this.shell = shell;
@@ -67,7 +68,7 @@
 
     public CommandLine create(final String commandLine) throws ParseException {
         if (commandLine == null) {
-            throw new IllegalArgumentException("Command line is null");
+            throw new NullArgumentException("commandLine");
         }
         if (commandLine.trim().length() == 0) {
             throw new IllegalArgumentException("Command line is empty");

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/ExecutingVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/ExecutingVisitor.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/ExecutingVisitor.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/ExecutingVisitor.java
Sun Jun  4 22:27:16 2006
@@ -28,6 +28,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -48,7 +49,7 @@
 
     public ExecutingVisitor(final Shell shell) {
         if (shell == null) {
-            throw new IllegalArgumentException("Shell is null");
+            throw new NullArgumentException("shell");
         }
 
         this.shell = shell;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
Sun Jun  4 22:27:16 2006
@@ -26,6 +26,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 
 /**
  * Visitor whichs logs nodes in the tree.
@@ -56,10 +57,10 @@
 
     public LoggingVisitor(final Log log, final Level level) {
         if (log == null) {
-            throw new IllegalArgumentException("Log is null");
+            throw new NullArgumentException("log");
         }
         if (level == null) {
-            throw new IllegalArgumentException("Level is null");
+            throw new NullArgumentException("level");
         }
 
         this.log = log;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/InteractiveConsole.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/InteractiveConsole.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/InteractiveConsole.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/InteractiveConsole.java
Sun Jun  4 22:27:16 2006
@@ -18,6 +18,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 
 /**
  * Provides the framework to interactivly get input from a console
@@ -46,13 +47,13 @@
 
     public InteractiveConsole(final Console console, final Executor executor, final Prompter
prompter) {
         if (console == null) {
-            throw new IllegalArgumentException("Console is null");
+            throw new NullArgumentException("console");
         }
         if (executor == null) {
-            throw new IllegalArgumentException("Executor is null");
+            throw new NullArgumentException("executor");
         }
         if (prompter == null) {
-            throw new IllegalArgumentException("Prompter is null");
+            throw new NullArgumentException("prompter");
         }
 
         this.console = console;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
Sun Jun  4 22:27:16 2006
@@ -19,6 +19,7 @@
 import jline.ConsoleReader;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 
 import java.io.IOException;
 
@@ -38,10 +39,10 @@
 
     public JLineConsole(final IO io, final ConsoleReader reader) throws IOException {
         if (io == null) {
-            throw new IllegalArgumentException("IO is null");
+            throw new NullArgumentException("io");
         }
         if (reader == null) {
-            throw new IllegalArgumentException("Reader is null");
+            throw new NullArgumentException("reader");
         }
 
         this.io = io;
@@ -50,7 +51,7 @@
 
     public JLineConsole(final IO io) throws IOException {
         if (io == null) {
-            throw new IllegalArgumentException("IO is null");
+            throw new NullArgumentException("io");
         }
 
         this.io = io;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/SimpleConsole.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/SimpleConsole.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/SimpleConsole.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/SimpleConsole.java
Sun Jun  4 22:27:16 2006
@@ -18,6 +18,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -38,7 +39,7 @@
 
     public SimpleConsole(final IO io) {
         if (io == null) {
-            throw new IllegalArgumentException("IO is null");
+            throw new NullArgumentException("io");
         }
 
         this.io = io;

Modified: geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/ShellServer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/ShellServer.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/ShellServer.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/ShellServer.java
Sun Jun  4 22:27:16 2006
@@ -18,6 +18,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 import org.apache.geronimo.gshell.Shell;
 import org.apache.geronimo.gshell.InteractiveShell;
 import org.apache.geronimo.gshell.command.CommandException;
@@ -73,7 +74,7 @@
 
     public void service(final Socket socket) throws CommandException, IOException {
         if (socket == null) {
-            throw new IllegalArgumentException("Socket is null");
+            throw new NullArgumentException("socket");
         }
 
         if (log.isDebugEnabled()) {
@@ -91,10 +92,10 @@
 
     public void service(final InputStream input, final OutputStream output) throws CommandException,
IOException {
         if (input == null) {
-            throw new IllegalArgumentException("Input is null");
+            throw new NullArgumentException("input");
         }
         if (output == null) {
-            throw new IllegalArgumentException("Output is null");
+            throw new NullArgumentException("output");
         }
 
         //

Modified: geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/SocketServerDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/SocketServerDaemon.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/SocketServerDaemon.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-core/src/main/java/org/apache/geronimo/gshell/server/SocketServerDaemon.java
Sun Jun  4 22:27:16 2006
@@ -18,6 +18,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 import org.apache.log4j.NDC;
 
 import java.net.Socket;
@@ -49,7 +50,7 @@
 
     public SocketServerDaemon(final int port, final SocketHandler handler) {
         if (handler == null) {
-            throw new IllegalArgumentException("Socket handler is null");
+            throw new NullArgumentException("handler");
         }
 
         this.port = port;
@@ -87,7 +88,7 @@
 
     public void service(final Socket socket) {
         if (socket == null) {
-            throw new IllegalArgumentException("Socket is null");
+            throw new NullArgumentException("socket");
         }
 
         log.info("Starting new thread for client: " + socket);

Modified: geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/ConsoleFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/ConsoleFactoryImpl.java?rev=411673&r1=411672&r2=411673&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/ConsoleFactoryImpl.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/ConsoleFactoryImpl.java
Sun Jun  4 22:27:16 2006
@@ -18,6 +18,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.NullArgumentException;
 import org.apache.geronimo.gshell.console.ConsoleFactory;
 import org.apache.geronimo.gshell.console.Console;
 import org.apache.geronimo.gshell.console.IO;
@@ -39,10 +40,10 @@
 
     public Console create(final InputStream in, final OutputStream out) throws Exception
{
         if (in == null) {
-            throw new IllegalArgumentException("Input is null");
+            throw new NullArgumentException("in");
         }
         if (out == null) {
-            throw new IllegalArgumentException("Output is null");
+            throw new NullArgumentException("out");
         }
 
         TelnetTerminal term = new TelnetTerminal(in, out);
@@ -58,8 +59,6 @@
 
         IO io = term.getIO();
         ConsoleReader reader = new ConsoleReader(io.inputStream, io.out, /* bindings */ null,
term);
-        Console console = new JLineConsole(io, reader);
-
-        return console;
+        return new JLineConsole(io, reader);
     }
 }



Mime
View raw message