Reputation: 862
How can I perform a single action in Eclipse Java code formatter? For example I want to clean up every occurrence of
if (bla) {
...
}
else {
...
}
To this
if (bla) {
...
} else {
...
}
But nothing else. I need this to clean up specific findbugs issues. If I'd run the whole code formatter actions on the project, it would lead us into merge hell. So I want to handle such findbugs issues one by one and therefore It would be great to just execute such a single rule. The Version of Eclipse wouldn't matter, right now I tried with the latest Luna.
Upvotes: 0
Views: 50
Reputation: 15212
A quick way to do this would be to use the search and replace option in eclipse. Go to Search menu->File
Search for : \}\s+\n\s+else\s+\{
Replace with : } else {
Upvotes: 1