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

Remove AvoidInlineConditionals from sun_checks.xml #6470

Closed
Vampire opened this issue Feb 24, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@Vampire
Copy link
Contributor

commented Feb 24, 2019

Maybe I'm blind, but where does the Sun style guide forbid the ternary operator?
The sole mention I find in https://www.oracle.com/technetwork/java/codeconventions-150003.pdf is, that the condition should be parenthesized if it contains a binary operator.

https://checkstyle.org/config_coding.html#AvoidInlineConditionals

Rationale: Some developers find inline conditionals hard to read, so their employer's coding standards forbid them.

@romani

This comment has been minimized.

Copy link
Member

commented Mar 3, 2019

https://www.oracle.com/technetwork/java/javase/documentation/codeconventions-137265.html#353
ternary operator is completely ok by Sun style, at least in its latest form.

I do not see "Sun" in our documentation for this Check.
But I see it in config - https://github.com/search?q=path%3Asrc%2Fmain%2Fresources+filename%3Asun_checks.xml+repo%3Acheckstyle%2Fcheckstyle+AvoidInlineConditionals

Check should be removed from config.

@romani romani added the approved label Mar 3, 2019

@romani romani changed the title AvoidInlineConditionals in sun style? Remove AvoidInlineConditionals from sun_checks.xml Mar 3, 2019

Vampire added a commit to Vampire/checkstyle that referenced this issue Mar 7, 2019

@romani romani closed this in #6524 Mar 8, 2019

romani added a commit that referenced this issue Mar 8, 2019

@romani romani added the bug label Mar 8, 2019

@romani romani added this to the 8.19 milestone Mar 8, 2019

Vantuz added a commit to Vantuz/checkstyle that referenced this issue Apr 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.