Skip to content

Commit

Permalink
Fix MixedArrayList And MixedHashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Dec 5, 2023
1 parent 0144de3 commit c105b9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public <E> boolean contains(Class<E> type, E e) {
@Override
public <E> E get(int index, Class<E> type) {
TypedObject<?> typed = super.get(index);
if (typed == null) {
typed = MixedMap.emptyValue(type);
}
if (type.equals(typed.getType())) {
return (E) typed.getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public <V> boolean containsValue(Class<V> type, V value) {
@Override
public <V> V get(K key, Class<V> type) {
TypedObject<?> typed = super.get(key);
if (typed == null) {
typed = MixedMap.emptyValue(type);
}
if (type.equals(typed.getType())) {
return (V) typed.getValue();
}
Expand Down

0 comments on commit c105b9c

Please sign in to comment.