Last updated January 14, 2011 21:32, by Zdenek Tronicek
Feedicon  

RefactoringNG

RefactoringNG is a flexible and powerful Java refactoring tool, implemented as NetBeans module. Refactoring rules are described as transformations of source abstract syntax trees to destination abstract syntax trees. For example, the rule that rewrites x = x + 1 to x++ is as follows:

 // x = x + 1 -> x++
 Assignment {
    Identifier [name: "x"],
    Binary [kind: PLUS] {
       Identifier [name: "x"],
       Literal [kind: INT_LITERAL, value: 1]
    }
 } ->
 Unary [kind: POSTFIX_INCREMENT] {
    Identifier [name: "x"]
 }

The names and structure of abstract syntax trees are the same as in Sun Java compiler. The tool uses Compiler Tree API (com.sun.*), the formal language model in the JDK API (javax.lang.model.*), and NetBeans infrastructure.

Tutorial

Examples

Reference guide

API evolution with RefactoringNG

Bye bye, Hashtable

From StringBuffer to StringBuilder

  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close