I have code that iterates over timestamps in a video, and adds the timestamp and the thumbnail of that timestamp to a list:
timeStamps.each { timeStampMs -> //for each carousel timestamp
Optional<byte[]> thumbnail = this.persistenceService.getThumbnail(collectionName, mediaId, timeStampMs)
if (thumbnail.isPresent()) {
timeThumbnailList << new TimeThumbnailPair(timeStampMs: timeStampMs, thumbnail: thumbnail.get())
} else {
absentTimeStamps << timeStampMs //assign to thumbnails that needs to be decoded
}
}
TimeThumbnailPair looks like this:
@Canonical
class TimeThumbnailPair {
Long timeStampMs
byte[] thumbnail
}
When I try to compile my code, I get the following error:
"Error:(83, 103) Groovyc: [Static type checking] - Cannot assign value of type byte[] to variable of type byte[]"
I'm completely lost as to why this error appears (and what it even means). Thanks in advance!
CompileStaticannotation on this class (or method)? If so, does this work if its turned off? Also what version of Groovy are you using?