Question

For consistency I want to add "this." prefix to all classes members. I have done it when I wrote the code, mostly.

How can I get Eclipse to add "this." to the members I forgot.

I found that Java Editor Coding style has a check option for that, but when I clean up, or format the code the prefix is not added where it is missing.

Was it helpful?

Solution

Clean Up does exactly what it's told to do, but by default it doesn't include qualifying field accesses. In the Preferences dialog Under Java->Code Style->Clean Up, you have to create your own profile and set it to do so if you want the Clean Up action to do this.

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top