如何解决 PMD Violation : 使用显式范围而不是默认的包私有级别

yb3*_*rod 4 java default pmd package scoping

我想修复我的代码PMD 违规:

Use explicit scoping instead of the default package private level
Run Code Online (Sandbox Code Playgroud)

它出现在我的代码中的这些地方:

File saveFile = new File("C:/Upload/"); 
EmployeImplMetier dbE= new EmployeImplMetier();
DepartementImplMetier dbD = new DepartementImplMetier();
FonctionImplMetier dbF = new FonctionImplMetier();
ServiceImplMetier dbS = new ServiceImplMetier();
TypePaiementImplMetier dbT = new TypePaiementImplMetier();
ModePaiementImplMetier dbM = new ModePaiementImplMetier();
Run Code Online (Sandbox Code Playgroud)

我之前找到了这个LINK但它没有帮助。
谁能建议如何修复它?

cod*_*box 5

这些变量都应该使用private关键字声明:

private File saveFile = new File("C:/Upload/"); 
Run Code Online (Sandbox Code Playgroud)

如果您需要从声明它们的类之外访问它们,则实现一些getXxx方法。