Skip to content

Commit 232519b

Browse files
authored
annotate items variable with nullable to allow null-safety kotlin compiler checks (#107)
Co-authored-by: Sab44 <>
1 parent 74c4872 commit 232519b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/src/main/java/com/hannesdorfmann/adapterdelegates4/AbsDelegationAdapter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222

2323
import androidx.annotation.NonNull;
24+
import androidx.annotation.Nullable;
2425
import androidx.recyclerview.widget.RecyclerView;
2526

2627
/**
@@ -58,7 +59,7 @@
5859
public abstract class AbsDelegationAdapter<T> extends RecyclerView.Adapter {
5960

6061
protected AdapterDelegatesManager<T> delegatesManager;
61-
protected T items;
62+
@Nullable protected T items;
6263

6364
public AbsDelegationAdapter() {
6465
this(new AdapterDelegatesManager<T>());
@@ -128,6 +129,7 @@ public void onViewDetachedFromWindow(@NonNull RecyclerView.ViewHolder holder) {
128129
*
129130
* @return The items / data source
130131
*/
132+
@Nullable
131133
public T getItems() {
132134
return items;
133135
}
@@ -137,7 +139,7 @@ public T getItems() {
137139
*
138140
* @param items The items / data source
139141
*/
140-
public void setItems(T items) {
142+
public void setItems(@Nullable T items) {
141143
this.items = items;
142144
}
143145
}

0 commit comments

Comments
 (0)