Alissa Bonas has uploaded a new change for review. Change subject: Add try with resource in AttestateService ......................................................................
Add try with resource in AttestateService Solves a findbugs warning of type OS_OPEN_STREAM Change-Id: Icc3de950499662ad34aff4d6fce67fb4414f0fb1 Signed-off-by: Alissa Bonas <[email protected]> --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/attestation/AttestationService.java 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/20765/1 diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/attestation/AttestationService.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/attestation/AttestationService.java index bcaeba3..4805435 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/attestation/AttestationService.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/attestation/AttestationService.java @@ -68,9 +68,12 @@ private static KeyStore getTrustStore(String filePath, String password) throws IOException, KeyStoreException, CertificateException, NoSuchAlgorithmException { - InputStream in = new FileInputStream(filePath); - KeyStore ks = KeyStore.getInstance("JKS"); - ks.load(in, password.toCharArray()); + KeyStore ks; + try (InputStream in = new FileInputStream(filePath)) { + ks = KeyStore.getInstance("JKS"); + ks.load(in, password.toCharArray()); + } + return ks; } -- To view, visit http://gerrit.ovirt.org/20765 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc3de950499662ad34aff4d6fce67fb4414f0fb1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alissa Bonas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
