home-climate-control/dz

Sonar nagging about nullability

Closed this issue · 2 comments

Expected Behavior

No Sonar nagging, voting can rightfully be null there and a null value is acceptable

Actual Behavior

Sonar complains

As of rev. 8943b35:

            return new ZoneSettings(
                    enabled == null || enabled,
                    setpoint,
                    voting == null || voting,

^^^ A "NullPointerException" could be thrown; "voting" is nullable here.

                    null,
                    dumpPriority == null ? 0: dumpPriority);

Corrective Action

Verify and either correct the problem or shut Sonar up

No, Sonar is stupid. As of rev. bf871b3, it now complains about enabled as well.

Verdict: Sonar is dumb often.