geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r608138 - /geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
Date Wed, 02 Jan 2008 16:05:14 GMT
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



Mime
View raw message