Reputation: 28761
I had a function which became too big, so I refactored variables into fields on a (new) class and parts of the method to methods on the class. My function now looks like this
void doSomething() {
Resource resource = ....
new HelperClass(resource)
.doFirstThing()
.doSecondThing()
.closeResource();
Now I wish to do the inverse transformation (because the doSomething function is actually a testcase and I need to produce a nice linear testcase that I can post to Issue Tracker).
How do I do this using automatic refactoring tools in IntelliJ Idea Community?
Upvotes: 1
Views: 84
Reputation: 8202
I don't think a direct undo is possible, but check the local history (right click -> Local History -> Show History) to view previous versions of the original class. These versions will have been created automatically by IntelliJ when various events have occurred, including saving after changes. You can then selectively restore the state you want
Upvotes: 1