Allow to provide source file java language version
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
Línea de trabajo
Comienza rastreando cómo google-java-format acepta opciones del analizador y de la línea de comandos; después, revisa el análisis de JLS Section 3.8 sobre los identificadores reservados sensibles a la versión. Determina si source o release es la opción adecuada para el usuario y verifica que el formateo de código fuente Java antiguo con identificadores como var, yield o record se realice correctamente, mientras que el formateo del código fuente actual no cambie.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 6.2k
- Forks
- 936
- Merge medio
- 6 min
- PR fusionados (30 d)
- 3
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/google-java-format
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
google/google-java-format#1094 · 1 comentario ·
-
Complementary Teamups Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
google/google-java-format#1450 · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
google/google-java-format#1439 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
google/google-java-format#1436 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
google/google-java-format#1428 · 3 comentarios ·
Todos los issues de google/google-java-format
Issues similares
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Abiertoarea/plugin
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
wso2/dpdp-accelerator#287 ·