From: PJ Fanning Date: Thu, 17 Dec 2020 21:03:27 +0000 (+0000) Subject: avoid string concats X-Git-Tag: before_junit5_update~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0e0d1d56da7d3ad69e80dae199a7f9741b385bb9;p=poi.git avoid string concats git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884572 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/POIDocument.java b/src/java/org/apache/poi/POIDocument.java index 55517ffe76..ecae9c2e0b 100644 --- a/src/java/org/apache/poi/POIDocument.java +++ b/src/java/org/apache/poi/POIDocument.java @@ -333,9 +333,9 @@ public abstract class POIDocument implements Closeable { // Create or Update the Property Set stream in the POIFS outFS.createOrUpdateDocument(bIn, name); - logger.log(POILogger.INFO, "Wrote property set " + name + " of size " + data.length); + logger.log(POILogger.INFO, "Wrote property set ", name, " of size ", data.length); } catch(WritingNotSupportedException ignored) { - logger.log( POILogger.ERROR, "Couldn't write property set with name " + name + " as not supported by HPSF yet"); + logger.log( POILogger.ERROR, "Couldn't write property set with name ", name, " as not supported by HPSF yet"); } } diff --git a/src/java/org/apache/poi/hpsf/CustomProperties.java b/src/java/org/apache/poi/hpsf/CustomProperties.java index 84373c589c..6e901832d8 100644 --- a/src/java/org/apache/poi/hpsf/CustomProperties.java +++ b/src/java/org/apache/poi/hpsf/CustomProperties.java @@ -393,7 +393,7 @@ public class CustomProperties implements Map { try { cps = CodePageUtil.codepageToEncoding(cp, false); } catch (UnsupportedEncodingException e) { - LOG.log(POILogger.ERROR, "Codepage '"+cp+"' can't be found."); + LOG.log(POILogger.ERROR, "Codepage '", cp, "' can't be found."); } if (!cps.isEmpty() && Charset.forName(cps).newEncoder().canEncode(value)) { return; diff --git a/src/java/org/apache/poi/hssf/dev/BiffViewer.java b/src/java/org/apache/poi/hssf/dev/BiffViewer.java index d7a6f45a15..49e06dd738 100644 --- a/src/java/org/apache/poi/hssf/dev/BiffViewer.java +++ b/src/java/org/apache/poi/hssf/dev/BiffViewer.java @@ -81,7 +81,7 @@ public final class BiffViewer { try { hasNext = recStream.hasNextRecord(); } catch (LeftoverDataException e) { - logger.log(POILogger.ERROR, "Discarding " + recStream.remaining() + " bytes and continuing", e); + logger.log(POILogger.ERROR, "Discarding ", recStream.remaining(), " bytes and continuing", e); recStream.readRemainder(); hasNext = recStream.hasNextRecord(); } diff --git a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java index ebeba4f21d..6cc4b2edd4 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java @@ -155,8 +155,8 @@ public class FormatTrackingHSSFListener implements HSSFListener { if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) { FormatRecord tfr = _customFormatRecords.get(Integer.valueOf(formatIndex)); if (tfr == null) { - logger.log( POILogger.ERROR, "Requested format at index " + formatIndex - + ", but it wasn't found"); + logger.log( POILogger.ERROR, "Requested format at index ", formatIndex, + ", but it wasn't found"); } else { format = tfr.getFormatString(); } @@ -192,8 +192,8 @@ public class FormatTrackingHSSFListener implements HSSFListener { public int getFormatIndex(CellValueRecordInterface cell) { ExtendedFormatRecord xfr = _xfRecords.get(cell.getXFIndex()); if (xfr == null) { - logger.log( POILogger.ERROR, "Cell " + cell.getRow() + "," + cell.getColumn() - + " uses XF with index " + cell.getXFIndex() + ", but we don't have that"); + logger.log( POILogger.ERROR, "Cell ", cell.getRow(), ",", cell.getColumn(), + " uses XF with index ", cell.getXFIndex(), ", but we don't have that"); return -1; } return xfr.getFormatIndex(); diff --git a/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java b/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java index 915e1771ee..94b62bacb9 100644 --- a/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java +++ b/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java @@ -157,7 +157,7 @@ public final class EmbeddedObjectRefSubRecord extends SubRecord { int nUnexpectedPadding = remaining - dataLenAfterFormula; if (nUnexpectedPadding > 0) { - logger.log( POILogger.ERROR, "Discarding " + nUnexpectedPadding + " unexpected padding bytes "); + logger.log( POILogger.ERROR, "Discarding ", nUnexpectedPadding, " unexpected padding bytes"); readRawData(in, nUnexpectedPadding); remaining-=nUnexpectedPadding; } diff --git a/src/java/org/apache/poi/hssf/record/FeatRecord.java b/src/java/org/apache/poi/hssf/record/FeatRecord.java index e51cb32bc9..6ca4a941a4 100644 --- a/src/java/org/apache/poi/hssf/record/FeatRecord.java +++ b/src/java/org/apache/poi/hssf/record/FeatRecord.java @@ -108,7 +108,7 @@ public final class FeatRecord extends StandardRecord { sharedFeature = new FeatSmartTag(in); break; default: - logger.log( POILogger.ERROR, "Unknown Shared Feature " + isf_sharedFeatureType + " found!"); + logger.log( POILogger.ERROR, "Unknown Shared Feature ", isf_sharedFeatureType, " found!"); } } diff --git a/src/java/org/apache/poi/hssf/record/SSTDeserializer.java b/src/java/org/apache/poi/hssf/record/SSTDeserializer.java index 181616185f..1fafa37566 100644 --- a/src/java/org/apache/poi/hssf/record/SSTDeserializer.java +++ b/src/java/org/apache/poi/hssf/record/SSTDeserializer.java @@ -50,18 +50,18 @@ class SSTDeserializer for (int i=0;i strings, UnicodeString string ) { - strings.add(string); + strings.add(string); } } diff --git a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java index e00b1c2bac..d5ea57a655 100644 --- a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java +++ b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java @@ -324,7 +324,7 @@ public abstract class ChunkedCipherOutputStream extends FilterOutputStream { } if (!fileOut.delete()) { - LOG.log(POILogger.ERROR, "Can't delete temporary encryption file: "+fileOut); + LOG.log(POILogger.ERROR, "Can't delete temporary encryption file: ", fileOut); } } catch (IOException e) { throw new EncryptedDocumentException(e); diff --git a/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptor.java b/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptor.java index 2dfbc1f547..90d1dc0757 100644 --- a/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptor.java +++ b/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptor.java @@ -193,7 +193,7 @@ public class StandardEncryptor extends Encryptor { IOUtils.copy(fis, leos); } if (!fileOut.delete()) { - logger.log(POILogger.ERROR, "Can't delete temporary encryption file: "+fileOut); + logger.log(POILogger.ERROR, "Can't delete temporary encryption file: ", fileOut); } leos.close(); diff --git a/src/java/org/apache/poi/ss/util/DateFormatConverter.java b/src/java/org/apache/poi/ss/util/DateFormatConverter.java index 6c044de6c7..f8c7f338cf 100644 --- a/src/java/org/apache/poi/ss/util/DateFormatConverter.java +++ b/src/java/org/apache/poi/ss/util/DateFormatConverter.java @@ -152,7 +152,7 @@ public final class DateFormatConverter { loc = LocaleID.lookupByLanguageTag(languageTag.substring(0, idx)); } if (loc == null) { - logger.log( POILogger.ERROR, "Unable to find prefix for Locale '" + languageTag + "' or its parent locales." ); + logger.log( POILogger.ERROR, "Unable to find prefix for Locale '", languageTag, "' or its parent locales." ); return ""; } } diff --git a/src/java/org/apache/poi/util/Configurator.java b/src/java/org/apache/poi/util/Configurator.java index b1ee1a77da..7831f0d320 100644 --- a/src/java/org/apache/poi/util/Configurator.java +++ b/src/java/org/apache/poi/util/Configurator.java @@ -29,7 +29,7 @@ public class Configurator { try { result = Integer.parseInt(property); } catch (Exception e) { - logger.log(POILogger.ERROR, "System property -D"+systemProperty +" do not contains a valid integer " + property); + logger.log(POILogger.ERROR, "System property -D", systemProperty, " does not contains a valid integer: ", property); } return result; } diff --git a/src/java/org/apache/poi/util/IOUtils.java b/src/java/org/apache/poi/util/IOUtils.java index fc75f4f652..1a53cdd0b0 100644 --- a/src/java/org/apache/poi/util/IOUtils.java +++ b/src/java/org/apache/poi/util/IOUtils.java @@ -394,7 +394,7 @@ public final class IOUtils { try { closeable.close(); } catch ( Exception exc ) { - logger.log( POILogger.ERROR, "Unable to close resource: " + exc, + logger.log( POILogger.ERROR, "Unable to close resource: ", exc, exc ); } } diff --git a/src/java/org/apache/poi/util/SystemOutLogger.java b/src/java/org/apache/poi/util/SystemOutLogger.java index 3567c40808..cc414f76a5 100644 --- a/src/java/org/apache/poi/util/SystemOutLogger.java +++ b/src/java/org/apache/poi/util/SystemOutLogger.java @@ -60,7 +60,12 @@ public class SystemOutLogger implements POILogger { if (!check(level)) { return; } - System.out.println("[" + _cat + "]" + LEVEL_STRINGS_SHORT.charAt(Math.min(LEVEL_STRINGS_SHORT.length()-1, level)) + " " + obj1); + System.out.print("["); + System.out.print(_cat); + System.out.print("]"); + System.out.print(LEVEL_STRINGS_SHORT.charAt(Math.min(LEVEL_STRINGS_SHORT.length()-1, level))); + System.out.print(" "); + System.out.println(obj1); if (exception != null) { exception.printStackTrace(System.out); } 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; diff --git a/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java b/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java index 9c5087350e..abf140c56f 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java @@ -165,7 +165,7 @@ public final class ChunkFactory { data, endOfDataPos); endOfDataPos += 8; } else { - logger.log(POILogger.ERROR, "Header claims a length to " + endOfDataPos + " there's then no space for the trailer in the data (" + data.length + ")"); + logger.log(POILogger.ERROR, "Header claims a length to ", endOfDataPos, " there's then no space for the trailer in the data (", data.length, ")"); } } if(header.hasSeparator()) { @@ -173,7 +173,7 @@ public final class ChunkFactory { separator = new ChunkSeparator( data, endOfDataPos); } else { - logger.log(POILogger.ERROR, "Header claims a length to " + endOfDataPos + " there's then no space for the separator in the data (" + data.length + ")"); + logger.log(POILogger.ERROR, "Header claims a length to ", endOfDataPos, " there's then no space for the separator in the data (", data.length, ")"); } } diff --git a/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java b/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java index a669a0af52..ac1d972f8e 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java @@ -73,7 +73,7 @@ public final class ChunkStream extends Stream { } catch (Exception e) { - logger.log(POILogger.ERROR, "Failed to create chunk at " + pos + ", ignoring rest of data." + e); + logger.log(POILogger.ERROR, "Failed to create chunk at ", pos, ", ignoring rest of data." + e); } chunks = chunksA.toArray(new Chunk[0]); diff --git a/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java b/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java index 201f98e603..cc76fefe89 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java +++ b/src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java @@ -85,7 +85,7 @@ public final class PICT extends Metafile { out.write(chunk, 0, lastLen); } // End of picture marker for PICT is 0x00 0xFF - LOG.log(POILogger.ERROR, "PICT zip-stream is invalid, read as much as possible. Uncompressed length of header: " + header.getWmfSize() + " / Read bytes: " + out.size(), e); + LOG.log(POILogger.ERROR, "PICT zip-stream is invalid, read as much as possible. Uncompressed length of header: ", header.getWmfSize(), " / Read bytes: ", out.size(), e); } return out.toByteArray(); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java b/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java index baa17a08ea..7b8e173ec1 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java @@ -58,7 +58,7 @@ public final class AnimationInfo extends RecordContainer { if(_children[0] instanceof AnimationInfoAtom) { animationAtom = (AnimationInfoAtom)_children[0]; } else { - logger.log(POILogger.ERROR, "First child record wasn't a AnimationInfoAtom, was of type " + _children[0].getRecordType()); + logger.log(POILogger.ERROR, "First child record wasn't a AnimationInfoAtom, was of type ", _children[0].getRecordType()); } } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java index 486a9bf235..9d1f9a7078 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java @@ -105,14 +105,14 @@ public class ExEmbed extends RecordContainer { if(_children[0] instanceof ExEmbedAtom) { embedAtom = (ExEmbedAtom)_children[0]; } else { - logger.log(POILogger.ERROR, "First child record wasn't a ExEmbedAtom, was of type " + _children[0].getRecordType()); + logger.log(POILogger.ERROR, "First child record wasn't a ExEmbedAtom, was of type ", _children[0].getRecordType()); } // Second child should be the ExOleObjAtom if (_children[1] instanceof ExOleObjAtom) { oleObjAtom = (ExOleObjAtom)_children[1]; } else { - logger.log(POILogger.ERROR, "Second child record wasn't a ExOleObjAtom, was of type " + _children[1].getRecordType()); + logger.log(POILogger.ERROR, "Second child record wasn't a ExOleObjAtom, was of type ", _children[1].getRecordType()); } for (int i = 2; i < _children.length; i++) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java index 4dabe4cc82..c0cdd557c6 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java @@ -118,7 +118,7 @@ public class ExHyperlink extends RecordContainer { if(_children[0] instanceof ExHyperlinkAtom) { linkAtom = (ExHyperlinkAtom)_children[0]; } else { - logger.log(POILogger.ERROR, "First child record wasn't a ExHyperlinkAtom, was of type " + _children[0].getRecordType()); + logger.log(POILogger.ERROR, "First child record wasn't a ExHyperlinkAtom, was of type ", _children[0].getRecordType()); } for (int i = 1; i < _children.length; i++) { @@ -126,7 +126,7 @@ public class ExHyperlink extends RecordContainer { if ( linkDetailsA == null) linkDetailsA = (CString)_children[i]; else linkDetailsB = (CString)_children[i]; } else { - logger.log(POILogger.ERROR, "Record after ExHyperlinkAtom wasn't a CString, was of type " + _children[1].getRecordType()); + logger.log(POILogger.ERROR, "Record after ExHyperlinkAtom wasn't a CString, was of type ", _children[1].getRecordType()); } } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java b/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java index bebb2aecfe..430b774b1b 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java @@ -60,12 +60,12 @@ public final class ExVideoContainer extends RecordContainer { if(_children[0] instanceof ExMediaAtom) { mediaAtom = (ExMediaAtom)_children[0]; } else { - logger.log(POILogger.ERROR, "First child record wasn't a ExMediaAtom, was of type " + _children[0].getRecordType()); + logger.log(POILogger.ERROR, "First child record wasn't a ExMediaAtom, was of type ", _children[0].getRecordType()); } if(_children[1] instanceof CString) { pathAtom = (CString)_children[1]; } else { - logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type " + _children[1].getRecordType()); + logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type ", _children[1].getRecordType()); } } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/Sound.java b/src/scratchpad/src/org/apache/poi/hslf/record/Sound.java index 27a2c1b8cf..df9c245d6d 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/Sound.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/Sound.java @@ -68,14 +68,14 @@ public final class Sound extends RecordContainer { if(_children[0] instanceof CString) { _name = (CString)_children[0]; } else { - logger.log(POILogger.ERROR, "First child record wasn't a CString, was of type " + _children[0].getRecordType()); + logger.log(POILogger.ERROR, "First child record wasn't a CString, was of type ", _children[0].getRecordType()); } // Second child should be the ExOleObjAtom if (_children[1] instanceof CString) { _type = (CString)_children[1]; } else { - logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type " + _children[1].getRecordType()); + logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type ", _children[1].getRecordType()); } for (int i = 2; i < _children.length; i++) { diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/TextRulerAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/TextRulerAtom.java index c50f18fe77..2ffb80a949 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/TextRulerAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/TextRulerAtom.java @@ -98,7 +98,7 @@ public final class TextRulerAtom extends RecordAtom { // Get the record data. read(leis); } catch (IOException e){ - logger.log(POILogger.ERROR, "Failed to parse TextRulerAtom: " + e.getMessage()); + logger.log(POILogger.ERROR, "Failed to parse TextRulerAtom: ", e.getMessage()); } } diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java index b47373899a..66cec7e4a6 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java @@ -289,7 +289,7 @@ implements HSLFShapeContainer, GroupShape { } else { // Should we do anything special with these non // Container records? - LOG.log(POILogger.ERROR, "Shape contained non container escher record, was " + r.getClass().getName()); + LOG.log(POILogger.ERROR, "Shape contained non container escher record, was ", r.getClass().getName()); } } diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java index 8c4aead756..353ff715ad 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java @@ -127,7 +127,7 @@ public class HSLFPictureShape extends HSLFSimpleShape implements PictureShape