mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
Always close the FileOutputStream in Wallet.saveToFile(). Cleans up a FindBugs warning.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user