Xiaoven / codegex

A light-weight tools like spotbugs
GNU Lesser General Public License v2.1
1 stars 0 forks source link

False Negative for RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN #58

Closed Xiaoven closed 3 years ago

Xiaoven commented 3 years ago

link

public static Parameter<Boolean> norms(boolean defaultValue, Function<FieldMapper, Boolean> initializer) {
        return Parameter.boolParam("norms", true, initializer, defaultValue)
            .setMergeValidator((o, n, c) -> o == n || (o && n == false));  // norms can be updated from 'true' to 'false' but not vv
    }
Xiaoven commented 3 years ago

n == false didn't trigger warnings no matter the type of n is boolean or Boolean by spotBugs IDEA plugin with maximal effort and low minimal confidence.