3
我想刪除了應該不可能存在異常。我無法找到允許在方法聲明中刪除的模式。結構替換刪除異常
此代碼:
public void method1(String param) throws ShouldHaveNeverExisted{
System.out.println("Yo");
//...
}
public void method2WithoutParam() throws ShouldHaveNeverExisted{
System.out.println("Yo");
//...
}
應變換:
public void method1(String param){
System.out.println("Yo");
//...
}
public void method2WithoutParam(){
System.out.println("Yo");
//...
}
以下方式獲取我想要什麼,但我不能找到正確的替換模式。
class $Class$ {
$ReturnType$ $MethodName$($ParameterType$ $Parameter$) throws ShouldHaveNeverExisted;
}
我試過,但沒有第一和最後一行,想法表明該模式不支持!!!我可以通過Ctrl + Shift + R解決我的問題,但我想在結構查找和替換上取得進展。 – GaetanZ
我幾乎設法使它工作。查看更新後的答案。 – Vadzim
@Vadzim你有沒有得到這個工作正確?我得到相同*預覽是正確的,實際替換刪除方法*行爲。 –