Lines 156-167
Link Here
|
156 |
parsedDate = new SimpleDateFormat(dateFormat_1).parse(dateString); |
156 |
parsedDate = new SimpleDateFormat(dateFormat_1).parse(dateString); |
157 |
} |
157 |
} |
158 |
} catch (ParseException e1) { |
158 |
} catch (ParseException e1) { |
159 |
return null; |
159 |
|
160 |
} catch (NumberFormatException e1) { |
160 |
try { |
161 |
return null; |
161 |
// Fall back to legacy formats |
|
|
162 |
String delta_ts_format = dateFormat_1; |
163 |
String creation_ts_format = dateFormat_2; |
164 |
String deadline_format = dateFormat_3; |
165 |
String customAttribute_format = dateFormat_1; |
166 |
String comment_creation_ts_format = dateFormat_2; |
167 |
String attachment_creation_ts_format = dateFormat_2; |
168 |
if (attributeId.equals(BugzillaAttribute.DELTA_TS.getKey())) { |
169 |
parsedDate = new SimpleDateFormat(delta_ts_format).parse(dateString); |
170 |
} else if (attributeId.equals(BugzillaAttribute.CREATION_TS.getKey())) { |
171 |
parsedDate = new SimpleDateFormat(creation_ts_format).parse(dateString); |
172 |
} else if (attributeId.equals(BugzillaAttribute.BUG_WHEN.getKey())) { |
173 |
parsedDate = new SimpleDateFormat(comment_creation_ts_format).parse(dateString); |
174 |
} else if (attributeId.equals(BugzillaAttribute.DATE.getKey())) { |
175 |
parsedDate = new SimpleDateFormat(attachment_creation_ts_format).parse(dateString); |
176 |
} else if (attributeId.equals(BugzillaAttribute.DEADLINE.getKey())) { |
177 |
parsedDate = new SimpleDateFormat(deadline_format).parse(dateString); |
178 |
} else if (attributeId.startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) { |
179 |
parsedDate = new SimpleDateFormat(customAttribute_format).parse(dateString); |
180 |
} |
181 |
} catch (ParseException e2) { |
182 |
} |
162 |
} |
183 |
} |
163 |
} catch (NumberFormatException e) { |
184 |
} catch (NumberFormatException e) { |
164 |
return null; |
|
|
165 |
} |
185 |
} |
166 |
return parsedDate; |
186 |
return parsedDate; |
167 |
} |
187 |
} |