deleting a if statements using ASTParser from a given .java file

62 views Asked by At

I have a requirement of deleting all if conditions from a given .java source file. How can I perform this using a ASTParser in JDT.

public static void selectDecision(x,y)
{
     if()
     {
       /////////
     }
     else 
     {
       //////////
     }
 }
1

There are 1 answers

0
Sasikanth Bharadwaj On

Take a look at ASTRewrite (org.eclipse.jdt.core.dom.rewrite.ASTRewrite)