I have the following problem:
1) There is some abstract class A with several anonymous subclasses stored in static fields of A. There is a circular relationship between two anonymous subclasses. The code for this abstract class is similar to the following:
class A implements Serializable
{
public static final A _1 = new A() {
public A foo()
{
return _2;
}
};
public static final A _2 = new A() {
public A foo()
{
return _1;
}
};
public static final A _3 = new A() {
public void bar()
{
}
};
}
2) Class A instances refer to other objects that are used in serialization. There are some objects that are pre-serialized by developers and then included in the release as binary data.
A . , java-. .class, , , A, _1, _2 _3, A $1, A $2 A $3 , .class , , , A, _1, _2 _3, A $2, A $3 A $1 . - pre-serialized , - .
- java- JVM, , ? JLS , , "$" - - .
, , "" , , . , , , , .