2011/11/15

Devoxx11: Jackpot 3.0 - Large Custom Refactorings



Jan Lahoda
Jackpot:
  • originally from Sun labs
  • uses the Abstract Syntax Tree (AST) --> knows java-language / syntax: smarter than simple regexp's
  • ideal to refactor deprecated API's
  • remove anti-patterns
Jackpot is now included in Netbeans 7.1
  • use special 'Hint' syntax: Class.oldMethod => NewClass.newMethod ;;
  • completely integrated in standard Netbeans hints / refactoring logic
    • hints are show in the IDE, directly to the developer
    • batch refactorings are allowed: completely integrated in the "Inspect and refactor" dialog (incl. managing hints)
    • run headless from the command line
  • can be highly fine-tuned:
    • use instanceof checks
    • match on specific Java constructs: e.g. only look for Fields
    • check on target java version
    • combine multiple checks
    • write repeatable tests in ".test" file
  • definitely worthwhile looking at for large refactorings of legace Java projects!

Post a Comment