From 5e3c0ef33515d558972be0785e8700dd2bcad4bc Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Thu, 19 May 2016 20:18:19 +0000 Subject: [PATCH] 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 --- src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java | 3 +-- src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java | 3 +-- .../testcases/org/apache/poi/ss/usermodel/BaseTestXCell.java | 4 +++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java b/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java index 5304b3121a..b703d73d87 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java +++ b/src/ooxml/java/org/apache/poi/POIXMLTypeLoader.java @@ -77,8 +77,7 @@ public class POIXMLTypeLoader { } private static XmlOptions getXmlOptions(XmlOptions options) { - XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options; - return opt; + return options == null ? DEFAULT_XML_OPTIONS : options; } public static XmlObject newInstance(SchemaType type, XmlOptions options) { diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java index ec9017aefa..2d6fe20f4a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java @@ -55,7 +55,7 @@ public class SXSSFRow implements Row, Comparable * @param initialSize - no longer needed * @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); } @@ -433,7 +433,6 @@ public class SXSSFRow implements Row, Comparable public void setRowStyle(CellStyle style) { if(style == null) { _style = -1; - return; } else { _style = style.getIndex(); } diff --git a/src/ooxml/testcases/org/apache/poi/ss/usermodel/BaseTestXCell.java b/src/ooxml/testcases/org/apache/poi/ss/usermodel/BaseTestXCell.java index 44cd2a58b2..0a471419ca 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/usermodel/BaseTestXCell.java +++ b/src/ooxml/testcases/org/apache/poi/ss/usermodel/BaseTestXCell.java @@ -59,7 +59,7 @@ public abstract class BaseTestXCell extends BaseTestCell { } @Test - public void testSetNullValues() { + public void testSetNullValues() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); 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((RichTextString) null); cell.setCellValue((String)null); + + wb.close(); } } -- 2.39.5