garydgregory commented on code in PR #276:
URL: https://github.com/apache/commons-csv/pull/276#discussion_r999872386
##########
src/main/java/org/apache/commons/csv/CSVFormat.java:
##########
@@ -2280,6 +2279,27 @@ private void validate() throws IllegalArgumentException {
}
}
+ private Object readResolve() throws ObjectStreamException {
+ // check whether field duplicateHeaderMode (as of 1.10.0) was found in
serialized form
+ // if not, set from boolean allowDuplicateHeaderNames
+ if (duplicateHeaderMode == null) {
+ setFieldValue("duplicateHeaderMode",
+ allowDuplicateHeaderNames ? DuplicateHeaderMode.ALLOW_ALL
: DuplicateHeaderMode.DISALLOW);
+ }
+ return this;
+ }
+
+ private void setFieldValue(String fieldName, Object value) {
Review Comment:
> In Java private methods are non-virtual. I will put `final` on methods
parameters.
Of course, this comment applies only to parameters, just look at the rest of
the code base ;-)
--
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]