Ok, so I have a couple of classes that basically look like this.
public class Foo implements Serializable {
private A a;
//More code
}
public class A implements Serializable {
public Vector vector = new Vector();
//More code
}
public class B implements Serializable {
private transient A parent;
//More code
}
public static void main(String[] args) {
A a = new A();
a.vector.add(new B(a));
Foo foo = new Foo(a);
//More code to write foo with OpenHFT
}
So the oddity here is that A and B point at each other cyclically, where A
has B
in its attribute vector
and B
has A
as its attribute parent
. Normally this would be an issue if you tried to write it since it would result in an infinite loop. Hence the use of the transient
keyword on parent
.
However, for some reason OpenHFT is not registering the fact that parent
is set to be transient and is still trying to write it, resulting in me getting a StackOverflowException (hehe, actually asking about a StackOverflowException on Stack Overflow, that's a first).
Any suggestions as to why this might be happening?
Btw, I'm importing OpenHFT using Maven and I'm using version 5.17.17