aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-12-04 14:38:14 +0000
committerDominik Stadler <centic@apache.org>2015-12-04 14:38:14 +0000
commit1f5c49b68bbfa555fc59775eae3e51b7740517d8 (patch)
treebd5dec01a55b552a66cb759164122039d66dfd81 /src/examples
parent38b65e7fcb38e4208e312b78b3d2a573cc70f7cc (diff)
downloadpoi-1f5c49b68bbfa555fc59775eae3e51b7740517d8.tar.gz
poi-1f5c49b68bbfa555fc59775eae3e51b7740517d8.zip
Eclipse warnings, code formatting, javadoc, ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717972 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java
index 05029238bf..9b86cf7793 100644
--- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java
+++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java
@@ -26,11 +26,11 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.util.CellReference;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
-import org.apache.poi.hssf.util.CellReference;
import org.apache.poi.ss.usermodel.ClientAnchor.AnchorType;
@@ -721,7 +721,6 @@ public class AddDimensionedImage {
String imageFile = null;
String outputFile = null;
FileOutputStream fos = null;
- HSSFWorkbook workbook = null;
HSSFSheet sheet = null;
try {
if(args.length < 2){
@@ -731,13 +730,14 @@ public class AddDimensionedImage {
imageFile = args[0];
outputFile = args[1];
- workbook = new HSSFWorkbook();
+ HSSFWorkbook workbook = new HSSFWorkbook();
sheet = workbook.createSheet("Picture Test");
new AddDimensionedImage().addImageToSheet("A1", sheet,
imageFile, 125, 125,
AddDimensionedImage.EXPAND_ROW_AND_COLUMN);
fos = new FileOutputStream(outputFile);
workbook.write(fos);
+ workbook.close();
}
catch(FileNotFoundException fnfEx) {
System.out.println("Caught an: " + fnfEx.getClass().getName());
@@ -753,13 +753,6 @@ public class AddDimensionedImage {
}
finally {
try {
- if (workbook != null) {
- workbook.close();
- }
- } catch(IOException ioEx) {
- // I G N O R E
- }
- try {
if(fos != null) {
fos.close();
fos = null;