Java Singleton Class中的SonarQube漏洞——必须避免静态对象,移动到本地成员以避免全局状态

SonarQube vulnerabilty in Java Singleton Class-- Static Objects must be avoided, move to local members to avoid global state

private static IaddRegionDao iaddRegionDao=null;

public static IaddRegionDao getInstance()
{
    if(iaddRegionDao == null)
    {
        iaddRegionDao = new IaddRegionDaoImpl();
    }
    return iaddRegionDao;
}

我上面的代码是数据库连接的单例 class。但是在 SonarQube 中,代码质量检查给我以下错误:

Static Objects must be avoided, move to local members to avoid global state

谁能帮我解决这个问题?

将此标记为误报。有效场景..