diff --git a/src/java/org/apache/poi/util/Configurator.java b/src/java/org/apache/poi/util/Configurator.java index b1b72590f..4c9651f8e 100644 --- a/src/java/org/apache/poi/util/Configurator.java +++ b/src/java/org/apache/poi/util/Configurator.java @@ -27,7 +27,7 @@ public class Configurator { int result = defaultValue; String property = System.getProperty(systemProperty); try { - result = Integer.valueOf(property); + result = Integer.parseInt(property); } catch (Exception e) { logger.log(POILogger.ERROR, "System property -D"+systemProperty +" do not contains a valid integer " + property); } diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java index b7dc6ee2f..0cbe5bacf 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/TOC.java @@ -114,7 +114,7 @@ public class TOC { // page number run run = p.addNewR(); run.addNewRPr().addNewNoProof(); - run.addNewT().setStringValue(Integer.valueOf(page).toString()); + run.addNewT().setStringValue(Integer.toString(page)); run = p.addNewR(); run.addNewRPr().addNewNoProof(); run.addNewFldChar().setFldCharType(STFldCharType.END); diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java index 9eabdebc8..d0e70bb62 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java @@ -901,7 +901,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody { String parStyle = par.getStyle(); if (parStyle != null && parStyle.startsWith("Heading")) { try { - int level = Integer.valueOf(parStyle.substring("Heading".length())).intValue(); + int level = Integer.parseInt(parStyle.substring("Heading".length())); toc.addRow(level, par.getText(), 1, "112723803"); } catch (NumberFormatException e) { e.printStackTrace();