google / google/google-java-format

Bug: error when too long line before ending triple quotes

Abierto
#969 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
6.2k
Forks
937
Merge medio
6 min
PR fusionados (30 d)
3

Descripción

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

```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.