mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 23:57:25 +01:00
improve bounds check in getElementAt
This commit is contained in:
@@ -25,12 +25,12 @@ public abstract class OrderedListenerListModel<S, E> implements ListenerCollecti
|
||||
|
||||
@Override
|
||||
public E getElementAt(int index) {
|
||||
if (getItems() == null) return null;
|
||||
if (index < 0 || index >= getSize()) return null;
|
||||
return getItems().get(index);
|
||||
}
|
||||
|
||||
public E setElementAt(int index, E value) {
|
||||
if (getItems() == null) return null;
|
||||
if (index < 0 || index >= getSize()) return null;
|
||||
return getItems().set(index, value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user