[Java] check Boolean assignment to boolean

I did not find any rule that finds possible NullReferenceExceptions when a Boolean value is assigned to a bool value by autoboxing.

private bool foo

public void setFoo(Boolean foo) {
  this.foo = foo; // non compliant

Hey @reitzmichnicht,

We actually already have a ticket to cover this case, here: SONARJAVA-2126

I can’t promise when we are going to implement it, but it’s on our radar.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.