]> source.dussan.org Git - poi.git/commitdiff
avoid string concats
authorPJ Fanning <fanningpj@apache.org>
Thu, 17 Dec 2020 21:03:27 +0000 (21:03 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 17 Dec 2020 21:03:27 +0000 (21:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884572 13f79535-47bb-0310-9956-ffa450edef68

42 files changed:
src/java/org/apache/poi/POIDocument.java
src/java/org/apache/poi/hpsf/CustomProperties.java
src/java/org/apache/poi/hssf/dev/BiffViewer.java
src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java
src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java
src/java/org/apache/poi/hssf/record/FeatRecord.java
src/java/org/apache/poi/hssf/record/SSTDeserializer.java
src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java
src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptor.java
src/java/org/apache/poi/ss/util/DateFormatConverter.java
src/java/org/apache/poi/util/Configurator.java
src/java/org/apache/poi/util/IOUtils.java
src/java/org/apache/poi/util/SystemOutLogger.java
src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java
src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java
src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java
src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java
src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java
src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java
src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java
src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPropertiesDelegate.java
src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java
src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java
src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java
src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java
src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java
src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java
src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java
src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java
src/scratchpad/src/org/apache/poi/hslf/record/Sound.java
src/scratchpad/src/org/apache/poi/hslf/record/TextRulerAtom.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java
src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java
src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java

index 55517ffe766e63b662c1ee653fac0a7d8db25002..ecae9c2e0bb5331b807cdf0dc69c607984f5b057 100644 (file)
@@ -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");
         }
     }
 
index 84373c589c1861b21621a09c429403c5efec60a6..6e901832d804bb40e3881eb43f8a3bc7741e8150 100644 (file)
@@ -393,7 +393,7 @@ public class CustomProperties implements Map<String,Object> {
         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;
index d7a6f45a1513f60e12c6810b63979e6b6188059a..49e06dd7389010b78d650fc4f572d51369d1d787 100644 (file)
@@ -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();
             }
index ebeba4f21dab9932c9a3517458db241293366f0d..6cc4b2edd4d07813866888fa3914601e9f7a1b78 100644 (file)
@@ -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();
index 915e1771ee5211be2698dcb9e787739a8136d35f..94b62bacb901877c4079d64a06d59cbe41ec53ec 100644 (file)
@@ -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;
                }
index e51cb32bc9a5446bc866de8e2122afff366a4263..6ca4a941a4a081a637bc5649e6b851285ad56515 100644 (file)
@@ -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!");
                }
        }
 
index 181616185f5d9176a2f20af262dada0f457aef2e..1fafa37566830e84df29829653db6c682cbc6b9a 100644 (file)
@@ -50,18 +50,18 @@ class SSTDeserializer
       for (int i=0;i<stringCount;i++) {
          // Extract exactly the count of strings from the SST record.
          UnicodeString str;
-         if(in.available() == 0 && ! in.hasNextRecord()) {
-                logger.log( POILogger.ERROR, "Ran out of data before creating all the strings! String at index " + i + "");
-            str = new UnicodeString("");
-         } else {
-            str = new UnicodeString(in);
-         }
+          if (in.available() == 0 && !in.hasNextRecord()) {
+              logger.log(POILogger.ERROR, "Ran out of data before creating all the strings! String at index ", i);
+              str = new UnicodeString("");
+          } else {
+              str = new UnicodeString(in);
+          }
          addToStringTable( strings, str );
       }
     }
 
     static public void addToStringTable( IntMapper<UnicodeString> strings, UnicodeString string )
     {
-      strings.add(string);
+        strings.add(string);
     }
 }
index e00b1c2bac9f869eb3d1a74a360f331f6d021eee..d5ea57a655549e80ebe6e900fcfffab95133a867 100644 (file)
@@ -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);
index 2dfbc1f547c8999ed56073341e85cab7f07b3a23..90d1dc07577e01421be8c6f015b7e5124db182ac 100644 (file)
@@ -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();
index 6c044de6c7954d114580bf7887c0b192143a7120..f8c7f338cf37b071ad11164dc2c786afcdf02208 100644 (file)
@@ -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 "";
                        }
                }
index b1ee1a77dae5a94796102c995cacc431bf01c235..7831f0d320044e3aa1bc4f4bfb4d88aa2d2eb8e7 100644 (file)
@@ -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;
     }
index fc75f4f6520fa0579ef064cd38903d26a49c33ac..1a53cdd0b0b30ce84c7aa26ed355f26eb832d028 100644 (file)
@@ -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 );
         }
     }
index 3567c40808be88b8fc86d02a3156f646dc986835..cc414f76a5125d625b51c6bc2e674cfc62eae671 100644 (file)
@@ -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);
         }
index fd9b032ef6c7b18c8b2d28a9194126b1a1f47965..1f90ae842f4f6cb5960068b0f992f4a4f476b6cd 100644 (file)
@@ -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;
                 }
 
index 713876a0aaacfc11a8e7120736a7d483f25a81a0..292e016d1a9dfc3e072cb48fc2b39595e1f45dab 100644 (file)
@@ -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(
index 9b1bfedb27b4d8ba4e4331b0e8be8d93c699227d..3e584c906433928afa7980b0c9a8171aa9d3b83d 100644 (file)
@@ -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);
             }
index 2520ba4378d218d9d28c1878d415ec6faf4ee663..4c510b09bcb29fa8a6cc6d207740b40ba1e21939 100644 (file)
@@ -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;
index 2b2f5e7a895d3cabfbd423379f637f14fff3c380..731a61d1212ab77a6b32798ca1e3fa729b024f7d 100644 (file)
@@ -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;
                }
        }
index 7ff1c74abd04d93564d4999e7efb6a98263c3dfa..c8b6b601a08d07ae88b49a6ce011d1f4b8a7ec60 100644 (file)
@@ -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;
                }
        }
index 03ea27cce8bf5814813650ed08a52d6b470753fa..2c71bca336d2eea76add3a2a6d4f7efe89922169 100644 (file)
@@ -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();
 
index 925f46307770e906b8e37ae51f104e9cace6ffba..fae5c90d40b180bf28d3cac46465a2019374a039 100644 (file)
@@ -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());
             }
index 09d0f20dd141aa2289f96db8a557feb7f107924d..bce5af4d6b7e4234b3fdf41d19318d6f6e1a58ba 100644 (file)
@@ -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;
         }
 
index c71468a3ced2305906ff6a1b1453f12371f2b50c..919f68554dd0dc497992a5a527c1e180f5efc1b4 100644 (file)
@@ -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;
 
index 2c4131369158f90c272a730d24fe847f33bbb467..d6594d4e8735a302bc727bc4585abd390b1a99eb 100644 (file)
@@ -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);
         }
     }
 
index 7eb2a45b390f380696ad1da37ebfb1e1b550603f..6f8613afa64947a81e3a0920b0543ae5bc7bc7bc 100644 (file)
@@ -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;
index 9c5087350eb94a313daaef6d73cc949dc23b52f9..abf140c56f22e819ce2ec41e8496f719a81e5b4f 100644 (file)
@@ -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, ")");
                        }
                }
 
index a669a0af527f0145b3d5fec452bd6e0b3c5eda17..ac1d972f8e135e27456171ca0970c9f81dcfc130 100644 (file)
@@ -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]);
index 201f98e603553f6712821b210d9db500bef0049e..cc76fefe8999d49cbe75f818ecd229ecd529ae41 100644 (file)
@@ -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();
     }
index baa17a08ea01564da9752473d313fcd919671945..7b8e173ec1936c48eee4bf0c79344fc864f0df4f 100644 (file)
@@ -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());
                }
        }
 
index 486a9bf23566f02400a2e77862d922ac6c25c66e..9d1f9a7078c9e6784ed148fedd96398e27e2322b 100644 (file)
@@ -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++) {
index 4dabe4cc8263cb132a45b80f163bebc8619db046..c0cdd557c641faf92546439a9d0ef1c466ed6cb9 100644 (file)
@@ -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());
             }
 
         }
index bebb2aecfe65413b364237d4d294fea3f1148c32..430b774b1b1f9c73762bf5da800cc5086979f5d4 100644 (file)
@@ -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());
         }
        }
 
index 27a2c1b8cfcdaf2db807cf72a2ca51093c2e9479..df9c245d6d68258205724ebae16d283f220b5714 100644 (file)
@@ -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++) {
index c50f18fe77ab4d69bfb6b55fbefa3d52d21edf4d..2ffb80a94932baae34db677deea4e1024c8e7317 100644 (file)
@@ -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());
         }
     }
 
index b47373899ad2a547708230f3ffd185abaa2aa9b7..66cec7e4a66f2d9a527c30aa6724fd775d505464 100644 (file)
@@ -289,7 +289,7 @@ implements HSLFShapeContainer, GroupShape<HSLFShape,HSLFTextParagraph> {
             } 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());
             }
         }
 
index 8c4aead756a930b0301240fa7fea668568afcc37..353ff715ad44294c7615a8f7fa60cac1cfc0446b 100644 (file)
@@ -127,7 +127,7 @@ public class HSLFPictureShape extends HSLFSimpleShape implements PictureShape<HS
                     return pd;
                 }
             }
-            LOG.log(POILogger.ERROR, "no picture found for our BSE offset " + bse.getOffset());
+            LOG.log(POILogger.ERROR, "no picture found for our BSE offset ", bse.getOffset());
         }
         return null;
     }
index 95dfe1983bd03d0d15032175dd0a321ea712eab5..7bebedf6ddeb5d282c9169fdfd593eb789ff4775 100644 (file)
@@ -290,8 +290,7 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh
                        return _mostRecentCoreRecords[coreRecordId];
                }
                logger.log(POILogger.ERROR,
-                               "We tried to look up a reference to a core record, but there was no core ID for reference ID "
-                                               + refID);
+                               "We tried to look up a reference to a core record, but there was no core ID for reference ID ", refID);
                return null;
        }
 
@@ -388,7 +387,7 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh
 
             // Ensure it really is a notes record
             if (!(r instanceof Notes)) {
-                logger.log(POILogger.ERROR, loggerLoc+", but that was actually a " + r);
+                logger.log(POILogger.ERROR, loggerLoc, ", but that was actually a ", r);
                 continue;
             }
 
@@ -420,10 +419,10 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh
 
             // Ensure it really is a slide record
             if (!(r instanceof Slide)) {
-                logger.log(POILogger.ERROR, "A Slide SlideAtomSet at " + idx
-                        + " said its record was at refID "
-                        + spa.getRefID()
-                        + ", but that was actually a " + r);
+                logger.log(POILogger.ERROR, "A Slide SlideAtomSet at ", idx,
+                        " said its record was at refID ",
+                        spa.getRefID(),
+                        ", but that was actually a ", r);
                 continue;
             }
 
@@ -439,7 +438,7 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh
                 if (notesPos != null && 0 <= notesPos && notesPos < _notes.size()) {
                     notes = _notes.get(notesPos);
                 } else {
-                    logger.log(POILogger.ERROR, "Notes not found for noteId=" + noteId);
+                    logger.log(POILogger.ERROR, "Notes not found for noteId=", noteId);
                 }
             }
 
index 433dcf04432df515d92c67ea8c6cfc129009ba64..52338244f8ddce37cda5c7ae0d67daf8eec83d34 100644 (file)
@@ -330,7 +330,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
         try {
             currentUser = new CurrentUserAtom(getDirectory());
         } catch (IOException ie) {
-            logger.log(POILogger.ERROR, "Error finding Current User Atom:\n" + ie);
+            logger.log(POILogger.ERROR, "Error finding Current User Atom", ie);
             currentUser = new CurrentUserAtom();
         }
     }
@@ -394,8 +394,8 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
                 // If they type (including the bonus 0xF018) is 0, skip it
                 PictureType pt = PictureType.forNativeID(type - 0xF018);
                 if (pt == null) {
-                    logger.log(POILogger.ERROR, "Problem reading picture: Invalid image type 0, on picture with length " + imgsize + ".\nYou document will probably become corrupted if you save it!");
-                    logger.log(POILogger.ERROR, "" + pos);
+                    logger.log(POILogger.ERROR, "Problem reading picture: Invalid image type 0, on picture with length ", imgsize, ".\nYou document will probably become corrupted if you save it!");
+                    logger.log(POILogger.ERROR, "position: ", pos);
                 } else {
                     //The pictstream can be truncated halfway through a picture.
                     //This is not a problem if the pictstream contains extra pictures
@@ -418,7 +418,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
                         pict.setIndex(_pictures.size());
                         _pictures.add(pict);
                     } catch (IllegalArgumentException e) {
-                        logger.log(POILogger.ERROR, "Problem reading picture: " + e + "\nYou document will probably become corrupted if you save it!");
+                        logger.log(POILogger.ERROR, "Problem reading picture: ", e, "\nYou document will probably become corrupted if you save it!");
                     }
                 }
 
index 70b5f6233a0d6ec7e09486ac4990073ce4fae27c..24162dcb3dff65dee9f7f7de50a92bdeafb110d3 100644 (file)
@@ -187,7 +187,7 @@ public class AttachmentChunks implements ChunkGroup {
             } else if (chunk instanceof DirectoryChunk) {
                 attachmentDirectory = (DirectoryChunk) chunk;
             } else {
-                LOG.log(POILogger.ERROR, "Unexpected data chunk of type " + chunk.getEntryName());
+                LOG.log(POILogger.ERROR, "Unexpected data chunk of type ", chunk.getEntryName());
             }
         } else if (chunkId == ATTACH_EXTENSION.id) {
             attachExtension = (StringChunk) chunk;
index aa6926ceef259ba16684b71a5518e618b6398a2a..4e142c6cff7ff125a797cceca8160e4066bb7940 100644 (file)
@@ -88,8 +88,7 @@ public final class RecipientChunks implements ChunkGroupWithProperties {
             try {
                 recipientNumber = Integer.parseInt(number, 16);
             } catch (NumberFormatException e) {
-                LOG.log(POILogger.ERROR,
-                        "Invalid recipient number in name " + name);
+                LOG.log(POILogger.ERROR, "Invalid recipient number in name ", name);
             }
         }
     }
index d0e8caf66c662b09b256fbeba4a51a7be846a780..d46881f1c02c514cc394713b8c62ac752baabffb 100644 (file)
@@ -149,7 +149,7 @@ public final class POIFSChunkParser {
             try (DocumentInputStream inp = new DocumentInputStream((DocumentNode) entry)) {
                 chunk.readValue(inp);
             } catch (IOException e) {
-                LOG.log(POILogger.ERROR, "Error reading from part " + entry.getName(), e);
+                LOG.log(POILogger.ERROR, "Error reading from part ", entry.getName(), e);
             }
         }
 
index c89661cd99f483b8573193a64d5d8eb552d9be35..251dd4806bfdad21edaeec547e222037b6dd2c7c 100644 (file)
@@ -73,8 +73,7 @@ public final class ParagraphSprmUncompressor
           {
               logger.log(
                       POILogger.ERROR,
-                      "Unable to apply SPRM operation '"
-                              + sprm.getOperation() + "': ", exc );
+                      "Unable to apply SPRM operation '", sprm.getOperation(), "': ", exc );
           }
       }
     }