Closed cdausmus closed 2 years ago
Found when testing stats for institution admin, null pointer exceptions thrown when null value for institution was used. The Groovy null check operator ? no longer works in the Cacheable annotation:
Cacheable
@Cacheable(value = 'StatsTranscriptionTime', key = { "${institution?.id?.toString() ?: '-1'}-${startDate?.getTime() ?: '-1'}-${endDate?.getTime() ?: '-1'}" }) def getTranscriptionTimeByProjectType(Date startDate, Date endDate, Institution institution) {}
Needs to be updated to check for nulls the long way: "${(institution ? institution.id.toString() : '-1')}"
"${(institution ? institution.id.toString() : '-1')}"
Testing check:
Found when testing stats for institution admin, null pointer exceptions thrown when null value for institution was used. The Groovy null check operator ? no longer works in the
Cacheable
annotation:@Cacheable(value = 'StatsTranscriptionTime', key = { "${institution?.id?.toString() ?: '-1'}-${startDate?.getTime() ?: '-1'}-${endDate?.getTime() ?: '-1'}" }) def getTranscriptionTimeByProjectType(Date startDate, Date endDate, Institution institution) {}
Needs to be updated to check for nulls the long way:
"${(institution ? institution.id.toString() : '-1')}"
Testing check: