Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative equals code generation #890

Open
anthonyvdotbe opened this issue Apr 18, 2019 · 0 comments
Open

Alternative equals code generation #890

anthonyvdotbe opened this issue Apr 18, 2019 · 0 comments

Comments

@anthonyvdotbe
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants