Merge
diff --git a/src/share/classes/sun/security/provider/DomainKeyStore.java b/src/share/classes/sun/security/provider/DomainKeyStore.java
index 9c4072a..1897fd5 100644
--- a/src/share/classes/sun/security/provider/DomainKeyStore.java
+++ b/src/share/classes/sun/security/provider/DomainKeyStore.java
@@ -652,9 +652,12 @@
 
                     // Store the keystores
                     KeyStore keystore = keystores.get(builder.name);
-                    keystore.store(new FileOutputStream(builder.file),
-                        password);
 
+                    try (FileOutputStream stream =
+                        new FileOutputStream(builder.file)) {
+
+                        keystore.store(stream, password);
+                    }
                 } catch (KeyStoreException e) {
                     throw new IOException(e);
                 }