Hide Utility Class Constructor : Utility classes should not have a public or default constructor

前端 未结 10 1248
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 03:51

I am getting this warning on Sonar.I want solution to remove this warning on sonar. My class is like this :

public class FilePathHelper {
    private static Stri         


        
10条回答
  •  梦毁少年i
    2021-01-30 04:24

    You can just use Lombok with access level PRIVATE in @NoArgsConstructor annotation to avoid unnecessary initialization.

    @NoArgsConstructor(access = AccessLevel.PRIVATE)

    public class FilePathHelper {

    // your code

    }

提交回复
热议问题