throws
子句。
示例:
public void createFile() throws Exception { // 警告:'throws Exception' 范围过广,屏蔽异常 'IOException'
File file = new File("pathToFile");
file.createNewFile();
}
在应用快速修复后:
public void createFile() throws IOException {
File file = new File("pathToFile");
file.createNewFile();
配置检查:
throws
子句。