Comment

Comment by pron

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

[2]: http://www.devoxx.com/display/DV11/Jackpot+3.0+-+Large+scale...

parent pron 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton