From 70092bb303af69b09bf3978b24c1faa87c909e3c Mon Sep 17 00:00:00 2001 From: Alex Herbert Date: Mon, 27 Jan 2020 21:48:27 +0000 Subject: [PATCH] Document intent to remove Serializable from CSVRecord. This was added to the class header and the changes.xml for inclusion in the release notes. --- src/changes/changes.xml | 7 ++++++- src/main/java/org/apache/commons/csv/CSVRecord.java | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index cd44e5bd..2865d8f3 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -38,7 +38,12 @@ Apache Commons CSV Release Notes - + Add CSVRecord.isSet(int) method #52. Char escape doesn't work properly with quoting. Test case failures following CSVFormat#equals() update. diff --git a/src/main/java/org/apache/commons/csv/CSVRecord.java b/src/main/java/org/apache/commons/csv/CSVRecord.java index 614bb64c..ed90f361 100644 --- a/src/main/java/org/apache/commons/csv/CSVRecord.java +++ b/src/main/java/org/apache/commons/csv/CSVRecord.java @@ -28,6 +28,15 @@ import java.util.Objects; /** * A CSV record parsed from a CSV file. + * + *

+ * Note: Support for {@link Serializable} is scheduled to be removed in version 2.0. + * In version 1.8 the mapping between the column header and the column index was + * removed from the serialised state. The class maintains serialization compatibility + * with versions pre-1.8 for the record values; these must be accessed by index + * following deserialization. There will be loss of any functionally linked to the header + * mapping when transferring serialised forms pre-1.8 to 1.8 and vice versa. + *

*/ public final class CSVRecord implements Serializable, Iterable { @@ -46,7 +55,7 @@ public final class CSVRecord implements Serializable, Iterable { /** The values of the record */ private final String[] values; - /** The parser that originates this record. */ + /** The parser that originates this record. This is not serialized. */ private final transient CSVParser parser; CSVRecord(final CSVParser parser, final String[] values, final String comment, final long recordNumber,