From: Andreas Beeker Date: Sun, 8 Nov 2015 23:14:50 +0000 (+0000) Subject: sonar fixes X-Git-Tag: REL_3_14_BETA1~136 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=171a9e853d42565774fdf7425bab31d69042b9c1;p=poi.git sonar fixes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1713319 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java index fca30abd92..27ea105330 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java @@ -125,7 +125,9 @@ public class KeyInfoSignatureFacet extends SignatureFacet { }; Element n = document.getDocumentElement(); - DOMSignContext domSignContext = new DOMSignContext(key, n, nextSibling); + DOMSignContext domSignContext = (nextSibling == null) + ? new DOMSignContext(key, n) + : new DOMSignContext(key, n, nextSibling); for (Map.Entry me : signatureConfig.getNamespacePrefixes().entrySet()) { domSignContext.putNamespacePrefix(me.getKey(), me.getValue()); } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java index f5d29d3729..574d64013a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java @@ -65,14 +65,14 @@ public class XSSFXmlColumnPr { * @return the local XPath */ public String getLocalXPath(){ - String localXPath = ""; + StringBuilder localXPath = new StringBuilder(); int numberOfCommonXPathAxis = table.getCommonXpath().split("/").length-1; String[] xPathTokens = ctXmlColumnPr.getXpath().split("/"); for(int i=numberOfCommonXPathAxis; i