sigee commented on PR #477: URL: https://github.com/apache/commons-csv/pull/477#issuecomment-2993729844
Hi @ppkarwasz , I initially wanted to consolidate the dual header data structures - the `headerNames` List and `headerMap` Map - since maintaining two separate structures for the same information seemed redundant and confusing. While extracting the logic was a step toward this goal, I've realized that neither structure can be completely eliminated. Your third suggestion about refactoring into a `Headers` class that encapsulates both structures makes sense, and I'll implement that approach tomorrow to see how it works out. I also explored your second suggestion, but the extraction isn't feasible due to the numerous dependencies involved - the resulting validate method would need around 6 parameters, making it unwieldy. The first suggestion might be viable, though there's already a getHeaderNames method that serves a different purpose. Perhaps something like `getHeaderRecord(final String[] formatHeader)` would be more appropriate. -- 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]
