Summary
The NetBeans project has released Jackpot, a module that helps you reengineer Java source code by safely making sweeping changes to potentially large bodies of code. It includes a rules language in which you can specify transformations.
Advertisement
This project began when James Gosling left JavaSoft and went back to the labs. He described the ideas behind Jackpot in this 2003 interview entitled, Analyze this!. Jackpot can be downloaded for free and installed as NetBeans module. The rules language allows you to specify transformations in a simple syntax. For example, the following rule replaces all appearances of this == null to false:
this == null => false;
Sun's Tom Ball recently posted to his blog giving some context on the rules language, calling it a "little language." According to the Jackpot FAQ, the tool augments the kind of refactoring support found in popular Java IDEs such as IntelliJ, Eclipse, and NetBeans:
This sounds a lot like a refactoring, and to a large extent it is. While these two concepts overlap quite a bit, their difference is in scope: Jackpot transformations tend to be applied globally, such as at a project level or across several projects; refactorings, on the other hand, tend to be more focused on individual aspects in project source. For example, Encapsulate Field is a common refactoring which is generally applied on a single variable at a time. The equivalent Jackpot transformation would encapsulate all public variables, however.
Jackpot is a very early, alpha-level release, but it sounds promising. It only works in NetBeans, but given that NetBeans is free, even if you don't use the IDE in general it may make sense to use it for specific tasks. We are quite happy IntelliJ users here at Artima, but sometimes we have found it has trouble with very large refactorings. It recently occured to me that given that disk space is cheap, there's not much reason we shouldn't have Eclipse and NetBeans integrated into our project and available to be used as a tool when appropriate, just as we have several static analysis tools already integrated into the project. While the tools overlap to a degree, they aren't completely identical to each other.
Do you think Jackpot will be useful enough to get you to download and install NetBeans? What kind of problems do you think Jackpot might solve better than tools you currently have at hand?