Example

public class ClassA {

private boolean bool1, bool2 = true;

public void methodA () {
if ((bool1=bool2)) {
//..
}
}

}


Solution
Do not use assignment operator/expression inside an if statement. Do the assignment outside the if and have a proper boolean expression in the condition.

public class ClassA {

private boolean bool1, bool2 = true;

public void methodA () {
bool1 = true;
if ((bool1==bool2)) {
//..
}
}

}