Monday March 13, 2006 Jackpot is finally available.... well, as an alpha that is. But hey, I love to live on the bleeding edge - I always run with the latest and greatest bits I can get my hands on.
Here's the announcement, sent only to the NetBeans development mailing list. At this stage, the UI is not ready, but developers can start playing with the concepts and start writing refactoring scripts. Refactoring scripts, what's that you say?
Jackpot really is a new approach to refactoring. Sure, there are builtin refactorings - code transformations that are coded as direct AST manipulation. However, Jackpot also lets you write your own Rule files, using a special but obvious rule language. Rather than describe it here, just go check out the tutorial.
Unfortunately, there are no screenshots in the tutorial. And for any new software, the first thing I look for are screenshots. So, below follows a few screenshots to hopefully whet your appetite. It's exciting to see so many new innovations going into the NetBeans IDE!
Here's the first thing I did. I applied the "Add Override Annotations" transform. This goes and looks for all methods that are currently overriding another, and adds the new JDK 5 @Override annotation to all these methods. I've recently started using this annotation in my code, but I've added them haphazardly, so it's nice to be able to do this in one shot. When you run the transformer, you get a results window with diffs before you apply the change:
As I mentioned, you can write your own rule files too. This is the real big deal about Jackpot. It allows you to write your own, simple source substitutions - with full accuracy on types. The below shows some code cleanup rules. There are many many other rule files too, and more deprecated uses ones should be written.
Here's the current queries menu - queries simply list results, but doesn't actually change the code:
Here's the current transforms menu:
Note that it's very easy to add to these menus. Create your own rule files, open up the Command Manager and add a reference to your rule file (what, did you think "Tor's Test Rules" at the end of the menu above was part of the Jackpot distribution?). It then shows up in the menu and you can run it. Developers can then share these rule files. If you come up with some good rules, PLEASE please share them!
P.S. Remember it's an alpha so don't start complaining if you get exceptions, if the UI isn't Right(tm), etc.
(2006-03-13 14:08:47.0) Permalink Comments [10]
Posted by Romain Guy on March 13, 2006 at 02:56 PM PST #
Posted by Eylon Stroh on March 13, 2006 at 04:05 PM PST #
Posted by Romain Guy on March 13, 2006 at 04:11 PM PST #
Posted by Tor Norbye on March 13, 2006 at 04:21 PM PST #
Posted by x on March 13, 2006 at 04:29 PM PST #
Posted by Tor Norbye on March 13, 2006 at 04:37 PM PST #
Posted by Navneet Karnani on March 14, 2006 at 01:13 AM PST #
Posted by DantoNetwork on March 14, 2006 at 07:27 AM PST #
http://jackpot.netbeans.org/docs/rule-language.html
Navneet: There are two rules; we were referring to the one without $t. And I think that one could be rewritten as:
{ $p$; $t $v; $q$; $v = $e; return $v; } => { $p$; $q$; return $e; } :: !assignedIn($v, $q$)
{ $p$; $t $v; $q$; $v = $e; return $v; } => { $p$; $t $v; $q$; return $e; } :: assignedIn($v, $q$)
or, possibly, just the second rule, if we know that the rule for minimizing the scope of local variables runs first.
Posted by Eylon Stroh on March 14, 2006 at 11:34 AM PST #
Posted by Tom Copeland on March 15, 2006 at 09:27 AM PST #