You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2008/01/02 17:05:14 UTC

svn commit: r608138 - /geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java

Author: gawor
Date: Wed Jan  2 08:05:13 2008
New Revision: 608138

URL: http://svn.apache.org/viewvc?rev=608138&view=rev
Log:
prevent java.lang.StringIndexOutOfBoundsException from startup progress monitor when lots of modules are installed.

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

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java?rev=608138&r1=608137&r2=608138&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java Wed Jan  2 08:05:13 2008
@@ -175,7 +175,13 @@
         }
         buf.append(time).append("s ");
         if (currentOperation.length() > operationLimit) {
-            buf.append(currentOperation.substring(0, operationLimit - 3)).append("...");
+            if (operationLimit > 3) {
+                buf.append(currentOperation.substring(0, operationLimit - 3)).append("...");
+            } else {
+                for (int i = 0; i < operationLimit; i++) {
+                    buf.append('.');
+                }
+            }
             // int space = currentOperation.indexOf(' ', 5);
             // buf.append(currentOperation.substring(0, space + 1));
             // "Foo BarBarBar" limit 9 = "Foo ...ar" = 13 - 9 + 3 + 1 + 3