From 59d926ede822d4cdbdace05c7a8e0e8323f12bb4 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sun, 4 Mar 2018 13:33:20 +0000 Subject: [PATCH] Fix compiling with current JDK 10 RC build, OOXML-Tests are still failing due to ThresholdInputStream, though. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1825816 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/extractor/XSSFImportFromXML.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java index d32dae26fc..019b396764 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFImportFromXML.java @@ -31,7 +31,6 @@ import java.util.Set; import javax.xml.namespace.NamespaceContext; import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; @@ -84,7 +83,6 @@ public class XSSFImportFromXML { * @param xmlInputString the XML to import * @throws SAXException if error occurs during XML parsing * @throws XPathExpressionException if error occurs during XML navigation - * @throws ParserConfigurationException if there are problems with XML parser configuration * @throws IOException if there are problems reading the input string */ public void importFromXML(String xmlInputString) throws SAXException, XPathExpressionException, IOException { @@ -137,15 +135,15 @@ public class XSSFImportFromXML { Node singleNode = result.item(i).cloneNode(true); - for (XSSFTableColumn tableColum : table.getColumns()) { + for (XSSFTableColumn tableColumn : table.getColumns()) { - XSSFXmlColumnPr xmlColumnPr = tableColum.getXmlColumnPr(); + XSSFXmlColumnPr xmlColumnPr = tableColumn.getXmlColumnPr(); if(xmlColumnPr == null) { continue; } int rowId = rowOffset + i; - int columnId = columnOffset + tableColum.getColumnIndex(); + int columnId = columnOffset + tableColumn.getColumnIndex(); String localXPath = xmlColumnPr.getLocalXPath(); localXPath = localXPath.substring(localXPath.indexOf('/', 1) + 1); @@ -224,10 +222,7 @@ public class XSSFImportFromXML { break; } } - } catch (IllegalArgumentException e) { - throw new IllegalArgumentException(String.format(LocaleUtil.getUserLocale(), "Unable to format value '%s' as %s for cell %s", value, - type, new CellReference(cell).formatAsString())); - } catch (ParseException e) { + } catch (IllegalArgumentException | ParseException e) { throw new IllegalArgumentException(String.format(LocaleUtil.getUserLocale(), "Unable to format value '%s' as %s for cell %s", value, type, new CellReference(cell).formatAsString())); } @@ -300,7 +295,7 @@ public class XSSFImportFromXML { // Dummy implementation - not used! @Override - public Iterator getPrefixes(String val) { + public Iterator getPrefixes(String val) { return null; } -- 2.39.5