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

Spoon remove parenthesis in ternary operator with assigment #668

Closed
dima74 opened this issue May 19, 2016 · 2 comments
Closed

Spoon remove parenthesis in ternary operator with assigment #668

dima74 opened this issue May 19, 2016 · 2 comments

Comments

@dima74
Copy link
Contributor

dima74 commented May 19, 2016

Hello, thank you for Spoon!
There is a little problem, if I run Spoon on this class

public class Main {
    public static void main(String[] args) {
        boolean a;
        int x = (a = true) ? 7 : 666;
    }
}

then I have next:

public class Main {
    public static void main(java.lang.String[] args) {
        boolean a;
        int x = a = true ? 7 : 666;
    }
}

So, parenthesis are missing and resulting code doesn't compile.

@GerardPaligot
Copy link
Contributor

Nice. Spoon puts too much parenthesis everywhere, except here. :)

PR as soon as possible.

@dima74
Copy link
Contributor Author

dima74 commented May 20, 2016

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants