Skip to content

Commit c69016a

Browse files
committed
Sort members
1 parent f00b91b commit c69016a

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ static long copyLarge(final Reader input, final Writer output, final char[] buff
126126
return count;
127127
}
128128

129-
/** No instances. */
130-
private IOUtils() {
131-
// Noop
132-
}
133-
134129
/**
135130
* Throws the given throwable.
136131
*
@@ -144,4 +139,9 @@ static <T extends Throwable> RuntimeException rethrow(final Throwable throwable)
144139
throw (T) throwable;
145140
}
146141

142+
/** No instances. */
143+
private IOUtils() {
144+
// Noop
145+
}
146+
147147
}

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

+34-34
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,40 @@
3434
*/
3535
public class CSVDuplicateHeaderTest {
3636

37+
/**
38+
* Return test cases for duplicate header data for use in CSVFormat.
39+
* <p>
40+
* This filters the parsing test data to all cases where the allow missing column
41+
* names flag is true and ignore header case is false: these flags are exclusively for parsing.
42+
* CSVFormat validation applies to both parsing and writing and thus validation
43+
* is less strict and behaves as if the allow missing column names constraint and
44+
* the ignore header case behavior are absent.
45+
* The filtered data is then returned with the parser flags set to both true and false
46+
* for each test case.
47+
* </p>
48+
*
49+
* @return the stream of arguments
50+
*/
51+
static Stream<Arguments> duplicateHeaderAllowsMissingColumnsNamesData() {
52+
return duplicateHeaderData()
53+
.filter(arg -> Boolean.TRUE.equals(arg.get()[1]) && Boolean.FALSE.equals(arg.get()[2]))
54+
.flatMap(arg -> {
55+
// Return test case with flags as all true/false combinations
56+
final Object[][] data = new Object[4][];
57+
final Boolean[] flags = {Boolean.TRUE, Boolean.FALSE};
58+
int i = 0;
59+
for (final Boolean a : flags) {
60+
for (final Boolean b : flags) {
61+
data[i] = arg.get().clone();
62+
data[i][1] = a;
63+
data[i][2] = b;
64+
i++;
65+
}
66+
}
67+
return Arrays.stream(data).map(Arguments::of);
68+
});
69+
}
70+
3771
/**
3872
* Return test cases for duplicate header data for use in parsing (CSVParser). Uses the order:
3973
* <pre>
@@ -225,40 +259,6 @@ static Stream<Arguments> duplicateHeaderData() {
225259
);
226260
}
227261

228-
/**
229-
* Return test cases for duplicate header data for use in CSVFormat.
230-
* <p>
231-
* This filters the parsing test data to all cases where the allow missing column
232-
* names flag is true and ignore header case is false: these flags are exclusively for parsing.
233-
* CSVFormat validation applies to both parsing and writing and thus validation
234-
* is less strict and behaves as if the allow missing column names constraint and
235-
* the ignore header case behavior are absent.
236-
* The filtered data is then returned with the parser flags set to both true and false
237-
* for each test case.
238-
* </p>
239-
*
240-
* @return the stream of arguments
241-
*/
242-
static Stream<Arguments> duplicateHeaderAllowsMissingColumnsNamesData() {
243-
return duplicateHeaderData()
244-
.filter(arg -> Boolean.TRUE.equals(arg.get()[1]) && Boolean.FALSE.equals(arg.get()[2]))
245-
.flatMap(arg -> {
246-
// Return test case with flags as all true/false combinations
247-
final Object[][] data = new Object[4][];
248-
final Boolean[] flags = {Boolean.TRUE, Boolean.FALSE};
249-
int i = 0;
250-
for (final Boolean a : flags) {
251-
for (final Boolean b : flags) {
252-
data[i] = arg.get().clone();
253-
data[i][1] = a;
254-
data[i][2] = b;
255-
i++;
256-
}
257-
}
258-
return Arrays.stream(data).map(Arguments::of);
259-
});
260-
}
261-
262262
/**
263263
* Tests duplicate headers with the CSVFormat.
264264
*

0 commit comments

Comments
 (0)