Refactoring Browser For Java

There is no standard Refactoring Browser for Java as there is for Smalltalk, however there are various refactoring tools available:

Free:

Eclipse Ide, www.eclipse.org (this is open source under the Common Public License version 0.5.)

*Eclipse provides a number of useful refactorings and also supports JUnit.

Commercial:

CloneDR at www.semdesigns.com . Code duplication removal.

IntelliJ IDEA at www.intellij.com IDE supporting various refactorings including renaming any reference, extract-method, introduce variable, package renaming/migration. (See also Intellij Idea and Why Intellij Idea Is Cool.)

jFactor by Instantiations at www.instantiations.com (was called Alchemy during development) -- currently (2001-02-05), this currently works with Visual Age (See Instantiationsj Factor). Instantiations is planning the release of a version of jFactor for JBuilder in July 2001.

RefactorIT 2.0 www.refactorit.com Plug-in for Net Beans, Forte, JDeveloper, JBuilder. Also a standalone version. ( Just plug-ins these days. Must have for Net Beans, as their refactoring support is minimal, even in release 4, they depend on RefactorIT for refactoring and metrics. ) -- jim caprioli

Xrefactory, (also known as X-ref and Xref-Speller) www.xref-tech.com . Plug-in for Emacs and XEmacs.

[dead] Code Morpher from www.xptools.com . The Safe Refactoring tool for Java.

[dead] Retool - www.chive.com . New version released that supports Oracle 9i JDeveloper. (chive abandoned Retool at October 1, 2002)


Refactoring Browser For Csharp doea anyone know of any available yet, given that CSharp and Java are very similar are these java ones being ported? -- Solon Edmunds


I'd like to see some comments from folks who've used these tools. I've played a bit with JRefactory and Intellij Idea, but not on serious stuff. Some of the people at Thought Works are using Intellij Idea and it seems to be going down well.

We're using IntelliJ IDEA 2.5 in a small XP team at the moment. It really kicks the lama's ass. I've been programming for around 20 years now, and have never used a tool anywhere close to being this good before. It's refactoring support is years ahead of any other java refactoring tool currently available, and it has so many time saving features. E.g. When creating a new variable, say a Vector you could type

Vector [ctrl-space]

and it responds with

Vector vector

if you then type '= new [ctrl-shift-space]' it completes the 'Vector()' bit for you.

Just little things like that, and the fact that it pastes code to line up with your current indent level, are massive time savers. I would recommend it to everyone. --Bryan Dollery

I use Intellij Idea. It's ruined every other IDE for me. They all pale in comparison. better than the ctrl-space above are the live templates. these REALLY save time. I can do "itit" and get a Iterator and a loop set up for me to type my code in. saves at least 20 seconds. same with "itar" which finds the last-most declared array and creates a for loop looping over it... I know it sounds simple but this stuff saves you so much time! Not to mention you can design without fear of manual refactoring. I can code all my stuff in one big ugly method and extract helper methods and introduce constants.. move stuff to classes to make better OO design. it truely makes development and entirely different process.


Here's what I like about Intellij Idea. Whenever you need a new class, you use the intuitive, natural, and effective method of pretending you already had it. When you later feel it's time to materialize it, you just trigger the creation, strike a few key combos representing the general features of the class and Intellij Idea whips the whole thing out for you -- complete with every piece of information about it you implicitly made available by describing it. Right after you first try it, you're going to sit around conjuring up slews of code and slamming it around between methods and classes as if you were doing tricks in a skateboard game. When you become more experienced with it, you're going to still be working like that, but doing more and better tricks faster.

After playing with it for a while for the first time, I was beginning to wonder what the hell my role was, since Intellij Idea was already writing all the code for me. Then I realized my role was deciding what the code should look like -- where to go from here -- and without having to worry about all the uninteresting and tedious work of copying and pasting, creating and deleting files, searching and replacing, and writing stereotypical for loops, that job is just basically letting your creativity flow freely. My only major problem with this piece of software is that it's really resource-heavy; you need a modern computer to run it without much frustration.

And no, I don't work for IntelliJ.


Code Rush for Delphi does inline templates very very nicely, and much more, but these are not really refactorings

-- Solon Edmunds

I'm using Intellij Idea. It doesn't have a lot of refactorings yet but the ones it does have are powerful and well implemented. 2.0 has been recently released. Great feature list that goes beyond just refactoring devilvers some really great timesavers. Big improvements over 1.0

I've been using jFactor for a while. I find that for the most part it's a great tool, though there are kinks. Pull-up field and pull-up method, for instance, doesn't want to work for me except for abstract methods. I've played with Intellij Idea a bit, and like it too, though jFactor certainly has more refactorings available & leverages Visual Age's environment well. --Stu Charlton


Now you should give the Idea 3.0 Beta a try. Sign up for Jet Brains early adopter's program (EAP). The major refactorings are about the same, but the IDE has even more ease of use features and is much easier on the eyes. It now has an open API and the Windows and Linux version are equivalent.

I've recently tried Eclipse also. The new Eclipse has many of the same refactoring features, but it's UI is typically IBM weird (like the VA products). An example is that you STILL have to import and compile all of your old code to create a project. You then have to export it, even though the code is stored as a text file (thank god, not a repository like VAJ!) To top it all off, the text just looks ugly in the editor. When I put them side by side you can see that Eclipse just has a sloppy text formatter when compared with Idea. Line spacing seems to be the major culprit.

The big thing here is that both of these tools have grown up. If you can afford a few hundred dollars for a great IDE, then get Idea. Otherwise you won't go wrong with Eclipse one you get used to it. --Jeff Furgal

----

I've written Net Beans ports for both JRefactory and Transmogrify but Intellij Idea 2.0 is the best file-based IDE I have ever used. Some people have told me that VAJ with jFactor is even better but I have not had direct experience -- Jason Yip


There is a list of Refactoring, Testing and Aspect tools on:

Refactoring and Aspect Tools:

Java Skyline:
Architecture, www.javaskyline.com

I've been using Intellij Idea a lot. I've also just started using Headway reView - a commercial tool for analyzing dependencies of existing programs. So far, it looks great. I've been using it on a fairly complex project. -- Rich Katz


What about to create a suite of simple refactoring benchmarks, so that we can compare refactoring browsers in an objective manner? -- Marian Vittek

I am starting with few benchmarks for extract method: Refactoring Benchmarks For Extract Method.

Few more benchmarks for pull up method: Refactoring Benchmarks For Pull Up Method.




See original on c2.com