From c50d77260832d7f9efd9332522de2dd6222c5151 Mon Sep 17 00:00:00 2001 From: Kris Gutta Date: Mon, 25 Jan 2016 13:17:28 -0800 Subject: [PATCH] Fixed indents and also renamed the method to be more descriptive --- .../twilio/sdk/resource/InstanceResource.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/twilio/sdk/resource/InstanceResource.java b/src/main/java/com/twilio/sdk/resource/InstanceResource.java index e78f8d1384..8b65e1662d 100644 --- a/src/main/java/com/twilio/sdk/resource/InstanceResource.java +++ b/src/main/java/com/twilio/sdk/resource/InstanceResource.java @@ -195,14 +195,7 @@ public String toJSON() { * @return the date value of the input string */ protected Date parseDate(final String inDate) { - if (inDate == null) { - return null; - } - try { - return DateFormatUtils.SMTP_DATETIME_FORMAT.parse(inDate); - } catch (ParseException e) { - return null; - } + return parseFormattedDate(DateFormatUtils.SMTP_DATETIME_FORMAT, inDate); } /** @@ -211,22 +204,21 @@ protected Date parseDate(final String inDate) { * @return the date value of the input string */ protected Date parseIsoDate(final String inDate) { - return parseDate(DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT, inDate); + return parseFormattedDate(DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT, inDate); } - /** * return a date from the property string using the input date format * * @return the date value of the input string */ - protected Date parseDate(final FastDateFormat inDateFormat, final String inDate) { + protected Date parseFormattedDate(final FastDateFormat inDateFormat, final String inDate) { if (inDateFormat == null || inDate == null) { return null; } try { - return inDateFormat.parse(inDate); - } catch (ParseException e) { + return inDateFormat.parse(inDate); + } catch (ParseException e) { return null; } }