diff options
-rw-r--r-- | xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java index 9d3ae7cb00a7..506b754b3a7c 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/test/Driver.java @@ -184,12 +184,16 @@ public final class Driver { Document convertedFile = (Document)mergeDocEnum.next(); merger.merge(convertedFile); - mergeIS.close(); + mergeIS.close(); - FileOutputStream fos = new FileOutputStream(mergeFile); - mergeDoc.write(fos); - fos.flush(); - fos.close(); + FileOutputStream fos = null; + try { + fos = new FileOutputStream(mergeFile); + mergeDoc.write(fos); + fos.flush(); + } finally { + close(fos); + } } catch (Exception mergeExcept) { System.out.println("\nThere was an error in the merge"); mergeExcept.printStackTrace(); |