Null type mismatch (type annotations): required 'byte @org.eclipse.jdt.annotation.NonNull[]' but this expression has type 'byte @org.eclipse.jdt.annotation.Nullable[]'
Here is the function
private byte @Nullable [] coverArt = null;
public @Nullable RawType getCoverArt() {
if (coverArt == null) {
return null;
} else {
return new RawType(coverArt, "image/jpeg");
}
}
Hi,
you need first to assign the coverArt variable to a local variable, like in the following sample from the documentation:
private void myFunction() {
final MyType myField = this.myField; // You need a local copy of the field for thread safety.
if (myField != null) {
myField.soSomething();
}
}