aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorJaven O'Neal <onealj@apache.org>2016-07-17 10:27:44 +0000
committerJaven O'Neal <onealj@apache.org>2016-07-17 10:27:44 +0000
commit5b3a1ad4cee1672c0126abc48035a9974d0709b8 (patch)
tree302c174f3c40443ea4b26d4823381abc0be5f961 /src/examples
parentd19f61436644a7df31b8a5557d13cb29770d0e89 (diff)
downloadpoi-5b3a1ad4cee1672c0126abc48035a9974d0709b8.tar.gz
poi-5b3a1ad4cee1672c0126abc48035a9974d0709b8.zip
close workbook to avoid resource leak
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753053 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java
index e4a72fcc00..a84d32a193 100644
--- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java
+++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java
@@ -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();
@@ -91,6 +92,7 @@ public class HyperlinkExample {
FileOutputStream out = new FileOutputStream("hyperinks.xlsx");
wb.write(out);
out.close();
-
+
+ wb.close();
}
}