Bug: error when too long line before ending triple quotes
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Start by reproducing the failure with the provided Problem.java example using google-java-format-1.17.0. Trace the formatter behavior for a long text block immediately before the closing triple quotes; done means formatting completes without the AST-change error and produces the expected concatenated string.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I have a very simple example where google-java-format errors:
class Problem {
static String problematic() {
return """
A too long string directly before the ending triple quote seems to cause a problem with google java formatter""";
}
}
When I run the formatter on this file (using java -jar /path/to/google-java-format-1.17.0-all-deps.jar /path/to/Problem.java) I get the following error:
/path/to/Problem.java:error: Something has gone terribly wrong. We planned to make the below formatting change, but have aborted because it would unexpectedly change the AST.
Please file a bug: https://github.com/google/google-java-format/issues/new
=== Actual: ===
class Problem {
static String problematic() {
return "A too long string directly before the ending triple quote seems to cause a problem\"\n + \" with google java formatter";
}
}
=== Expected: ===
class Problem {
static String problematic() {
return "A too long string directly before the ending triple quote seems to cause a problem with google java formatter";
}
}
- Langage dominant
- Java
- Étoiles
- 6.2k
- Forks
- 936
- Merge moyen
- 6 min
- PR mergées (30 j)
- 3
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de google/google-java-format
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
google/google-java-format#1094 · 1 commentaire ·
-
Complementary Teamups Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
google/google-java-format#1450 · 1 réaction ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
google/google-java-format#1439 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
google/google-java-format#1436 · 2 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
google/google-java-format#1428 · 4 commentaires ·
Toutes les issues de google/google-java-format
Issues similaires
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Ouvertearea/plugin
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Add canonical URLs and a sitemap Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/rocketmq-dashboard#5064 ·