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.


Hari, at the simplest level, Jackpot can and does behave like any refactoring tool. However you can do a lot more than refactoring. You can, for example,
1. use it to enforce good coding practices - hiding public members behind JavaBean properties
2. use appropriate Java classes - converting StringTokenizer to use Scanner
3. documenting sources - adding @Deprecated or @Overrides
4. simplifying code - removing common code from if/then/else, or static codes from loops with out changing the semantics and behaviour of the application
I've no experience with IDEA's Inspect so I cannot comment on that.
I'd say it's mostly an attempt to build something like the Smalltalk Refactoring Browser. Eg. the idea of a query language seems familiar, see these slides
http://www.stic.org/Smalltalk_Solutions/ss2003/pdf/roberts.pdf
for an intro to the equivalent to the Jackpot query language in Smalltalk.
As I see it, it's mostly just for building the necessary infrastructure that you need if you want to build refactoring operations (ie. modifying source by modifying the AST, doing bulk transformations and searches, ...). I believe they also annotate the AST with some type information.