finally
块。
空的 finally
块通常表明存在编码错误。 在代码重构后它们可能保留下来,可以安全移除。
该检查不报告在 JSP 文件中发现的空 finally
块。
示例:
try {
Files.readString(Paths.get("in.txt"));
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
}
在应用快速修复后:
try {
Files.readString(Paths.get("in.txt"));
} catch (IOException e) {
throw new RuntimeException(e);
}