5 ms·
> IntelliJ's refactoring tools that ensure all code (that's in your project at least) gets rewritten in the same moment the refactoring occurs That's the same
by adrianmsmith 6y ago
> IntelliJ's refactoring tools that ensure all code (that's in your project at least) gets rewritten in the same moment the refactoring occurs
That's the same as Eclipse (e.g. rename method), right? What's the benefit of IntelliJ here?
- dcminter 6y agoPretty much. They both have refactoring operations, but they're a slightly different set. (Edit: Some of the IntelliJ operations are distinctly superior to the Eclipse ones. But not all. In my experience I'd say they're about even here.) For example, in Eclipse it's trivial to take an inner class and move it to its own file. In IntelliJ that doesn't seem to be an option. And that's a breaking change if I do it manually, which is where the Problems panel is so useful. Not forgetting TDD where in Eclipse I can write multiple tests for a feature before any code exists and run them before the unit I'm testing even fully compiles! For example, in this screenshot one of the methods the test class invokes doesn't exist: https://paperstack.com/img/ides/eclipse_run_broken_code.png https://paperstack.com/img/ides/eclipse_run_broken_code.png
- pavlus 6y ago1. For static class: Refactor > Move Inner Class then choose from: a) move it to upper level (new java file), or b) move to another class 2. For non-static class: Refactor > Move Inner Class to Upper Level Then you can select class name and parameter name of formerly enclosing class.
- dcminter 6y agoAh yes, you're right. Maybe it's Groovy classes that this doesn't work for? Still, when a refactoring operation doesn't exist for a code change (even if it's due to operator ignorance) it's nice to have the Problems pane to tidy up with.