如何在Sonar上禁用警告:隐藏实用程序类构造函数?
2022-08-31 08:18:29
						我在Sonar上收到此警告:
隐藏实用程序类构造函数:
实用程序类不应具有公共或默认构造函数
我的班级:
public class FilePathHelper {
    private static String resourcesPath;
    public static String getFilePath(HttpServletRequest request) {
        if(resourcesPath == null) {
            String serverpath = request.getSession()
                                       .getServletContext()
                                       .getRealPath("");
            resourcesPath = serverpath + "/WEB-INF/classes/";   
        }
        return resourcesPath;       
    }
}
我想要解决方案来删除Sonar Qube上的此警告。