aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-12-17 21:03:27 +0000
committerPJ Fanning <fanningpj@apache.org>2020-12-17 21:03:27 +0000
commit0e0d1d56da7d3ad69e80dae199a7f9741b385bb9 (patch)
tree87af37de9c0f68629b2a91d71f983a73222dd515
parentf9387f37b33e733c1f6c69c520c223bfc9dda245 (diff)
downloadpoi-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
-rw-r--r--src/java/org/apache/poi/POIDocument.java4
-rw-r--r--src/java/org/apache/poi/hpsf/CustomProperties.java2
-rw-r--r--src/java/org/apache/poi/hssf/dev/BiffViewer.java2
-rw-r--r--src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java8
-rw-r--r--src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java2
-rw-r--r--src/java/org/apache/poi/hssf/record/FeatRecord.java2
-rw-r--r--src/java/org/apache/poi/hssf/record/SSTDeserializer.java14
-rw-r--r--src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java2
-rw-r--r--src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptor.java2
-rw-r--r--src/java/org/apache/poi/ss/util/DateFormatConverter.java2
-rw-r--r--src/java/org/apache/poi/util/Configurator.java2
-rw-r--r--src/java/org/apache/poi/util/IOUtils.java2
-rw-r--r--src/java/org/apache/poi/util/SystemOutLogger.java7
-rw-r--r--src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java2
-rw-r--r--src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java5
-rw-r--r--src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java4
-rw-r--r--src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java2
-rw-r--r--src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java4
-rw-r--r--src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java6
-rw-r--r--src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java2
-rw-r--r--src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java4
-rw-r--r--src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPropertiesDelegate.java2
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java2
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java2
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java4
-rw-r--r--src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java4
-rw-r--r--src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/blip/PICT.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/record/AnimationInfo.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/record/ExEmbed.java4
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/record/ExHyperlink.java4
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/record/ExVideoContainer.java4
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/record/Sound.java4
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/record/TextRulerAtom.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFGroupShape.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureShape.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java15
-rw-r--r--src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java8
-rw-r--r--src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java3
-rw-r--r--src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java2
-rw-r--r--src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java3
42 files changed, 78 insertions, 77 deletions
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<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;
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<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);
}
}
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<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());
}
}
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<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;
}
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java
index 95dfe1983b..7bebedf6dd 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java
@@ -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);
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
index 433dcf0443..52338244f8 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java
@@ -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!");
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java
index 70b5f6233a..24162dcb3d 100644
--- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java
+++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java
@@ -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;
diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java
index aa6926ceef..4e142c6cff 100644
--- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java
+++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java
@@ -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);
}
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java b/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
index d0e8caf66c..d46881f1c0 100644
--- a/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
+++ b/src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java
@@ -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);
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java
index c89661cd99..251dd4806b 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java
@@ -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 );
}
}
}