From c69d34015fc7087af67320b60aa1f6b3aa275b73 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 25 Mar 2019 22:07:34 +0200 Subject: [PATCH] fix annotations to match super methods --- .../java/net/ktnx/mobileledger/utils/ObservableList.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/ObservableList.java b/app/src/main/java/net/ktnx/mobileledger/utils/ObservableList.java index eac02376..3add1bd4 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/ObservableList.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/ObservableList.java @@ -20,6 +20,8 @@ package net.ktnx.mobileledger.utils; import android.os.Build; import android.util.Log; +import org.jetbrains.annotations.NotNull; + import java.util.Collection; import java.util.Comparator; import java.util.Iterator; @@ -203,21 +205,25 @@ public class ObservableList extends Observable implements List { return list.lastIndexOf(o); } } + @NotNull public ListIterator listIterator() { if (!lock.isWriteLockedByCurrentThread()) throw new RuntimeException( "Iterators break encapsulation and ignore locking. Write-lock first"); return list.listIterator(); } + @NotNull public ListIterator listIterator(int index) { if (!lock.isWriteLockedByCurrentThread()) throw new RuntimeException( "Iterators break encapsulation and ignore locking. Write-lock first"); return list.listIterator(index); } + @NotNull public List subList(int fromIndex, int toIndex) { try (LockHolder lh = lockForReading()) { return list.subList(fromIndex, toIndex); } } + @NotNull @RequiresApi(api = Build.VERSION_CODES.N) public Spliterator spliterator() { if (!lock.isWriteLockedByCurrentThread()) throw new RuntimeException( -- 2.39.5