Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit 79c3d73

Browse files
committed
Use isEmpty().
1 parent 371a364 commit 79c3d73

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void testBackslashEscaping() throws IOException {
121121

122122
try (final CSVParser parser = CSVParser.parse(code, format)) {
123123
final List<CSVRecord> records = parser.getRecords();
124-
assertTrue(records.size() > 0);
124+
assertFalse(records.isEmpty());
125125

126126
Utils.compare("Records do not match expected result", res, records);
127127
}
@@ -148,7 +148,7 @@ public void testBackslashEscaping2() throws IOException {
148148

149149
try (final CSVParser parser = CSVParser.parse(code, format)) {
150150
final List<CSVRecord> records = parser.getRecords();
151-
assertTrue(records.size() > 0);
151+
assertFalse(records.isEmpty());
152152

153153
Utils.compare("", res, records);
154154
}
@@ -168,7 +168,7 @@ public void testBackslashEscapingOld() throws IOException {
168168
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.DEFAULT)) {
169169
final List<CSVRecord> records = parser.getRecords();
170170
assertEquals(res.length, records.size());
171-
assertTrue(records.size() > 0);
171+
assertFalse(records.isEmpty());
172172
for (int i = 0; i < res.length; i++) {
173173
assertArrayEquals(res[i], records.get(i).values());
174174
}
@@ -282,7 +282,7 @@ public void testDefaultFormat() throws IOException {
282282

283283
try (final CSVParser parser = CSVParser.parse(code, format)) {
284284
final List<CSVRecord> records = parser.getRecords();
285-
assertTrue(records.size() > 0);
285+
assertFalse(records.isEmpty());
286286

287287
Utils.compare("Failed to parse without comments", res, records);
288288

@@ -330,7 +330,7 @@ public void testEmptyLineBehaviorCSV() throws Exception {
330330
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.DEFAULT)) {
331331
final List<CSVRecord> records = parser.getRecords();
332332
assertEquals(res.length, records.size());
333-
assertTrue(records.size() > 0);
333+
assertFalse(records.isEmpty());
334334
for (int i = 0; i < res.length; i++) {
335335
assertArrayEquals(res[i], records.get(i).values());
336336
}
@@ -347,7 +347,7 @@ public void testEmptyLineBehaviorExcel() throws Exception {
347347
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
348348
final List<CSVRecord> records = parser.getRecords();
349349
assertEquals(res.length, records.size());
350-
assertTrue(records.size() > 0);
350+
assertFalse(records.isEmpty());
351351
for (int i = 0; i < res.length; i++) {
352352
assertArrayEquals(res[i], records.get(i).values());
353353
}
@@ -366,7 +366,7 @@ public void testEndOfFileBehaviorCSV() throws Exception {
366366
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.DEFAULT)) {
367367
final List<CSVRecord> records = parser.getRecords();
368368
assertEquals(res.length, records.size());
369-
assertTrue(records.size() > 0);
369+
assertFalse(records.isEmpty());
370370
for (int i = 0; i < res.length; i++) {
371371
assertArrayEquals(res[i], records.get(i).values());
372372
}
@@ -386,7 +386,7 @@ public void testEndOfFileBehaviorExcel() throws Exception {
386386
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
387387
final List<CSVRecord> records = parser.getRecords();
388388
assertEquals(res.length, records.size());
389-
assertTrue(records.size() > 0);
389+
assertFalse(records.isEmpty());
390390
for (int i = 0; i < res.length; i++) {
391391
assertArrayEquals(res[i], records.get(i).values());
392392
}
@@ -403,7 +403,7 @@ public void testExcelFormat1() throws IOException {
403403
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
404404
final List<CSVRecord> records = parser.getRecords();
405405
assertEquals(res.length, records.size());
406-
assertTrue(records.size() > 0);
406+
assertFalse(records.isEmpty());
407407
for (int i = 0; i < res.length; i++) {
408408
assertArrayEquals(res[i], records.get(i).values());
409409
}
@@ -417,7 +417,7 @@ public void testExcelFormat2() throws Exception {
417417
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
418418
final List<CSVRecord> records = parser.getRecords();
419419
assertEquals(res.length, records.size());
420-
assertTrue(records.size() > 0);
420+
assertFalse(records.isEmpty());
421421
for (int i = 0; i < res.length; i++) {
422422
assertArrayEquals(res[i], records.get(i).values());
423423
}
@@ -620,7 +620,7 @@ public void testGetRecords() throws IOException {
620620
try (final CSVParser parser = CSVParser.parse(CSV_INPUT, CSVFormat.DEFAULT.withIgnoreSurroundingSpaces())) {
621621
final List<CSVRecord> records = parser.getRecords();
622622
assertEquals(RESULT.length, records.size());
623-
assertTrue(records.size() > 0);
623+
assertFalse(records.isEmpty());
624624
for (int i = 0; i < RESULT.length; i++) {
625625
assertArrayEquals(RESULT[i], records.get(i).values());
626626
}
@@ -1131,7 +1131,7 @@ public void testStartWithEmptyLinesThenHeaders() throws Exception {
11311131
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
11321132
final List<CSVRecord> records = parser.getRecords();
11331133
assertEquals(res.length, records.size());
1134-
assertTrue(records.size() > 0);
1134+
assertFalse(records.isEmpty());
11351135
for (int i = 0; i < res.length; i++) {
11361136
assertArrayEquals(res[i], records.get(i).values());
11371137
}

0 commit comments

Comments
 (0)