But what I really want in a refactorer...
By searchguy on Aug 31, 2007
I'm back and refactoring. When we started developing our search engine, we were developing for deployment with the Portal Server. Java 1.3 had just come out, but the Portal Server ran in a 1.2.2 VM, so we developed for features only in 1.2.2.
Of course the world's changed since then, and part of what I've been doing is going through the code and modernizing it. I mentioned jackpot and I've been using the "basic" refactoring for a while, but what I want is a set of "modernizing" transforms.
For example, the attributes that a field can have in the index were represented in the traditional ored-together-powers-of-two style. There are a number of well known problems with this style, not the least of which is that if you want to add attributes sanely in such a situation, you need to do all the checking yourself.
Converting the powers-of-two to an
Enum was easy, but changing all the places where those powers of two was used was a total pain. The set of transforms was fairly straightforward (replace the name of the constant with the name of the enum, replace bitwise ors with equivalent
EnumSet.of, etc.), and I found myself thinking that a reasonably smart refactorer would have gotten me about 90% of the way.
The next big thing like this that we're facing is the Great Genericization of '07.
I guess if I want it, I'm going to have to write it myself.