Example
public class
BadCallDemoClass {
public void
methodX() {
//do something...
methodY();
}
public void
methodY() {
//do something...
}
}
Solution
Depending on user requirements, certain methods should not be called from within other methods. For example, perhaps a remove() method should not be called from within an add() method.
public class
BadCallDemoClass {
public void
methodX() {
//do something... without calling methodY()
}
public void
methodY() {
//do something...
}
}