Allow to provide source file java language version
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia tracciando il modo in cui google-java-format accetta le opzioni del parser e della riga di comando, quindi esamina la discussione di JLS Section 3.8 sugli identificatori riservati sensibili alla versione. Determina se source o release sia l’opzione appropriata per l’utente e verifica che la formattazione di codice sorgente Java meno recente con identificatori come var, yield o record abbia esito positivo, mentre la formattazione del codice sorgente attuale rimanga invariata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When formatting files with google-java-format, the parser uses the same source version as its own runtime version (running google-java-format on JDK X implies that that Java source files are conformant with JDK X), but this is actually not necessary true and files may be aiming for a different (older) Java version. Nowadays it is a common pattern to use --release flag to compiler for a specific older version of the language using a newer JDK.
Unfortunately Java language is not fully backward compatible and some features have introduced breaking changes like reserved identifiers var, with, yieldorrecord` (see current list in JLS Section 3.8)
For files who were designed to compile with an older Java version and who are using now reserved identifiers, this cause their processing with google-java-format using a recent JDK version to fail.
A solution would be to allow to pass either the source or the release option to the java parser to adapt its own parsing to the java version used by the file.
- 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 · 4 commenti ·
Tutte le issue di google/google-java-format
Issue simili
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Apertaarea/plugin
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
wso2/dpdp-accelerator#287 ·