google / google/google-java-format

Bug: error when too long line before ending triple quotes

Ouverte
#969 1 commentaire 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
6.2k
Forks
937
Merge moyen
6 min
PR mergées (30 j)
3

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";
}
}

```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.