Community
Participate
Working Groups
This goes specially for String type Provide a refactoring option for converting the condition tests variable.equals(SOME_CONSTANT) to SOME_CONSTANT.equals(variables) This is also help quickly fixing some of the NPEs.
We already have a Quick Assist (Ctrl+1) called "Invert equals" that helps doing this manually. Doing this automatically for a whole project is dangerous, since it doesn't have to be semantically preserving. You never know how equals(..) is implemented in the two involved types, and some code could even expect to get NPEs. If we implement this, it will most likely be a Clean Up, not a Refactoring.
I did not know this. In fact, I thought Ctrl+1 works only on problem markers. It is good enough for me.