This commit is contained in:
Looly
2023-03-13 11:41:20 +08:00
parent 0df74202c2
commit 1ad628f944
25 changed files with 59 additions and 54 deletions

View File

@@ -4,12 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.lang.Assert;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.*;
/**
* CSV中一行的表示
@@ -146,7 +141,6 @@ public final class CsvRow implements List<String> {
@Override
public <T> T[] toArray(final T[] a) {
//noinspection SuspiciousToArrayCall
return this.fields.toArray(a);
}
@@ -162,7 +156,7 @@ public final class CsvRow implements List<String> {
@Override
public boolean containsAll(final Collection<?> c) {
return this.fields.containsAll(c);
return new HashSet<>(this.fields).containsAll(c);
}
@Override

View File

@@ -320,7 +320,7 @@ public final class CsvWriter implements Closeable, Flushable, Serializable {
Assert.notNull(this.config.commentCharacter, "Comment is disable!");
try {
if(isFirstLine){
// 首行不补换行符
// 首行不补换行符
isFirstLine = false;
}else {
writer.write(config.lineDelimiter);