JAL-4131 Replace usages of requireNonNullElse
[jalview.git] / src / jalview / ws2 / actions / annotation / AnnotationTask.java
index 165e132..271d9ed 100644 (file)
@@ -43,8 +43,6 @@ import jalview.ws2.client.api.AnnotationWebServiceClientI;
 import jalview.ws2.helpers.DelegateJobEventListener;
 import jalview.ws2.helpers.TaskEventSupport;
 
-import static java.util.Objects.requireNonNullElse;
-
 public class AnnotationTask implements TaskI<AnnotationResult>
 {
   private final long uid = MathUtils.getUID();
@@ -185,7 +183,7 @@ public class AnnotationTask implements TaskI<AnnotationResult>
 
     private void updateOurAnnots(List<AlignmentAnnotation> newAnnots)
     {
-      List<AlignmentAnnotation> oldAnnots = requireNonNullElse(ourAnnots, Collections.emptyList());
+      List<AlignmentAnnotation> oldAnnots = ourAnnots != null ? ourAnnots : Collections.emptyList();
       ourAnnots = newAnnots;
       AlignmentI alignment = viewport.getAlignment();
       for (AlignmentAnnotation an : oldAnnots)