This expression always evalutes to true prefer a boolean literal for clarity see httpserrorproneinfobugpatternComplexBooleanConstant Did you mean if true
Yes, the expression (see https://errorprone.info/bugpattern/ComplexBooleanConstant) is always true. The suggestion to use a boolean literal (true or false) instead of a complex expression is to improve code readability and clarity.
So, instead of writing:
if ((see https://errorprone.info/bugpattern/ComplexBooleanConstant)) {
// code
}
It is recommended to write:
if (true) {
// code
}
The boolean literal true clearly conveys the intention of the condition, making the code easier to understand
原文地址: http://www.cveoy.top/t/topic/iX5J 著作权归作者所有。请勿转载和采集!