Use API instead of system property

Use final
This commit is contained in:
Gary Gregory 2022-09-12 11:07:44 -07:00
parent dd2aa771c9
commit 9644caf979
3 changed files with 6 additions and 6 deletions

View File

@ -312,7 +312,7 @@ public final class CSVPrinter implements Flushable, Closeable {
values.forEachOrdered(t -> {
try {
print(t);
} catch (IOException e) {
} catch (final IOException e) {
throw rethrow(e);
}
});
@ -501,7 +501,7 @@ public final class CSVPrinter implements Flushable, Closeable {
values.forEachOrdered(t -> {
try {
printRecordObject(t);
} catch (IOException e) {
} catch (final IOException e) {
throw rethrow(e);
}
});

View File

@ -1567,6 +1567,6 @@ public class CSVFormatTest {
@Test
public void testWithSystemRecordSeparator() {
final CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withSystemRecordSeparator();
assertEquals(System.getProperty("line.separator"), formatWithRecordSeparator.getRecordSeparator());
assertEquals(System.lineSeparator(), formatWithRecordSeparator.getRecordSeparator());
}
}

View File

@ -274,7 +274,7 @@ public class CSVRecordTest {
@Test
public void testToListAdd() {
String[] expected = values.clone();
final String[] expected = values.clone();
final List<String> list = record.toList();
list.add("Last");
assertEquals("Last", list.get(list.size() - 1));
@ -293,7 +293,7 @@ public class CSVRecordTest {
@Test
public void testToListForEach() {
AtomicInteger i = new AtomicInteger();
final AtomicInteger i = new AtomicInteger();
record.toList().forEach(e -> {
assertEquals(values[i.getAndIncrement()], e);
});
@ -301,7 +301,7 @@ public class CSVRecordTest {
@Test
public void testToListSet() {
String[] expected = values.clone();
final String[] expected = values.clone();
final List<String> list = record.toList();
list.set(list.size() - 1, "Last");
assertEquals("Last", list.get(list.size() - 1));