Closed rw00 closed 3 years ago
Given code similar to the following:/0
public static final String CONST = "..."; ... String k = ...; if (k.equals(CONST)) { ... }
Then there should be an option to automatically flip the operands of the equals method. After save, the code should look like:
if (CONST.equals(k)) { }
The downside of this is that it might hide NPEs.
This should be doable in IntelliJ because there's already a runnable action for it.
Hello @rw00 :wave:, thank you for opening this. This is a great idea, but I won't have time to implement this. But I'm accepting PRs, a adding an (existing) quick fix is really easy, if you want to look at it.
Move to https://github.com/dubreuia/intellij-plugin-save-actions/projects/2 (ideas)
Given code similar to the following:/0
Then there should be an option to automatically flip the operands of the equals method. After save, the code should look like:
The downside of this is that it might hide NPEs.
This should be doable in IntelliJ because there's already a runnable action for it.