Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/sunlabs/brazil/util/http/HttpUtil.java

Issue 8961044: android: brazil StringIndexOutOfBoundsException fix (Closed)
Patch Set: Created Nov. 27, 2012, 11:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld