Skip to content

Commit ed43bba

Browse files
committed
Use final and lambda shorthand
1 parent 0dd1bcc commit ed43bba

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2305,7 +2305,7 @@ private void validate() throws IllegalArgumentException {
23052305
if (headers != null && duplicateHeaderMode != DuplicateHeaderMode.ALLOW_ALL) {
23062306
final Set<String> dupCheckSet = new HashSet<>(headers.length);
23072307
final boolean emptyDuplicatesAllowed = duplicateHeaderMode == DuplicateHeaderMode.ALLOW_EMPTY;
2308-
for (String header : headers) {
2308+
for (final String header : headers) {
23092309
final boolean blank = isBlank(header);
23102310
// Sanitise all empty headers to the empty string "" when checking duplicates
23112311
final boolean containsHeader = !dupCheckSet.add(blank ? "" : header);

src/test/java/org/apache/commons/csv/CSVParserTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
import org.apache.commons.io.input.BOMInputStream;
5555
import org.apache.commons.io.input.BrokenInputStream;
56+
import org.junit.jupiter.api.Assertions;
5657
import org.junit.jupiter.api.Disabled;
5758
import org.junit.jupiter.api.Test;
5859

@@ -113,7 +114,7 @@ private BOMInputStream createBOMInputStream(final String resource) throws IOExce
113114
}
114115

115116
private void parseFully(final CSVParser parser) {
116-
parser.forEach(record -> assertNotNull(record));
117+
parser.forEach(Assertions::assertNotNull);
117118
}
118119

119120
@Test

src/test/java/org/apache/commons/csv/issues/JiraCsv288Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
public class JiraCsv288Test {
3333

34-
private void print(final CSVRecord csvRecord, CSVPrinter csvPrinter) throws IOException {
35-
for (String value : csvRecord) {
34+
private void print(final CSVRecord csvRecord, final CSVPrinter csvPrinter) throws IOException {
35+
for (final String value : csvRecord) {
3636
csvPrinter.print(value);
3737
}
3838
}

0 commit comments

Comments
 (0)