mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-11 17:55:53 +00:00
Always close the FileOutputStream in Wallet.saveToFile(). Cleans up a FindBugs warning.
This commit is contained in:
parent
20adfd9965
commit
67aa0ae4a3
@ -149,7 +149,13 @@ public class Wallet implements Serializable {
|
||||
* Uses Java serialization to save the wallet to the given file.
|
||||
*/
|
||||
public synchronized void saveToFile(File f) throws IOException {
|
||||
saveToFileStream(new FileOutputStream(f));
|
||||
FileOutputStream stream = null;
|
||||
try {
|
||||
stream = new FileOutputStream(f);
|
||||
saveToFileStream(stream);
|
||||
} finally {
|
||||
if (stream != null) stream.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user