Support JEP 512: Compact Source Files and Instance Main Methods
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia riproducendo il malfunzionamento di v1.25.1 con l’esempio segnalato learn/jbang/hello.java e analizza le JEP 445, 463, 477 e 495. Determina le modifiche necessarie al formatter per i file sorgente compatti e i metodi main di istanza, quindi verifica che l’esempio venga formattato correttamente senza l’errore “did not generate token”.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In https://github.com/enola-dev/enola/pull/974 for https://github.com/enola-dev/enola/issues/971 with https://github.com/enola-dev/enola/issues/970, I am using "Java's fancy modern main style", AKA the JEP 445 & 463 & 477 & 495 stuff:
- https://openjdk.org/jeps/445
- https://openjdk.org/jeps/463
- https://openjdk.org/jeps/477
- https://openjdk.org/jeps/495
So I have e.g. a hello.java which looks e.g. like this, which is actually valid (with --enable-preview) Java 21 syntax:
import static java.lang.System.out;
void main() {
out.println("Hello World: " + dev.enola.common.Version.get());
}
google-java-format chokes on this with:
stderr: learn/jbang/hello.java:26:6: error: did not generate token "void"
void main() {
This is on v1.25.1, which is the 2nd most recent release today; looking at the 1.25.2 Release Notes, I have no reason to believe that this (just) got fixed there; ergo reporting this here.
Stating that google-java-format does not support --enable-preview would be valid. But from what little I figured (so far) this feature, contrary to e.g. those preview String Templates which then got removed again, this syntax appears to be here to stay, so probably should be supported, sooner or later.
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/google-java-format
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/google-java-format#1094 · 1 commento ·
-
Complementary Teamups Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
google/google-java-format#1450 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
google/google-java-format#1439 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
google/google-java-format#1436 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
google/google-java-format#1428 · 3 commenti ·
Tutte le issue di google/google-java-format
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
FasterXML/jackson-databind#6229 ·