getCanvas() recursion problem

Hello.

I have a class that extends a Canvas subclass (VLayout for example) and implements an interface. Lets call this class MyVLayout.

The interface declares a method with the following signature:
public Canvas getCanvas();

public class MyVLayout extends VLayout implements MyInterface {

    public MyVLayout(...) {
       ...
   }

   @Override
   public Canvas getCanvas() {
      return this;
   }

}

Whenever I try to add MyVLayout to any other class that takes in a Canvas, I end up with an infinite loop.

HLayout otherLayout = new HLayout();
otherLayout.addMember(MyVLayout.getCanvas()); // causes infinite loop

[edited : removed]

Although there are no methods with the getCanvas() signature in VLayout class or even in the Canvas class, this is somehow causing problems. My assumption is that the library is using this internally somehow.
Or then maybe not… I modified the method signature in the interface and the problem still happens.[edited]

Using 2.5.2011-05-14-EVAL library.

Thank you.

As you seem to be realizing, this doesn’t have to do with your getCanvas() override, and obviously the code you’ve posted is not enough to guess the cause. Let us know once you’ve narrowed down possibilities some more.

Correct.
I will be creating a set of simple classes in order to reproduce the problem and I will post them when ready.