Repository navigation
Conversation
CSVFormat.Builder builds quotedNullString, the token QuoteMode.ALL uses for null values, by concatenating the quote character around the null marker. A marker that contains the quote character closes its own encapsulation, so CSVPrinter emits CSV that its parser rejects with "Invalid character between encapsulated token and delimiter". CSV-328 already fixed an invalid quoted null marker built in the wrong setter order; this escapes embedded quote characters too, the same way printWithQuotes does for a value. Assisted-By: DeepSeek Harness
simpleqt
force-pushed
the
fix/null-marker-quoted-marker
branch
from
November 16, 2026 11:25
5b5029d to
6e55808
Compare
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.
With
QuoteMode.ALL, a null value is printed asquotedNullString, whichCSVFormat.Builderbuilds by concatenating the quote character around the null marker. A marker that itself contains the quote character closes its own encapsulation, so the printer emits CSV its own parser rejects:CSV-328fixed a quoted null marker built in the wrong setter order; embedded quote characters in the marker were never escaped.setQuotedNullString()now doubles the quote character inside the marker, the same way the printer does for an ordinary value, so the emitted token stays a single valid encapsulated field and round-trips throughCSVParser.Test
CSVPrinterTest.testQuotedNullStringEscapesEmbeddedQuoteCharacterprints("x", null)with a marker that contains the quote character, asserts the exact CSV text, and then parses it back and asserts both values. With the source change reverted:With the change: the focused test passes, and the full module suite (
mvn -B -o -ntp "-DargLine=-Dfile.encoding=UTF-8" test, needed because this host's default encoding is GBK) passes. The commit carries anAssisted-By:trailer.