Exemplo n.º 1
0
 @Override
 public void visitVarDef(JCVariableDecl node) {
   if (node.init != null) {
     changeNode =
         (lm, ne) -> {
           // 変数への代入式を置換
           if (node.init == lm) {
             node.init = ne;
           }
         };
   }
   super.visitVarDef(node);
 }
 public void visitVarDef(JCVariableDecl node) {
   node.sym = null;
   super.visitVarDef(node);
 }
 @Override
 public Void visitVariable(final VariableTree tree, final Void p) {
   JCVariableDecl variableDecl = (JCVariableDecl) tree;
   variableDecl.init = replace(variableDecl.init);
   return super.visitVariable(tree, p);
 }