Error formatting long string literal that contains "...\\t"
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/google-java-format
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/google-java-format#1094 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
google/google-java-format#1450 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
google/google-java-format#1439 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
google/google-java-format#1436 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
google/google-java-format#1428 · 4 comments ·
Maintainers usually reply within 1 day
All issues in google/google-java-format
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nextcloud/notes-android#3367 ·
Maintainers usually reply within 1 day
-
Feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MuntashirAkon/AppManager#2058 ·
-
SarifLogger: artifactLocation.uri is not properly encoded for file names containing '#', '?', or '%'Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
checkstyle/checkstyle#21721 ·
Maintainers usually reply within 1 day