Content

The Bald Man Speaketh

IntelliJ IDEA – Refactoring

Tuesday 22 June 2010 - Filed under IntelliJ + What's the best ActionScript IDE? + videos

You can see a list of some of the additional refactoring features coming in the next release of IntelliJ IDEA here. If you’re a java developer, these refactoring features (and even more) are already available (yes, we’re jealous).

*Notes – If you have a keen eye, you may have noticed my memory usage in IntelliJ getting pretty high while I was recording. Rest assured this was because I have 4 instances of IntelliJ running with multiple projects I was working on today on my other monitor and forgot to close them before I started recording.

If you’re interested in the “art” of refactoring to clean up “code smell”, I HIGHLY recommend the book “Refactoring” by Martin Fowler (that’s one of the books I always keep in my “recommended books” sidebar widget)

2010-06-22  »  johnlindquist

  • Konstantin Bulenkov
    It's not necessarily to create com package, and then example package inside com. You can just trigger Alt+Insert on src and then type com.example.bla.bla to create package hierarchy at once.
  • Wow I didn't know you could move constants. with move. Nice.

    One thing to note, if you use dynamic classes, object initialisers, or uncast results of Object or '*', you need to use the preview method of 'rename' for methods/properties. The reason is easily shown through example.

    Somewhere in code you have myFoo:Object = { list: "A, B, C" };

    Elsewhere you have a class/property: MyClass#list

    If you rename MyClass#list to, say, MyClass#things, then IntelliJ finds references to myFoo.list and renames that to "things". Can't much blame IntelliJ. MyClass is a subclass of Object.
  • johnlindquist
    Yeah, I also didn't show how it usually does a good job of warning you if a refactoring will have some sort of naming conflict to see if you want to confirm/ignore the move.
blog comments powered by Disqus