]> source.dussan.org Git - poi.git/commitdiff
close workbook to avoid resource leak
authorJaven O'Neal <onealj@apache.org>
Sun, 17 Jul 2016 10:27:44 +0000 (10:27 +0000)
committerJaven O'Neal <onealj@apache.org>
Sun, 17 Jul 2016 10:27:44 +0000 (10:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753053 13f79535-47bb-0310-9956-ffa450edef68

src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java

index e4a72fcc003518f8af59ac8cffc929e384356f74..a84d32a19379297117537c040396ff3a11270677 100644 (file)
@@ -17,6 +17,7 @@
 package org.apache.poi.xssf.usermodel.examples;
 
 import java.io.FileOutputStream;
+import java.io.IOException;
 
 import org.apache.poi.common.usermodel.HyperlinkType;
 import org.apache.poi.ss.usermodel.Cell;
@@ -35,7 +36,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 public class HyperlinkExample {
 
 
-    public static void main(String[]args) throws Exception{
+    public static void main(String[]args) throws IOException {
         Workbook wb = new XSSFWorkbook(); //or new HSSFWorkbook();
         CreationHelper createHelper = wb.getCreationHelper();\r
 \r
@@ -91,6 +92,7 @@ public class HyperlinkExample {
         FileOutputStream out = new FileOutputStream("hyperinks.xlsx");
         wb.write(out);
         out.close();
-
+        
+        wb.close();
     }
 }