Index: src/sunlabs/brazil/util/http/HttpUtil.java |
=================================================================== |
--- a/src/sunlabs/brazil/util/http/HttpUtil.java |
+++ b/src/sunlabs/brazil/util/http/HttpUtil.java |
@@ -26,6 +26,9 @@ |
* |
* Version Histories: |
* |
+ * unversioned 12/11/27-15:37:00 (Andrey Novikov) |
+ * fixed StringIndexOutOfBoundsException in formatTime(long time) |
+ * |
* 2.3 04/11/30-15:19:46 (suhler) |
* fixed sccs version string |
* |
@@ -99,6 +102,7 @@ |
* |
* @author Colin Stevens (colin.stevens@sun.com) |
* @version 2.3 |
+ * |
*/ |
public class HttpUtil |
{ |
@@ -291,7 +295,10 @@ |
public static String |
formatTime(long time) |
{ |
- return dateFormat.format(new Date(time)).substring(0, 29); |
+ String date = dateFormat.format(new Date(time)); |
+ if (date.length() >= 29) |
+ date = date.substring(0, 29); |
+ return date; |
Andrey Novikov
2012/11/27 13:03:20
I will fix it before commit in vi.
|
} |
/** |