mirror of
https://github.com/plexusorg/toml4j.git
synced 2025-02-11 11:40:27 +00:00
Added finally block to TomlWriter#write(Object, File) to close
FileWriter
This commit is contained in:
parent
feb3aec259
commit
3a3915416a
1 changed files with 5 additions and 2 deletions
|
@ -83,8 +83,11 @@ public class TomlWriter {
|
||||||
*/
|
*/
|
||||||
public void write(Object from, File target) throws IOException {
|
public void write(Object from, File target) throws IOException {
|
||||||
FileWriter writer = new FileWriter(target);
|
FileWriter writer = new FileWriter(target);
|
||||||
write(from, writer);
|
try {
|
||||||
writer.close();
|
write(from, writer);
|
||||||
|
} finally {
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue