aboutsummaryrefslogtreecommitdiffstats
path: root/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2017-12-28 08:45:26 +0000
committerDominik Stadler <centic@apache.org>2017-12-28 08:45:26 +0000
commit62c8296c709b7ea1291d87f5658b69d80b20ace7 (patch)
treef55bf50981221a711bccbe585b1cb0ab7ffaf4ee /src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
parent6e67de21602e2a33ff0420e83d914a7da61e27a3 (diff)
downloadpoi-62c8296c709b7ea1291d87f5658b69d80b20ace7.tar.gz
poi-62c8296c709b7ea1291d87f5658b69d80b20ace7.zip
Fix IntelliJ warnings and code formatting, generalize ExcelToHtmlUtils, use try-with-resources, update/enhance JavaDoc somewhat
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1819402 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java')
-rw-r--r--src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
index b8bb0b57b0..1d4db0ae2b 100644
--- a/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
+++ b/src/integrationtest/org/apache/poi/stress/XSSFFileHandler.java
@@ -195,19 +195,7 @@ public class XSSFFileHandler extends SpreadsheetHandler {
} catch (OLE2NotOfficeXmlFileException e) {
// we have some files that are not actually OOXML and thus cannot be tested here
- } catch (IllegalArgumentException e) {
- if(!EXPECTED_ADDITIONAL_FAILURES.contains(file.getParentFile().getName() + "/" + file.getName())) {
- throw e;
- }
- } catch (InvalidFormatException e) {
- if(!EXPECTED_ADDITIONAL_FAILURES.contains(file.getParentFile().getName() + "/" + file.getName())) {
- throw e;
- }
- } catch (IOException e) {
- if(!EXPECTED_ADDITIONAL_FAILURES.contains(file.getParentFile().getName() + "/" + file.getName())) {
- throw e;
- }
- } catch (POIXMLException e) {
+ } catch (IllegalArgumentException | InvalidFormatException | POIXMLException | IOException e) {
if(!EXPECTED_ADDITIONAL_FAILURES.contains(file.getParentFile().getName() + "/" + file.getName())) {
throw e;
}
@@ -221,11 +209,8 @@ public class XSSFFileHandler extends SpreadsheetHandler {
public void test() throws Exception {
File file = new File("test-data/spreadsheet/ref-56737.xlsx");
- InputStream stream = new BufferedInputStream(new FileInputStream(file));
- try {
+ try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
handleFile(stream, file.getPath());
- } finally {
- stream.close();
}
handleExtracting(file);