Structural replace to delete an exception

I want to delete an exception that should have never existed. I can not find the pattern that allows the deletion in the method declarations.
This code :

public void method1(String param) throws ShouldHaveNeverExisted{
   System.out.println("Yo");
   //... 
}

public void method2WithoutParam() throws ShouldHaveNeverExisted{
   System.out.println("Yo");
   //... 
}

Should be transform in :

public void method1(String param){
   System.out.println("Yo");
   //... 
}

public void method2WithoutParam(){
   System.out.println("Yo");
   //... 
}

The following pattern retrieve what I want but I can't find the correct replacement pattern.

class $Class$ { 
   $ReturnType$ $MethodName$($ParameterType$ $Parameter$) throws ShouldHaveNeverExisted;
}
2 comments
Comment actions Permalink

Have you tried using Safe Delete on the exception class? I'd expect it to work, and it's definitely much easier than structural search.

0
Comment actions Permalink

The class is currently used. So Safe Delete shows me the usage. In that case I can do a Ctrl+Shift+R. I wanted to use the structural replace to do in a more intellij way ;)

0

Please sign in to leave a comment.