diff options
author | PJ Fanning <fanningpj@apache.org> | 2020-12-17 21:03:27 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2020-12-17 21:03:27 +0000 |
commit | 0e0d1d56da7d3ad69e80dae199a7f9741b385bb9 (patch) | |
tree | 87af37de9c0f68629b2a91d71f983a73222dd515 /src/ooxml/java/org | |
parent | f9387f37b33e733c1f6c69c520c223bfc9dda245 (diff) | |
download | poi-0e0d1d56da7d3ad69e80dae199a7f9741b385bb9.tar.gz poi-0e0d1d56da7d3ad69e80dae199a7f9741b385bb9.zip |
avoid string concats
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884572 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org')
12 files changed, 19 insertions, 20 deletions
diff --git a/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java b/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java index fd9b032ef6..1f90ae842f 100644 --- a/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java +++ b/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java @@ -651,7 +651,7 @@ public class POIXMLDocumentPart { final PackagePart p = packagePart.getPackage().getPart(relName); if (p == null) { - logger.log(POILogger.ERROR, "Skipped invalid entry " + rel.getTargetURI()); + logger.log(POILogger.ERROR, "Skipped invalid entry ", rel.getTargetURI()); continue; } diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java index 713876a0aa..292e016d1a 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java @@ -1006,9 +1006,8 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { sourcePartName = PackagingURIHelper.createPartName(sourceURI); } catch (InvalidFormatException e) { logger - .log(POILogger.ERROR, "Part name URI '" - + sourceURI - + "' is not valid ! This message is not intended to be displayed !"); + .log(POILogger.ERROR, "Part name URI '", sourceURI, + "' is not valid ! This message is not intended to be displayed !"); return; } if (sourcePartName.getURI().equals( diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java index 9b1bfedb27..3e584c9064 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java @@ -348,8 +348,8 @@ public final class PackageRelationshipCollection implements // package target = PackagingURIHelper.toURI(value); } catch (URISyntaxException e) { - logger.log(POILogger.ERROR, "Cannot convert " + value - + " in a valid relationship URI-> dummy-URI used", e); + logger.log(POILogger.ERROR, "Cannot convert ", value, + " in a valid relationship URI-> dummy-URI used", e); } addRelationship(target, targetMode, type, id); } diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java index 2520ba4378..4c510b09bc 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java @@ -145,7 +145,7 @@ public final class ZipPackage extends OPCPackage { throw new InvalidOperationException("Can't open the specified file: '" + file + "'", e); } - LOG.log(POILogger.ERROR, "Error in zip file "+file+" - falling back to stream processing (i.e. ignoring zip central directory)"); + LOG.log(POILogger.ERROR, "Error in zip file ", file, " - falling back to stream processing (i.e. ignoring zip central directory)"); ze = openZipEntrySourceStream(file); } this.zipArchive = ze; diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java index 2b2f5e7a89..731a61d121 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java @@ -71,8 +71,8 @@ public class ZipContentTypeManager extends ContentTypeManager { zos.closeArchiveEntry(); } } catch (IOException ioe) { - logger.log(POILogger.ERROR, "Cannot write: " + CONTENT_TYPES_PART_NAME - + " in Zip !", ioe); + logger.log(POILogger.ERROR, "Cannot write: ", CONTENT_TYPES_PART_NAME, + " in Zip !", ioe); return false; } } diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java index 7ff1c74abd..c8b6b601a0 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java @@ -64,7 +64,7 @@ public final class ZipPartMarshaller implements PartMarshaller { public boolean marshall(PackagePart part, OutputStream os) throws OpenXML4JException { if (!(os instanceof ZipArchiveOutputStream)) { - logger.log(POILogger.ERROR,"Unexpected class " + os.getClass().getName()); + logger.log(POILogger.ERROR,"Unexpected class ", os.getClass().getName()); throw new OpenXML4JException("ZipOutputStream expected !"); // Normally should happen only in development phase, so just throw // exception @@ -91,7 +91,7 @@ public final class ZipPartMarshaller implements PartMarshaller { zos.closeArchiveEntry(); } } catch (IOException ioe) { - logger.log(POILogger.ERROR,"Cannot write: " + part.getPartName() + ": in ZIP", + logger.log(POILogger.ERROR,"Cannot write: ", part.getPartName(), ": in ZIP", ioe); return false; } @@ -186,7 +186,7 @@ public final class ZipPartMarshaller implements PartMarshaller { zos.closeArchiveEntry(); } } catch (IOException e) { - logger.log(POILogger.ERROR,"Cannot create zip entry " + relPartName, e); + logger.log(POILogger.ERROR,"Cannot create zip entry ", relPartName, e); return false; } } diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java index 03ea27cce8..2c71bca336 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java @@ -138,7 +138,7 @@ public class RelationshipTransformService extends TransformService { @Override public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException { LOG.log(POILogger.DEBUG, "init(parent,context)"); - LOG.log(POILogger.DEBUG, "parent java type: " + parent.getClass().getName()); + LOG.log(POILogger.DEBUG, "parent java type: ", parent.getClass().getName()); DOMStructure domParent = (DOMStructure) parent; Node parentNode = domParent.getNode(); diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java index 925f463077..fae5c90d40 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java @@ -151,8 +151,8 @@ public class TSPTimeStampService implements TimeStampService { int statusCode = huc.getResponseCode(); if (statusCode != 200) { - LOG.log(POILogger.ERROR, "Error contacting TSP server ", signatureConfig.getTspUrl() + - ", had status code " + statusCode + "/" + huc.getResponseMessage()); + LOG.log(POILogger.ERROR, "Error contacting TSP server ", signatureConfig.getTspUrl(), + ", had status code ", statusCode, "/", huc.getResponseMessage()); throw new IOException("Error contacting TSP server " + signatureConfig.getTspUrl() + ", had status code " + statusCode + "/" + huc.getResponseMessage()); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPropertiesDelegate.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPropertiesDelegate.java index 09d0f20dd1..bce5af4d6b 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPropertiesDelegate.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPropertiesDelegate.java @@ -1848,7 +1848,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundProperti } else if (props instanceof CTTextCharacterProperties) { obj = new TextCharDelegate((CTTextCharacterProperties)props); } else { - LOG.log(POILogger.ERROR, props.getClass() +" is an unknown properties type"); + LOG.log(POILogger.ERROR, props.getClass(), " is an unknown properties type"); return null; } diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java index c71468a3ce..919f68554d 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java @@ -360,7 +360,7 @@ public class XSSFSheetXMLHandler extends DefaultHandler { thisStr = rtss.toString(); } catch (NumberFormatException ex) { - logger.log(POILogger.ERROR, "Failed to parse SST index '" + sstIndex, ex); + logger.log(POILogger.ERROR, "Failed to parse SST index '", sstIndex, ex); } break; diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java index 2c41313691..d6594d4e87 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java @@ -186,7 +186,7 @@ public class SheetDataWriter implements Closeable { @Override protected void finalize() throws Throwable { if (_fd.exists() && !_fd.delete()) { - logger.log(POILogger.ERROR, "Can't delete temporary encryption file: "+_fd); + logger.log(POILogger.ERROR, "Can't delete temporary encryption file: ", _fd); } } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 7eb2a45b39..6f8613afa6 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -557,7 +557,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { break; } } - logger.log(POILogger.ERROR, "Can't find drawing with id=" + ctDrawing.getId() + " in the list of the sheet's relationships"); + logger.log(POILogger.ERROR, "Can't find drawing with id=", ctDrawing.getId(), " in the list of the sheet's relationships"); } return null; } @@ -629,7 +629,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { } } if(drawing == null){ - logger.log(POILogger.ERROR, "Can't find VML drawing with id=" + id + " in the list of the sheet's relationships"); + logger.log(POILogger.ERROR, "Can't find VML drawing with id=", id, " in the list of the sheet's relationships"); } } return drawing; |