mirror of https://github.com/apache/poi.git
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
This commit is contained in:
parent
dfa07ac1a3
commit
59d926ede8
|
@ -31,7 +31,6 @@ import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.namespace.NamespaceContext;
|
import javax.xml.namespace.NamespaceContext;
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
|
||||||
import javax.xml.xpath.XPath;
|
import javax.xml.xpath.XPath;
|
||||||
import javax.xml.xpath.XPathConstants;
|
import javax.xml.xpath.XPathConstants;
|
||||||
import javax.xml.xpath.XPathExpressionException;
|
import javax.xml.xpath.XPathExpressionException;
|
||||||
|
@ -84,7 +83,6 @@ public class XSSFImportFromXML {
|
||||||
* @param xmlInputString the XML to import
|
* @param xmlInputString the XML to import
|
||||||
* @throws SAXException if error occurs during XML parsing
|
* @throws SAXException if error occurs during XML parsing
|
||||||
* @throws XPathExpressionException if error occurs during XML navigation
|
* @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
|
* @throws IOException if there are problems reading the input string
|
||||||
*/
|
*/
|
||||||
public void importFromXML(String xmlInputString) throws SAXException, XPathExpressionException, IOException {
|
public void importFromXML(String xmlInputString) throws SAXException, XPathExpressionException, IOException {
|
||||||
|
@ -137,15 +135,15 @@ public class XSSFImportFromXML {
|
||||||
|
|
||||||
Node singleNode = result.item(i).cloneNode(true);
|
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) {
|
if(xmlColumnPr == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rowId = rowOffset + i;
|
int rowId = rowOffset + i;
|
||||||
int columnId = columnOffset + tableColum.getColumnIndex();
|
int columnId = columnOffset + tableColumn.getColumnIndex();
|
||||||
String localXPath = xmlColumnPr.getLocalXPath();
|
String localXPath = xmlColumnPr.getLocalXPath();
|
||||||
localXPath = localXPath.substring(localXPath.indexOf('/', 1) + 1);
|
localXPath = localXPath.substring(localXPath.indexOf('/', 1) + 1);
|
||||||
|
|
||||||
|
@ -224,10 +222,7 @@ public class XSSFImportFromXML {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException 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()));
|
|
||||||
} catch (ParseException e) {
|
|
||||||
throw new IllegalArgumentException(String.format(LocaleUtil.getUserLocale(), "Unable to format value '%s' as %s for cell %s", value,
|
throw new IllegalArgumentException(String.format(LocaleUtil.getUserLocale(), "Unable to format value '%s' as %s for cell %s", value,
|
||||||
type, new CellReference(cell).formatAsString()));
|
type, new CellReference(cell).formatAsString()));
|
||||||
}
|
}
|
||||||
|
@ -300,7 +295,7 @@ public class XSSFImportFromXML {
|
||||||
|
|
||||||
// Dummy implementation - not used!
|
// Dummy implementation - not used!
|
||||||
@Override
|
@Override
|
||||||
public Iterator<?> getPrefixes(String val) {
|
public Iterator<String> getPrefixes(String val) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue