Example

public class ClassA {
Object o;
Object o2;
public void methodA {

while(o.equals(o2)) {
//...
} }

}
Solution
Assign the o.equals(o2) to a variable and use the variable as the loop condition

public class ClassA {
Object o;
Object o2;
public void methodA {

boolean b = o.equals(o2); while(b) {
//...
b = o.equals(o2); } }

}