Hrm, this should have been fixed by the gshell-terminal adapters... and why that if () was removed.

--jason


On Feb 13, 2009, at 10:21 PM, gno...@apache.org wrote:

Author: gnodet
Date: Fri Feb 13 15:21:56 2009
New Revision: 744143

URL: http://svn.apache.org/viewvc?rev=744143&view=rev
Log:
GSHELL-159: NegativeArraySizeException is thrown when using just the Shell Impementation when running tests.

Modified:
geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/ java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/ main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
URL: 
http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java?rev=744143&r1=744142&r2=744143&view=diff
= = = = = = = = ====================================================================== --- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/ java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java (original) +++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/ java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java Fri Feb 13 15:21:56 2009
@@ -238,7 +238,11 @@
String message = application.getModel().getBranding().getWelcomeMessage();
            if (message != null) {
                io.out.print(message);
- io.out.println(repeat("-", io.getTerminal().getTerminalWidth() - 1));
+                int width = io.getTerminal().getTerminalWidth() - 1;
+                if (width <= 0) {
+                    width = 80;
+                }
+                io.out.println(repeat("-", width));
                io.out.flush();
            }
        }



Reply via email to