[CSV-328] Fix quoted null string after disabling quote#612
Merged
garydgregory merged 1 commit intoJun 18, 2026
Merged
Conversation
garydgregory
requested changes
Jun 18, 2026
garydgregory
left a comment
Member
There was a problem hiding this comment.
Hello @OldTruckDriver
Thank you for the PR, please see my comment.
| return this; | ||
| } | ||
|
|
||
| private void setQuotedNullString() { |
Member
There was a problem hiding this comment.
@OldTruckDriver
Please keep and use the fluent style.
Contributor
Author
There was a problem hiding this comment.
Done. Made setQuotedNullString() return the Builder and used return in the setters. Thanks
setNullString(String) rebuilt quotedNullString by concatenating the nullable quoteCharacter field directly, so calling setQuote(null) before setNullString(...) produced a literal "nullNULLnull". Extract a shared setQuotedNullString() helper that applies the default-quote fallback, so both builder orders produce the same state. Reviewed-by: OpenAI Codex Reviewed-by: Anthropic Claude Code
ce08e8c to
a6ee67e
Compare
Member
|
Jira ticket is https://issues.apache.org/jira/browse/CSV-328 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[CSV-328] Fix quoted null string after disabling quote
CSVFormat.Builder#setNullString(String) rebuilt quotedNullString by concatenating the nullable quoteCharacter field directly. When setQuote(null) was called before setNullString("NULL"), QuoteMode.ALL printed null as nullNULLnull instead of "NULL".
This change makes setNullString(String) and setQuote(Character) use the same quoted-null-string update logic, preserving the existing fallback to the default double quote when the quote character is disabled.
Tests cover both setter orders for setNullString("NULL") and setQuote(null).
Tests run: