Eclipse warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1706750 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2015-10-05 06:41:48 +00:00
parent eee32c0480
commit 4b487fcc10
2 changed files with 21 additions and 8 deletions

View File

@ -18,6 +18,7 @@
package org.apache.poi.hwpf.model; package org.apache.poi.hwpf.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import org.apache.poi.util.Internal; import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
@ -37,7 +38,7 @@ public final class PlexOfCps
private int _iMac; private int _iMac;
private int _offset; private int _offset;
private int _cbStruct; private int _cbStruct;
private ArrayList<GenericPropertyNode> _props; private List<GenericPropertyNode> _props;
public PlexOfCps( int sizeOfStruct ) public PlexOfCps( int sizeOfStruct )
{ {

View File

@ -17,8 +17,10 @@
package org.apache.poi.hssf.usermodel; package org.apache.poi.hssf.usermodel;
import org.apache.poi.hssf.HSSFTestDataSamples; import java.io.IOException;
import org.apache.poi.hssf.HSSFITestDataProvider; import org.apache.poi.hssf.HSSFITestDataProvider;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.ss.usermodel.BaseTestHyperlink; import org.apache.poi.ss.usermodel.BaseTestHyperlink;
/** /**
@ -107,8 +109,9 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
* link.setTextMark("'Target Sheet-1'!A1"); //HSSF-specific * link.setTextMark("'Target Sheet-1'!A1"); //HSSF-specific
* or * or
* link.setAddress("'Target Sheet-1'!A1"); //common between XSSF and HSSF * link.setAddress("'Target Sheet-1'!A1"); //common between XSSF and HSSF
* @throws IOException
*/ */
public void testCreateDocumentLink() { public void testCreateDocumentLink() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
//link to a place in this workbook //link to a place in this workbook
@ -134,8 +137,10 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
link.setAddress("'Hyperlinks'!A1"); link.setAddress("'Hyperlinks'!A1");
cell.setHyperlink(link); cell.setHyperlink(link);
wb = HSSFTestDataSamples.writeOutAndReadBack(wb); HSSFWorkbook wbBack = HSSFTestDataSamples.writeOutAndReadBack(wb);
sheet = wb.getSheet("Hyperlinks"); wb.close();
sheet = wbBack.getSheet("Hyperlinks");
cell = sheet.getRow(0).getCell(0); cell = sheet.getRow(0).getCell(0);
link = cell.getHyperlink(); link = cell.getHyperlink();
@ -148,6 +153,8 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
assertNotNull(link); assertNotNull(link);
assertEquals("'Hyperlinks'!A1", link.getTextMark()); assertEquals("'Hyperlinks'!A1", link.getTextMark());
assertEquals("'Hyperlinks'!A1", link.getAddress()); assertEquals("'Hyperlinks'!A1", link.getAddress());
wbBack.close();
} }
public void testCloneSheet() { public void testCloneSheet() {
@ -169,7 +176,7 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
assertEquals("http://poi.apache.org/hssf/", link.getAddress()); assertEquals("http://poi.apache.org/hssf/", link.getAddress());
} }
public void testCreate() { public void testCreate() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
HSSFHyperlink link; HSSFHyperlink link;
@ -182,13 +189,18 @@ public final class TestHSSFHyperlink extends BaseTestHyperlink {
link.setAddress("testfolder\\test.PDF"); link.setAddress("testfolder\\test.PDF");
cell.setHyperlink(link); cell.setHyperlink(link);
wb = HSSFTestDataSamples.writeOutAndReadBack(wb); HSSFWorkbook wbBack = HSSFTestDataSamples.writeOutAndReadBack(wb);
sheet = wb.getSheet("Hyperlinks");
wb.close();
sheet = wbBack.getSheet("Hyperlinks");
cell = sheet.getRow(1).getCell(0); cell = sheet.getRow(1).getCell(0);
link = cell.getHyperlink(); link = cell.getHyperlink();
assertNotNull(link); assertNotNull(link);
assertEquals("testfolder\\test.PDF", link.getAddress()); assertEquals("testfolder\\test.PDF", link.getAddress());
wbBack.close();
} }
/** /**