Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEX] fix build failed on jdk21 #64

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions src/main/java/com/reandroid/dex/pool/KeyItemGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import java.util.*;

public class KeyItemGroup<T extends Block> extends ArrayCollection<T> implements ArraySupplier<T>, Comparator<T> {
public class KeyItemGroup<T extends Block> extends ArrayCollection<T> implements ArraySupplier<T> {

private boolean sorted;

Expand Down Expand Up @@ -75,28 +75,25 @@ private void sort(){
if(size < 2){
return;
}
super.sort(this);
super.sort((item1, item2) -> {
if(item1 == item2){
return 0;
}
if(item1 == null){
return -1;
}
if(item2 == null){
return 1;
}
int i = CompareUtil.compare(((KeyItem)item1).getKey(), ((KeyItem)item2).getKey());
if(i != 0){
return i;
}
return Integer.compare(item1.getIndex(), item2.getIndex());
});
sorted = true;
}

@Override
public int compare(T item1, T item2) {
if(item1 == item2){
return 0;
}
if(item1 == null){
return -1;
}
if(item2 == null){
return 1;
}
int i = CompareUtil.compare(((KeyItem)item1).getKey(), ((KeyItem)item2).getKey());
if(i != 0){
return i;
}
return Integer.compare(item1.getIndex(), item2.getIndex());
}

@Override
public boolean equals(Object obj) {
if(obj == this){
Expand Down
Loading