Reputation: 166
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!
Upvotes: 1
Views: 537
Reputation: 13994
Add or remove a @CompileStatic
on the class or method. Sometimes primitive arrays can be picky.
Upvotes: 1