redhat-developer / redhat-developer/vscode-java
Alternative equals code generation
Abierto
@testforstephen ya está trabajando en esto.
Desde el 18/4/2019.
code action
enhancement
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.3k
- Forks
- 546
- Merge medio
- 20 h 1 min
- PR fusionados (30 d)
- 11
Descripción
Currently, the first part of an equals method is generated as:
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
// ...
However, I'd prefer to have it as:
if (this == obj) {
return true;
} else if (obj == null || getClass() != obj.getClass()) {
return false;
}
// ...
condensing + adding a blank line after it.
If the current generation should be retained, it would be great to have a configuration option to set the preferred style, analog to what is available for toString generation already.
Environment
- Visual Studio Code version: 1.33.1
- Java extension version: 0.43.0
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.
Evaluación
Este issue todavía no se ha evaluado.