by pron · 11y ago · 0 comments
For example, given the rule:
$1.isDirectory() :: $1 instanceof java.io.File
=> !$1.isFile()
;;
It will rewrite this: java.io.File testFile = new java.io.File("/tmp");
if (testFile.isDirectory()) {
System.err.println("/tmp is a directory");
}
into that: java.io.File testFile = new java.io.File("/tmp");
if (!testFile.isFile()) {
System.err.println("/tmp is a directory");
}
Another cool feature is that simply placing the rule files in a library's META-INF/upgrade directory, will activate them in the IDE, offering automatic refactoring to users of the library (i.e. if the library is in your project's classpath).Jackpot is used extensively by NetBeans.
[1]: https://bitbucket.org/jlahoda/jackpot30/wiki/Home
[2]: http://www.devoxx.com/display/DV11/Jackpot+3.0+-+Large+scale...