We have started to implement checkstyle as a way to provide a consistent code style across developers. One of the checks requires that all instance variables be references using “this.”. I have not been in the habit of using “this.”, and so have thousands of instances that need to be fixed.
Is there a tool or IntelliJ plugin that can just run through and add the appropriate code?
So ‘checkstyle’ is mistaken.
Quite right. It’s redundant. Good for you.
So you are mistaken.
You don’t have any instances that ‘need to be fixed’.
Don’t do it. It’s redundant. Don’t perform redundant work. Nobody wants to pay for it, and why should they? Modify your checkstyle configuration so as not to require it. Don’t let tools tell you how to spend money, and don’t be fooled that a ‘consistent code style across developers’ is essential to delivering a working product. It isn’t, as long as the code is legible and maintainable. I have seen more time and money wasted on this issue than I care to think about.