Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error formatting long string literal that contains "...\\t"

Open
#1,186 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Reproduce the report with the long string literal in Test.java using google-java-format_windows-x86-64.exe, then compare behavior with --skip-reflowing-long-strings. Trace the long-string reflowing path and verify that the problematic literal formats successfully without that workaround.

Written by the indexing model from the issue text.

Description

In version n1.24.0 of google-java-format_windows-x86-64.exe a long string literal that contains two backslashes followed by 't' results in an error.

Negative example:

  String t =
   "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\\t";

Tool invocation and error message:

$ google-java-format_windows-x86-64.exe -r --skip-removing-unused-imports  test\Test.java
Test.java:29:7: error: unclosed string literal
   "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\\t";

Positive example. This can be formatted.

  String s = "01234567890123456789012345678901234567890123456789\\t";

Update: Using parameter --skip-reflowing-long-strings avoids this error!

Dominant language
Java
Stars
6.2k
Forks
936
Avg merge
6m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/google-java-format

All issues in google/google-java-format

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.