mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 12:20:11 +02:00
Fix various issues related to comparing method references.
This commit is contained in:
parent
e77b5a7354
commit
7d5439950f
@ -66,6 +66,6 @@ public abstract class BaseMethodReference implements MethodReference {
|
||||
if (res != 0) return res;
|
||||
res = getReturnType().compareTo(o.getReturnType());
|
||||
if (res != 0) return res;
|
||||
return CollectionUtils.compareAsList(getParameters(), o.getParameters());
|
||||
return CollectionUtils.compareAsIterable(getParameters(), o.getParameters());
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import java.util.AbstractList;
|
||||
public abstract class FixedSizeList<T> extends AbstractList<T> {
|
||||
@Override
|
||||
public T get(int index) {
|
||||
if (index < 0 || index > size()) {
|
||||
if (index < 0 || index >= size()) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
return readItem(index);
|
||||
|
@ -77,9 +77,18 @@ public class CollectionUtils {
|
||||
@Nonnull Iterable<? extends T> it2) {
|
||||
Iterator<? extends T> elements2 = it2.iterator();
|
||||
for (T element1: it1) {
|
||||
int res = comparator.compare(element1, elements2.next());
|
||||
T element2;
|
||||
try {
|
||||
element2 = elements2.next();
|
||||
} catch (NoSuchElementException ex) {
|
||||
return 1;
|
||||
}
|
||||
int res = comparator.compare(element1, element2);
|
||||
if (res != 0) return res;
|
||||
}
|
||||
if (elements2.hasNext()) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -87,9 +96,18 @@ public class CollectionUtils {
|
||||
@Nonnull Iterable<? extends T> it2) {
|
||||
Iterator<? extends T> elements2 = it2.iterator();
|
||||
for (T element1: it1) {
|
||||
int res = element1.compareTo(elements2.next());
|
||||
T element2;
|
||||
try {
|
||||
element2 = elements2.next();
|
||||
} catch (NoSuchElementException ex) {
|
||||
return 1;
|
||||
}
|
||||
int res = element1.compareTo(element2);
|
||||
if (res != 0) return res;
|
||||
}
|
||||
if (elements2.hasNext()) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user