Skip to content

Commit 9644caf

Browse files
committed
Use API instead of system property
Use final
1 parent dd2aa77 commit 9644caf

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public synchronized void printRecord(final Stream<?> values) throws IOException
312312
values.forEachOrdered(t -> {
313313
try {
314314
print(t);
315-
} catch (IOException e) {
315+
} catch (final IOException e) {
316316
throw rethrow(e);
317317
}
318318
});
@@ -501,7 +501,7 @@ public void printRecords(final Stream<?> values) throws IOException {
501501
values.forEachOrdered(t -> {
502502
try {
503503
printRecordObject(t);
504-
} catch (IOException e) {
504+
} catch (final IOException e) {
505505
throw rethrow(e);
506506
}
507507
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,6 @@ public void testWithRecordSeparatorLF() {
15671567
@Test
15681568
public void testWithSystemRecordSeparator() {
15691569
final CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withSystemRecordSeparator();
1570-
assertEquals(System.getProperty("line.separator"), formatWithRecordSeparator.getRecordSeparator());
1570+
assertEquals(System.lineSeparator(), formatWithRecordSeparator.getRecordSeparator());
15711571
}
15721572
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public void testStream() {
274274

275275
@Test
276276
public void testToListAdd() {
277-
String[] expected = values.clone();
277+
final String[] expected = values.clone();
278278
final List<String> list = record.toList();
279279
list.add("Last");
280280
assertEquals("Last", list.get(list.size() - 1));
@@ -293,15 +293,15 @@ public void testToListFor() {
293293

294294
@Test
295295
public void testToListForEach() {
296-
AtomicInteger i = new AtomicInteger();
296+
final AtomicInteger i = new AtomicInteger();
297297
record.toList().forEach(e -> {
298298
assertEquals(values[i.getAndIncrement()], e);
299299
});
300300
}
301301

302302
@Test
303303
public void testToListSet() {
304-
String[] expected = values.clone();
304+
final String[] expected = values.clone();
305305
final List<String> list = record.toList();
306306
list.set(list.size() - 1, "Last");
307307
assertEquals("Last", list.get(list.size() - 1));

0 commit comments

Comments
 (0)