...
If you encounter many instances of a Date, you can consider you can try trying these code replacements:
api.parseDate(strdate)
→Date.parse(DATE_FORMAT, strDate)
def formatter = new SimpleDateFormat(DATE_FORMAT); formatter.format(date)
->date.format(DATE_FORMAT)
...