Class DeleteStatement<P>

java.lang.Object
org.openrewrite.TreeVisitor<J,P>
org.openrewrite.java.JavaVisitor<P>
org.openrewrite.java.JavaIsoVisitor<P>
org.openrewrite.java.DeleteStatement<P>

public class DeleteStatement<P> extends JavaIsoVisitor<P>
Deletes standalone statements.

Does not include deletion of:

  • control statements present in for loops.
  • control statements present in while loops.
  • control statements present in do while loops.
  • control statements present in if statements.
  • control statements present in switch statements.
  • statements that would render the closest parent non J.Block statement unable to be compiled

For example, the statement isPotato() would not be removed from any of the following code:

 
     if (isPotato()) { }
     while (isPotato()) { }
     do { } while (isPotato());
     boolean potato = isPotato();
     boolean notPotato = !isPotato();