Jackpot - A Program Transformation Tool for NetBeans. Isn't it Refactoring tool?

by Hari K. Gottipati

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:

2 Comments

Lee Chuk Munn
2006-08-26 19:35:43
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.
murphee
2006-09-01 03:53:21
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.