Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public boolean buildFailureResponse2() {

@SuppressWarnings("rawtypes")
public boolean getAllDatesBetweenDates() throws ParseException {
String currentDate = "01-March-2016";
String currentDate = "05-May-2024";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to use thread-safe date formatting.

- SimpleDateFormat f = new SimpleDateFormat("dd-MMM-yyyy");
+ DateTimeFormatter f = DateTimeFormatter.ofPattern("dd-MMM-yyyy");

Consider replacing SimpleDateFormat with DateTimeFormatter which is thread-safe and recommended for new code.

Committable suggestion was skipped due low confidence.

SimpleDateFormat f = new SimpleDateFormat("dd-MMM-yyyy");
Date begin = f.parse(currentDate);
List response = DateUtils.getAllDatesBetweenDates(begin, new Date(), "dd/MM/yyyy");
Expand Down