I have this classes:
public class User {
public static final NonRegisteredUser NON_REG_USER = new NonRegisteredUser();
//...
public static class NonRegisteredUser extends User {
//...
}
}
And code inspector is detecting this warning:
Referencing subclass NonRegisteredUser from superclass User initializer might lead to class loading deadlock
What does it mean exactly?
NonRegisteredUserin theUserclass. Every time you load theUserclass, since theNON_REG_USERis static it will lead to an eternal loop cause theNonRegisteredUserextends theUserand so on..