mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-16 23:16:01 +00:00
Use final and lambda shorthand
This commit is contained in:
parent
0dd1bcc62e
commit
ed43bba32c
@ -2305,7 +2305,7 @@ public final class CSVFormat implements Serializable {
|
||||
if (headers != null && duplicateHeaderMode != DuplicateHeaderMode.ALLOW_ALL) {
|
||||
final Set<String> dupCheckSet = new HashSet<>(headers.length);
|
||||
final boolean emptyDuplicatesAllowed = duplicateHeaderMode == DuplicateHeaderMode.ALLOW_EMPTY;
|
||||
for (String header : headers) {
|
||||
for (final String header : headers) {
|
||||
final boolean blank = isBlank(header);
|
||||
// Sanitise all empty headers to the empty string "" when checking duplicates
|
||||
final boolean containsHeader = !dupCheckSet.add(blank ? "" : header);
|
||||
|
@ -53,6 +53,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.io.input.BOMInputStream;
|
||||
import org.apache.commons.io.input.BrokenInputStream;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -113,7 +114,7 @@ public class CSVParserTest {
|
||||
}
|
||||
|
||||
private void parseFully(final CSVParser parser) {
|
||||
parser.forEach(record -> assertNotNull(record));
|
||||
parser.forEach(Assertions::assertNotNull);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -31,8 +31,8 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
public class JiraCsv288Test {
|
||||
|
||||
private void print(final CSVRecord csvRecord, CSVPrinter csvPrinter) throws IOException {
|
||||
for (String value : csvRecord) {
|
||||
private void print(final CSVRecord csvRecord, final CSVPrinter csvPrinter) throws IOException {
|
||||
for (final String value : csvRecord) {
|
||||
csvPrinter.print(value);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user