home-climate-control / dz

Home Climate Control Core: *the* Open Source multi-zone temperature and climate control system.
http://homeclimatecontrol.com/
GNU General Public License v3.0
59 stars 7 forks source link

Sonar nagging about nullability #282

Closed climategadgets closed 12 months ago

climategadgets commented 12 months ago

Expected Behavior

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

Actual Behavior

Sonar complains

As of rev. 8943b351376d9256b7568b1e692009d1cfc15319:

            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

climategadgets commented 12 months ago

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

climategadgets commented 12 months ago

Verdict: Sonar is dumb often.