Fix some compiler warnings, close resources in tests

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1744636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2016-05-19 20:18:19 +00:00
parent 2e4095deeb
commit ae32e5f677
3 changed files with 5 additions and 5 deletions

View File

@ -77,8 +77,7 @@ public class POIXMLTypeLoader {
} }
private static XmlOptions getXmlOptions(XmlOptions options) { private static XmlOptions getXmlOptions(XmlOptions options) {
XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options; return options == null ? DEFAULT_XML_OPTIONS : options;
return opt;
} }
public static XmlObject newInstance(SchemaType type, XmlOptions options) { public static XmlObject newInstance(SchemaType type, XmlOptions options) {

View File

@ -55,7 +55,7 @@ public class SXSSFRow implements Row, Comparable<SXSSFRow>
* @param initialSize - no longer needed * @param initialSize - no longer needed
* @deprecated 2015-11-30 (circa POI 3.14beta1). Use {@link #SXSSFRow(SXSSFSheet)} instead. * @deprecated 2015-11-30 (circa POI 3.14beta1). Use {@link #SXSSFRow(SXSSFSheet)} instead.
*/ */
public SXSSFRow(SXSSFSheet sheet, int initialSize) public SXSSFRow(SXSSFSheet sheet, @SuppressWarnings("UnusedParameters") int initialSize)
{ {
this(sheet); this(sheet);
} }
@ -433,7 +433,6 @@ public class SXSSFRow implements Row, Comparable<SXSSFRow>
public void setRowStyle(CellStyle style) { public void setRowStyle(CellStyle style) {
if(style == null) { if(style == null) {
_style = -1; _style = -1;
return;
} else { } else {
_style = style.getIndex(); _style = style.getIndex();
} }

View File

@ -59,7 +59,7 @@ public abstract class BaseTestXCell extends BaseTestCell {
} }
@Test @Test
public void testSetNullValues() { public void testSetNullValues() throws IOException {
Workbook wb = _testDataProvider.createWorkbook(); Workbook wb = _testDataProvider.createWorkbook();
Cell cell = wb.createSheet("test").createRow(0).createCell(0); Cell cell = wb.createSheet("test").createRow(0).createCell(0);
@ -68,5 +68,7 @@ public abstract class BaseTestXCell extends BaseTestCell {
cell.setCellValue((String)null); cell.setCellValue((String)null);
cell.setCellValue((RichTextString) null); cell.setCellValue((RichTextString) null);
cell.setCellValue((String)null); cell.setCellValue((String)null);
wb.close();
} }
} }