diff options
Diffstat (limited to 'src/main/java/org/sonarsource/scanner/cli/ScannerVersion.java')
-rw-r--r-- | src/main/java/org/sonarsource/scanner/cli/ScannerVersion.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/org/sonarsource/scanner/cli/ScannerVersion.java b/src/main/java/org/sonarsource/scanner/cli/ScannerVersion.java index 3184439..8e05244 100644 --- a/src/main/java/org/sonarsource/scanner/cli/ScannerVersion.java +++ b/src/main/java/org/sonarsource/scanner/cli/ScannerVersion.java @@ -27,12 +27,9 @@ public enum ScannerVersion { private String version; - private ScannerVersion() { - Scanner scanner = new Scanner(getClass().getResourceAsStream("/version.txt"), "UTF-8"); - try { + ScannerVersion() { + try (Scanner scanner = new Scanner(getClass().getResourceAsStream("/version.txt"), "UTF-8")) { this.version = scanner.next(); - } finally { - scanner.close(); } } |