Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bug: error when too long line before ending triple quotes

Aperta
#969 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
6.2k
Fork
936
Merge medio
6m
PR unite (30g)
3

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google/google-java-format

Tutte le issue di google/google-java-format

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.