But what I really want in a refactorer...

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.

Comments:

Post a Comment:
Comments are closed for this entry.
About

This is Stephen Green's blog. It's about the theory and practice of text search engines, with occasional forays into recommendation and other technologies that can use a good text search engine. Steve is the PI of the Information Retrieval and Machine Learning project in Oracle Labs.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today