You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Markus Spann (Jira)" <ji...@apache.org> on 2022/08/19 15:43:00 UTC

[jira] [Created] (CSV-302) CSVFormat.duplicateHeaderMode requires default for backward compatibility

Markus Spann created CSV-302:
--------------------------------

             Summary: CSVFormat.duplicateHeaderMode requires default for backward compatibility
                 Key: CSV-302
                 URL: https://issues.apache.org/jira/browse/CSV-302
             Project: Commons CSV
          Issue Type: Bug
    Affects Versions: 1.10.0
            Reporter: Markus Spann


Customized Serialization
{code:java}
boolean allowDuplicateHeaderNames{code}
 was recently replaced by 
{code:java}
DuplicateHeaderMode duplicateHeaderMode{code}
 in class {{{}CSVFormat{}}}.

 

The boolean defaults to {{{}false{}}}, while the member of type {{DuplicateHeaderMode}} defaults to {{{}null{}}}.

{{duplicateHeaderMode}} must be initialized with {{DISALLOW}} for backward compatibility.

The change is also problematic with regards to serialization. The class is serializable and {{serialVersionUID}} is unchanged between versions. The boolean setting {{allowDuplicateHeaderNames}} in an object serialized in version 1.9.0 or earlier would always be deserialized to {{duplicateHeaderMode = null}} in the current head.

To handle the code changes correctly, a customized deserialization must be implemented.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)