garydgregory commented on code in PR #249:
URL: https://github.com/apache/commons-csv/pull/249#discussion_r941766996
##########
src/main/java/org/apache/commons/csv/CSVRecord.java:
##########
@@ -298,13 +299,14 @@ public Stream<String> stream() {
}
/**
- * Converts the values to a List.
+ * Converts the values to a new {@code List}.<br>
+ * Modifications to the list do not alter this record.
*
- * @return a new List
+ * @return a new {@code List}
* @since 1.9.0
*/
public List<String> toList() {
- return Arrays.asList(values);
+ return new ArrayList<>(Arrays.asList(values));
Review Comment:
I don't see the point in returning a half-functional list. The list should
not mangle the underlying record that's all.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]