Skip to content

Commit

Permalink
Fixed indents and also renamed the method to be more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
krisgutta committed Jan 25, 2016
1 parent 89567f6 commit c50d772
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/main/java/com/twilio/sdk/resource/InstanceResource.java
Expand Up @@ -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);
}

/**
Expand All @@ -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;
}
}
Expand Down

0 comments on commit c50d772

Please sign in to comment.