Yup. Note Rectangle2D.Double extends from Rectangle2D. During the replication process, a setter method:
setFrame(Rectangle2D)
is detected in the target instance, so Beanlib proceeds to retrieve the property from the source instance by invoking the getter method (inherited from java.awt.geom.RectangularShape.java):
getFrame()
The implementation in RectangularShape.java:
public Rectangle2D getFrame() {
return new Rectangle2D.Double(getX(), getY(), getWidth(), getHeight());
}
Here's the problem: a new Rectangle2D.Double instance is created every time the getFrame method is invoked, and Beanlib would try to replicate the new instance, which recursively leads to invoking the getFrame method again on the newly created instances. Hence the stack overflow.
The solution is provide your own custom transformer to deal with Rectangle2D.Double instead of using the default behavior. See more details at:
Hope this helps.
Hanson