This commit is contained in:
Looly 2024-07-30 15:17:22 +08:00
parent fcd0d004e3
commit d83444d336
2 changed files with 3 additions and 3 deletions

View File

@ -335,7 +335,7 @@ public class CompareUtil {
@SuppressWarnings("unchecked")
public static <T, U> Comparator<T> comparingIndexed(final Function<? super T, ? extends U> keyExtractor, final boolean atEndIfMiss, final U... objs) {
Objects.requireNonNull(keyExtractor);
final ArrayIndexedComparator<U> indexedComparator = new ArrayIndexedComparator<>(atEndIfMiss, objs);
final IndexedComparator<U> indexedComparator = new IndexedComparator<>(atEndIfMiss, objs);
return (o1, o2) -> indexedComparator.compare(keyExtractor.apply(o1), keyExtractor.apply(o2));
}

View File

@ -22,7 +22,7 @@ import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.dromara.hutool.core.bean.BeanUtil;
import org.dromara.hutool.core.collection.ListUtil;
import org.dromara.hutool.core.comparator.ArrayIndexedComparator;
import org.dromara.hutool.core.comparator.IndexedComparator;
import org.dromara.hutool.core.io.IORuntimeException;
import org.dromara.hutool.core.io.IoUtil;
import org.dromara.hutool.core.io.file.FileUtil;
@ -1440,7 +1440,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
Comparator<String> aliasComparator = this.aliasComparator;
if (null == aliasComparator) {
final Set<String> keySet = this.headerAlias.keySet();
aliasComparator = new ArrayIndexedComparator<>(keySet.toArray(new String[0]));
aliasComparator = new IndexedComparator<>(keySet.toArray(new String[0]));
this.aliasComparator = aliasComparator;
}
return aliasComparator;