Skip to content

Commit 753a4ab

Browse files
offajglick
andauthored
Use try-with-resource
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
1 parent 4adf81f commit 753a4ab

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/org/jenkinsci/plugins/scriptsecurity/sandbox/whitelists/StaticWhitelist.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ private static String printArgumentTypes(Class<?>[] parameterTypes) {
266266

267267
@SuppressFBWarnings(value = "OS_OPEN_STREAM", justification = "https://sourceforge.net/p/findbugs/bugs/786/")
268268
private static Set<String> loadBlacklist() throws IOException {
269-
try (InputStream is = StaticWhitelist.class.getResourceAsStream("blacklist")) {
270-
BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.US_ASCII));
269+
try (InputStream is = StaticWhitelist.class.getResourceAsStream("blacklist"); InputStreamReader isr = new InputStreamReader(is, StandardCharsets.US_ASCII); BufferedReader br = new BufferedReader(isr)) {
271270
Set<String> blacklist = new HashSet<>();
272271
String line;
273272
while ((line = br.readLine()) != null) {

0 commit comments

Comments
 (0)