Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I automatically change method/class access levels in IntelliJ?

A lot of the time, I start out with methods being public and then reducing them to the lowest levels needed after I finish, but that's kind of tedious. Is there a way to automatically change all the privacy modifiers (for both classes and methods) to the lowest ones possible all at once?

like image 393
user8578415 Avatar asked Oct 24 '25 15:10

user8578415


1 Answers

It is possible: Analyze | Run inspection by name, and enter Declaration access can be weaker name for the inspection. Then run the inspection for the project and fix all the occurrences in the project by one click in Inspection results tool window.

like image 169
Andrey Avatar answered Oct 26 '25 05:10

Andrey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!