我有以下代码正在通过 fortify 运行。为什么它被标记为糟糕的错误处理,最后扔进去?
private String getResourceContent(String fileName) throws IOException {
try (InputStream resource = ErrorResource.classLoader.getResourceAsStream(fileName)) {
return new String(resource.readAllBytes(), StandardCharsets.UTF_8);
} catch (NullPointerException n) {
throw new ErrorDescriptorException(
String.format("Error loading Error description data from Resource file [%s].", fileName), n);
}
}
HUX布斯
守着一只汪
MMMHUHU
相关分类