From 341231a27ba891e90ded672e54817ff011317931 Mon Sep 17 00:00:00 2001 From: Alon Albert Date: Sun, 7 Aug 2011 13:19:46 +0300 Subject: catch exception from time.parse() and throw an exception we handle better Bug: 3415450 Change-Id: I0a83082b5de6d5c243ea84134769516e39e5a5fd --- src/com/android/calendarcommon/RecurrenceSet.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/calendarcommon/RecurrenceSet.java b/src/com/android/calendarcommon/RecurrenceSet.java index 426238f..3b91a1d 100644 --- a/src/com/android/calendarcommon/RecurrenceSet.java +++ b/src/com/android/calendarcommon/RecurrenceSet.java @@ -22,6 +22,7 @@ import android.provider.CalendarContract; import android.text.TextUtils; import android.text.format.Time; import android.util.Log; +import android.util.TimeFormatException; import java.util.List; import java.util.regex.Pattern; @@ -134,7 +135,8 @@ public class RecurrenceSet { * @param recurrence The recurrence to be parsed. * @return The list of date/times. */ - public static long[] parseRecurrenceDates(String recurrence) { + public static long[] parseRecurrenceDates(String recurrence) + throws EventRecurrence.InvalidFormatException{ // TODO: use "local" time as the default. will need to handle times // that end in "z" (UTC time) explicitly at that point. String tz = Time.TIMEZONE_UTC; @@ -149,7 +151,14 @@ public class RecurrenceSet { long[] dates = new long[n]; for (int i = 0; i