Java rewrite engine