3 ms·
See also Jackpot[1][2] (James Gosling himself was involved with the project) which is now integrated with NetBeans. For example, given the rule: $1.isD
by pron 11y ago
See also Jackpot[1][2] (James Gosling himself was involved with the project) which is now integrated with NetBeans.
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 https://bitbucket.org/jlahoda/jackpot30/wiki/Home
[2]: http://www.devoxx.com/display/DV11/Jackpot+3.0+-+Large+scale+custom+refactorings+made+easy http://www.devoxx.com/display/DV11/Jackpot+3.0+-+Large+scale...
- JnRouvignac 11y agoThanks for the reference. I'll have a look.
- JnRouvignac 11y agoI am not a fan of Jackpot. Such DSLs are hard to build to keep expressiveness, and yet, they remain hard to use for the user. I am a lot more enthusiastic about the approach taken by Refaster.