Issue #19716: Fix SimplifyBooleanExpressionCheck with parenthesized boolean literals#19723
Conversation
3f2b0e1 to
29a121c
Compare
|
Github, generate report for SimplifyBooleanExpression/all-examples-in-one |
|
Fyi, it is taken from https://github.com/checkstyle/test-configs/tree/main/SimplifyBooleanExpression/all-examples-in-one You can use it to trigger test yourself. |
|
Report for SimplifyBooleanExpression/all-examples-in-one: |
|
@romani Why does CI report a shorter execution time as a performance regression? I saw this issue in multiple PRs and would like to know if this is intended. |
|
This is basic intention to catch performance degradation. But it not stable, as it depends on performance on Linux nodes. |
|
The average execution time is 324.67s while the baseline is 390.7s. May I know why is this an error since not only there is no preformance degradation, but execution is even faster? |
| temp = a() ? true : true; // violation, 'Expression can be simplified' | ||
| temp = value != null ? value : (false); | ||
| boolean w = c > 1 ? (true) : ((false)); // violation, 'Expression can be simplified' | ||
| boolean x = ((false)) ? c == 1 : c > 10; // violation, 'Expression can be simplified' |
There was a problem hiding this comment.
please put under violation line a line with simplified code to make sure simplied it same and has no violation.
16354f8 to
fe2644a
Compare
…thesized boolean literals
fe2644a to
2ed6199
Compare
fixes: #19716
Adds logic to skip parentheses when checking operands of ternary operators.