geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r581780 - /geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
Date Thu, 04 Oct 2007 05:41:34 GMT
Author: gawor
Date: Wed Oct  3 22:41:32 2007
New Revision: 581780

URL: http://svn.apache.org/viewvc?rev=581780&view=rev
Log:
fix possible StringIndexOutOfBoundsException if lots of modules are installed

Modified:
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java?rev=581780&r1=581779&r2=581780&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
Wed Oct  3 22:41:32 2007
@@ -40,7 +40,7 @@
     private final static char STATUS_LOADED = '>';
     private final static char STATUS_STARTED = '*';
     private final static char STATUS_FAILED = 'x';
-    private final static int MAX_WIDTH = 70;
+    private final static int MAX_WIDTH = 79;
     private PrintStream out;
     private String currentOperation;
     private Artifact[] modules;
@@ -175,12 +175,13 @@
         }
         buf.append(time).append("s ");
         if (currentOperation.length() > operationLimit) {
-            int space = currentOperation.indexOf(' ', 5);
-            buf.append(currentOperation.substring(0, space + 1));
+            buf.append(currentOperation.substring(0, operationLimit - 3)).append("...");
+            // int space = currentOperation.indexOf(' ', 5);
+            // buf.append(currentOperation.substring(0, space + 1));
             // "Foo BarBarBar" limit 9 = "Foo ...ar" = 13 - 9 + 3 + 1 + 3
             // buf.append("...").append(currentOperation.substring(currentOperation.length()-operationLimit+space+4));
             // "FooBar BarBarBar" limit 12 = "FooBar Ba..." = (7, 12-3)
-            buf.append(currentOperation.substring(space + 1, operationLimit - 3)).append("...");
+            // buf.append(currentOperation.substring(space + 1, operationLimit - 3)).append("...");
         } else {
             buf.append(currentOperation);
             for (int i = currentOperation.length(); i < operationLimit; i++) {



Mime
View raw message