NetBeans Program Transformation tool Jackpot is a extendable refactoring/reengineering module developed based on Sun Laboratories research project where James Gosling involved. More than a traditional refactoring tool, its a platform library for easily finding and correcting patterns in Java source code using static analysis. From the project description:

Jackpot is a NetBeans IDE module for modeling, querying and transforming Java source files. Although the Jackpot engine can be used for bug detection or refactoring, the initial focus of this module is to add program transformation capabilities for NetBeans users.

Isn’t it same as Refactoring?
In Jackpot context, Program Transformation is a script or Java class which queries sources in Java projects for patterns and changes them. This sounds a lot like a refactoring, but from project description:

the 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.

Renaming a class in refactoring not only changes the class name, it also changes all references to it across the project. Isn’t it project transformation? Yes, it is, hence both are same in my opinion.

Is it new?
Its not new, its more like of IntelliJ IDEA’s Inspect feature which inspects the code against predefined(nearly 500) inspections and also which can be done globally across the project like a Jackpot transformation.

So what’s special in Jackpot?

For the folks who wants more than pre-defined refactoring templates, this allows to write custom templates. With the help of query API one can easily extend this refactoring tool. On top of the query API it provides a pattern-matching (rule) language for Java statements and expressions which allows developers to create many types of Jackpot operators and transformers without learning its API. By the way, its an add-on module for NetBeans 5.0 and NetBeans 5.5, but for NetBeans 6.0 Jackpot will become a part of the core IDE.

Do you see the difference between these two? Please post your thoughts in comments.