简体   繁体   English

在Eclipse中将package-private变量更改为private

[英]Change package-private variable to private in Eclipse

I want to change all variables and methods with default access modifiers to private only if its possible (If the variable is not been accessed outside class). 我只想在可能的情况下(如果未在类外部访问变量)将具有默认访问修饰符的所有变量和方法更改为私有。 eg 例如

String test = null;

void setTest(String s) {
    this.test = s;
}

If abovementioned method and variable are not accessed outside class, is there a way to make them private ? 如果不在类外部访问上述方法和变量,是否可以将它们设为private I can't do it manually, I'm working on a huge code base and it contains around a million of similar issues. 我无法手动完成,我正在开发庞大的代码库,其中包含大约一百万个类似的问题。

Please do mention if similar thing is possible with Intellij community edition. 如果Intellij社区版可能发生类似的事情,请提及。

Not exactly what i wanted but following plugin can help us in it. 不完全是我想要的,但是跟随插件可以帮助我们。

http://www.ucdetector.org/faq.html http://www.ucdetector.org/faq.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM