Skip to content

Commit 70092bb

Browse files
committed
Document intent to remove Serializable from CSVRecord.
This was added to the class header and the changes.xml for inclusion in the release notes.
1 parent b7fea55 commit 70092bb

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/changes/changes.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@
3838
<title>Apache Commons CSV Release Notes</title>
3939
</properties>
4040
<body>
41-
<release version="1.8" date="2019-01-DD" description="Feature and bug fix release (Java 8)">
41+
<release version="1.8" date="2019-01-DD" description="Feature and bug fix release (Java 8).
42+
43+
This release fixes serialization compatibility of CSVRecord with versions 1.0 to 1.6.
44+
New fields added since 1.7 are not serialized. Support for Serializable is scheduled to be
45+
removed in version 2.0.
46+
">
4247
<action issue="CSV-255" type="add" dev="ggregory" due-to="0x100">Add CSVRecord.isSet(int) method #52.</action>
4348
<action issue="CSV-135" type="fix" dev="sebb" due-to="Mateusz Zakarczemny">Char escape doesn't work properly with quoting.</action>
4449
<action issue="CSV-244" type="fix" dev="sebb">Test case failures following CSVFormat#equals() update.</action>

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@
2828

2929
/**
3030
* A CSV record parsed from a CSV file.
31+
*
32+
* <p>
33+
* Note: Support for {@link Serializable} is scheduled to be removed in version 2.0.
34+
* In version 1.8 the mapping between the column header and the column index was
35+
* removed from the serialised state. The class maintains serialization compatibility
36+
* with versions pre-1.8 for the record values; these must be accessed by index
37+
* following deserialization. There will be loss of any functionally linked to the header
38+
* mapping when transferring serialised forms pre-1.8 to 1.8 and vice versa.
39+
* </p>
3140
*/
3241
public final class CSVRecord implements Serializable, Iterable<String> {
3342

@@ -46,7 +55,7 @@ public final class CSVRecord implements Serializable, Iterable<String> {
4655
/** The values of the record */
4756
private final String[] values;
4857

49-
/** The parser that originates this record. */
58+
/** The parser that originates this record. This is not serialized. */
5059
private final transient CSVParser parser;
5160

5261
CSVRecord(final CSVParser parser, final String[] values, final String comment, final long recordNumber,

0 commit comments

Comments
 (0)