例如:
private final static Properties properties;
private final static SecretsInfo secretsInfo;
static {
properties = new Properties();
try {
Tools.loadProperties(properties, "../a2o.properties");
secretsInfo = getSecrets();
}catch(Exception ignore){
}
}
而
getSecrets()中又引用了properties,这就会造成循环引用。会有空指针报错。nullpointerException。
而在tomcat 中,可能会在log中,有<clinit>的标注,配合空指针,就可能是有static 变量形成了cycle的循环引用。