diff --git a/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java b/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java
index 1a0ade2af0..f4b5ba10d0 100644
--- a/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java
+++ b/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java
@@ -142,7 +142,7 @@ public class CopyCompare
if (equal(oRoot, cRoot, messages)) {
System.out.println("Equal");
} else {
- System.out.println("Not equal: " + messages.toString());
+ System.out.println("Not equal: " + messages);
}
cpfs.close();
opfs.close();
diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java b/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java
index 8ce336f24d..e6e55c0a27 100644
--- a/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java
+++ b/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java
@@ -159,7 +159,7 @@ public class PropertySetDescriptorRenderer extends DocumentDescriptorRenderer
b.append(' ');
System.arraycopy(value, ((byte[])value).length - 4, buf, 0, 4);
} else if (value != null) {
- b.append(value.toString());
+ b.append(value);
} else {
b.append("null");
}
diff --git a/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java b/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java
index cf6c176cc8..94f7cd1118 100644
--- a/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java
+++ b/src/examples/src/org/apache/poi/ss/examples/formula/CheckFunctionsSupported.java
@@ -89,8 +89,8 @@ public class CheckFunctionsSupported {
System.out.println(" All cells evaluated without error");
} else {
for (CellReference cr : probs.unevaluatableCells.keySet()) {
- System.out.println(" " + cr.formatAsString() + " - " +
- probs.unevaluatableCells.get(cr).toString());
+ System.out.println(" " + cr.formatAsString() + " - " +
+ probs.unevaluatableCells.get(cr));
}
}
}
diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java
index 2ac609a8aa..dfd1f89114 100644
--- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java
+++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/IterateCells.java
@@ -39,7 +39,7 @@ public class IterateCells {
for (Row row : sheet) {
System.out.println("rownum: " + row.getRowNum());
for (Cell cell : row) {
- System.out.println(cell.toString());
+ System.out.println(cell);
}
}
}
diff --git a/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntWorkbookUtil.java b/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntWorkbookUtil.java
index bf68c24817..84663feb32 100644
--- a/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntWorkbookUtil.java
+++ b/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntWorkbookUtil.java
@@ -198,9 +198,9 @@ public class TestExcelAntWorkbookUtil extends TestCase {
precision);
//System.out.println(result);
- assertTrue("Had:" + result.toString(), result.toString().contains("evaluationCompletedWithError=false"));
- assertTrue("Had:" + result.toString(), result.toString().contains("returnValue=790.79"));
- assertTrue("Had:" + result.toString(), result.toString().contains("cellName='MortgageCalculator'!B4"));
+ assertTrue("Had:" + result, result.toString().contains("evaluationCompletedWithError=false"));
+ assertTrue("Had:" + result, result.toString().contains("returnValue=790.79"));
+ assertTrue("Had:" + result, result.toString().contains("cellName='MortgageCalculator'!B4"));
assertFalse(result.toString().contains("#N/A"));
assertFalse(result.evaluationCompleteWithError());
@@ -220,10 +220,10 @@ public class TestExcelAntWorkbookUtil extends TestCase {
precision);
//System.out.println(result);
- assertTrue("Had:" + result.toString(), result.toString().contains("evaluationCompletedWithError=false"));
- assertTrue("Had:" + result.toString(), result.toString().contains("returnValue=790.79"));
- assertTrue("Had:" + result.toString(), result.toString().contains("cellName='MortgageCalculator'!B4"));
- assertFalse("Should not see an error, but had:" + result.toString(), result.toString().contains("#"));
+ assertTrue("Had:" + result, result.toString().contains("evaluationCompletedWithError=false"));
+ assertTrue("Had:" + result, result.toString().contains("returnValue=790.79"));
+ assertTrue("Had:" + result, result.toString().contains("cellName='MortgageCalculator'!B4"));
+ assertFalse("Should not see an error, but had:" + result, result.toString().contains("#"));
assertFalse(result.evaluationCompleteWithError());
assertFalse(result.didTestPass());
@@ -242,10 +242,10 @@ public class TestExcelAntWorkbookUtil extends TestCase {
precision);
System.out.println(result);
- assertTrue("Had:" + result.toString(), result.toString().contains("evaluationCompletedWithError=true"));
- assertTrue("Had:" + result.toString(), result.toString().contains("returnValue=0.0"));
- assertTrue("Had:" + result.toString(), result.toString().contains("cellName='ErrorCell'!A1"));
- assertTrue("Had:" + result.toString(), result.toString().contains("#N/A"));
+ assertTrue("Had:" + result, result.toString().contains("evaluationCompletedWithError=true"));
+ assertTrue("Had:" + result, result.toString().contains("returnValue=0.0"));
+ assertTrue("Had:" + result, result.toString().contains("cellName='ErrorCell'!A1"));
+ assertTrue("Had:" + result, result.toString().contains("#N/A"));
assertTrue(result.evaluationCompleteWithError());
assertFalse(result.didTestPass());
diff --git a/src/integrationtest/org/apache/poi/stress/HMEFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HMEFFileHandler.java
index 9f492bf0ed..30e98af59a 100644
--- a/src/integrationtest/org/apache/poi/stress/HMEFFileHandler.java
+++ b/src/integrationtest/org/apache/poi/stress/HMEFFileHandler.java
@@ -40,10 +40,10 @@ public class HMEFFileHandler extends AbstractFileHandler {
// there are two test-files that have no body...
if(!msg.getSubject().equals("Testing TNEF Message") && !msg.getSubject().equals("TNEF test message with attachments")) {
- assertNotNull("Had: " + msg.getBody() + ", " + msg.getSubject() + ", " + msg.getAttachments() + ": " + props.toString(),
+ assertNotNull("Had: " + msg.getBody() + ", " + msg.getSubject() + ", " + msg.getAttachments() + ": " + props,
msg.getBody());
}
- assertNotNull("Had: " + msg.getBody() + ", " + msg.getSubject() + ", " + msg.getAttachments() + ": " + props.toString(),
+ assertNotNull("Had: " + msg.getBody() + ", " + msg.getSubject() + ", " + msg.getAttachments() + ": " + props,
msg.getSubject());
}
diff --git a/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java b/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java
index b765fa8381..d0563151ed 100644
--- a/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java
+++ b/src/java/org/apache/poi/ddf/AbstractEscherOptRecord.java
@@ -207,7 +207,7 @@ public abstract class AbstractEscherOptRecord extends EscherRecord
for ( EscherProperty property : properties )
{
- stringBuilder.append(" ").append(property.toString()).append(nl);
+ stringBuilder.append(" ").append(property).append(nl);
}
return stringBuilder.toString();
diff --git a/src/java/org/apache/poi/ddf/EscherArrayProperty.java b/src/java/org/apache/poi/ddf/EscherArrayProperty.java
index 21a6db1601..a60e2ad081 100644
--- a/src/java/org/apache/poi/ddf/EscherArrayProperty.java
+++ b/src/java/org/apache/poi/ddf/EscherArrayProperty.java
@@ -134,7 +134,7 @@ public final class EscherArrayProperty extends EscherComplexProperty implements
+ ", propName: " + EscherProperties.getPropertyName( getPropertyNumber() )
+ ", complex: " + isComplex()
+ ", blipId: " + isBlipId()
- + ", data: " + '\n' + results.toString();
+ + ", data: " + '\n' + results;
}
@Override
diff --git a/src/java/org/apache/poi/ddf/EscherContainerRecord.java b/src/java/org/apache/poi/ddf/EscherContainerRecord.java
index e570084b24..dece611bed 100644
--- a/src/java/org/apache/poi/ddf/EscherContainerRecord.java
+++ b/src/java/org/apache/poi/ddf/EscherContainerRecord.java
@@ -294,7 +294,7 @@ public final class EscherContainerRecord extends EscherRecord implements Iterabl
+ " instance: 0x" + HexDump.toHex( getInstance() ) + nl
+ " recordId: 0x" + HexDump.toHex( getRecordId() ) + nl
+ " numchildren: " + _childRecords.size() + nl
- + children.toString();
+ + children;
}
@Override
diff --git a/src/java/org/apache/poi/ddf/EscherDggRecord.java b/src/java/org/apache/poi/ddf/EscherDggRecord.java
index 5b1b8b744a..7464e5f456 100644
--- a/src/java/org/apache/poi/ddf/EscherDggRecord.java
+++ b/src/java/org/apache/poi/ddf/EscherDggRecord.java
@@ -145,7 +145,7 @@ public final class EscherDggRecord extends EscherRecord {
" NumIdClusters: " + getNumIdClusters() + '\n' +
" NumShapesSaved: " + field_3_numShapesSaved + '\n' +
" DrawingsSaved: " + field_4_drawingsSaved + '\n' +
- "" + field_5_string.toString();
+ "" + field_5_string;
}
diff --git a/src/java/org/apache/poi/ddf/EscherDump.java b/src/java/org/apache/poi/ddf/EscherDump.java
index 45905c936a..f35b061b3b 100644
--- a/src/java/org/apache/poi/ddf/EscherDump.java
+++ b/src/java/org/apache/poi/ddf/EscherDump.java
@@ -53,7 +53,7 @@ public final class EscherDump {
{
EscherRecord r = recordFactory.createRecord(data, pos);
int bytesRead = r.fillFields(data, pos, recordFactory );
- out.println( r.toString() );
+ out.println(r);
pos += bytesRead;
}
}
@@ -202,7 +202,7 @@ public final class EscherDump {
stringBuf.append( HexDump.toHex( recordBytesRemaining ) );
stringBuf.append( "] instance: " );
stringBuf.append( HexDump.toHex( ( (short) ( options >> 4 ) ) ) );
- out.println( stringBuf.toString() );
+ out.println(stringBuf);
stringBuf.setLength(0);
@@ -222,7 +222,7 @@ public final class EscherDump {
n8 = (byte) in.read();
stringBuf.append( HexDump.toHex( n8 ) );
stringBuf.append( getBlipType( n8 ) );
- out.println( stringBuf.toString() );
+ out.println(stringBuf);
out.println( " rgbUid:" );
HexDump.dump( in, out, 0, 16 );
diff --git a/src/java/org/apache/poi/ddf/UnknownEscherRecord.java b/src/java/org/apache/poi/ddf/UnknownEscherRecord.java
index 6f871528a6..aca4e19b14 100644
--- a/src/java/org/apache/poi/ddf/UnknownEscherRecord.java
+++ b/src/java/org/apache/poi/ddf/UnknownEscherRecord.java
@@ -136,7 +136,7 @@ public final class UnknownEscherRecord extends EscherRecord implements Cloneable
if (getChildRecords().size() > 0) {
children.append( " children: " + '\n' );
for (EscherRecord record : _childRecords) {
- children.append( record.toString() );
+ children.append(record);
children.append( '\n' );
}
}
@@ -150,7 +150,7 @@ public final class UnknownEscherRecord extends EscherRecord implements Cloneable
" recordId: 0x" + HexDump.toHex( getRecordId() ) + '\n' +
" numchildren: " + getChildRecords().size() + '\n' +
theDumpHex +
- children.toString();
+ children;
}
@Override
diff --git a/src/java/org/apache/poi/hpsf/Property.java b/src/java/org/apache/poi/hpsf/Property.java
index 8c81f0b2f8..1ae0e7430d 100644
--- a/src/java/org/apache/poi/hpsf/Property.java
+++ b/src/java/org/apache/poi/hpsf/Property.java
@@ -415,7 +415,7 @@ public class Property {
final Object value = getValue();
b.append(", value: ");
if (value instanceof String) {
- b.append(value.toString());
+ b.append(value);
final String s = (String) value;
final int l = s.length();
final byte[] bytes = new byte[l * 2];
@@ -439,7 +439,7 @@ public class Property {
b.append(hex);
}
} else {
- b.append(value.toString());
+ b.append(value);
}
b.append(']');
return b.toString();
diff --git a/src/java/org/apache/poi/hpsf/Section.java b/src/java/org/apache/poi/hpsf/Section.java
index 306e14a22f..830d94465b 100644
--- a/src/java/org/apache/poi/hpsf/Section.java
+++ b/src/java/org/apache/poi/hpsf/Section.java
@@ -982,7 +982,7 @@ public class Section {
b.append(getSize());
b.append(", properties: [\n");
for (int i = 0; i < pa.length; i++) {
- b.append(pa[i].toString());
+ b.append(pa[i]);
b.append(",\n");
}
b.append(']');
diff --git a/src/java/org/apache/poi/hpsf/VariantSupport.java b/src/java/org/apache/poi/hpsf/VariantSupport.java
index 1181437bcf..b098db504c 100644
--- a/src/java/org/apache/poi/hpsf/VariantSupport.java
+++ b/src/java/org/apache/poi/hpsf/VariantSupport.java
@@ -331,9 +331,9 @@ public class VariantSupport extends Variant {
case Variant.VT_I4:
if (!(value instanceof Integer)) {
throw new ClassCastException("Could not cast an object to "
- + Integer.class.toString() + ": "
- + value.getClass().toString() + ", "
- + value.toString());
+ + Integer.class + ": "
+ + value.getClass() + ", "
+ + value);
}
length += TypeWriter.writeToStream(out, ((Integer) value).intValue());
break;
diff --git a/src/java/org/apache/poi/hssf/dev/BiffViewer.java b/src/java/org/apache/poi/hssf/dev/BiffViewer.java
index d6b8777a32..9423b71906 100644
--- a/src/java/org/apache/poi/hssf/dev/BiffViewer.java
+++ b/src/java/org/apache/poi/hssf/dev/BiffViewer.java
@@ -256,7 +256,7 @@ public final class BiffViewer {
for (String header : recListener.getRecentHeaders()) {
ps.println(header);
}
- ps.print(record.toString());
+ ps.print(record);
} else {
recStream.readRemainder();
}
diff --git a/src/java/org/apache/poi/hssf/dev/EFBiffViewer.java b/src/java/org/apache/poi/hssf/dev/EFBiffViewer.java
index b136e4ca8a..3610d0f21b 100644
--- a/src/java/org/apache/poi/hssf/dev/EFBiffViewer.java
+++ b/src/java/org/apache/poi/hssf/dev/EFBiffViewer.java
@@ -53,7 +53,7 @@ public class EFBiffViewer
{
public void processRecord(Record rec)
{
- System.out.println(rec.toString());
+ System.out.println(rec);
}
});
HSSFEventFactory factory = new HSSFEventFactory();
diff --git a/src/java/org/apache/poi/hssf/dev/FormulaViewer.java b/src/java/org/apache/poi/hssf/dev/FormulaViewer.java
index 3426d4a09c..4bf221f4de 100644
--- a/src/java/org/apache/poi/hssf/dev/FormulaViewer.java
+++ b/src/java/org/apache/poi/hssf/dev/FormulaViewer.java
@@ -132,7 +132,7 @@ public class FormulaViewer
}
buf.append(sep);
buf.append(numArg);
- System.out.println(buf.toString());
+ System.out.println(buf);
}
/**
diff --git a/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
index c4eb047312..0e7e31ac47 100644
--- a/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
+++ b/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
@@ -342,7 +342,7 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p
case STRING:
HSSFRichTextString str = cell.getRichStringCellValue();
if(str != null && str.length() > 0) {
- text.append(str.toString());
+ text.append(str);
}
break;
case NUMERIC:
diff --git a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java
index 1005b38f62..65ed15d709 100644
--- a/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java
+++ b/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java
@@ -91,7 +91,7 @@ public abstract class AbstractEscherHolderRecord extends Record implements Clone
if (escherRecords.size() == 0)
buffer.append("No Escher Records Decoded" + nl);
for (EscherRecord r : escherRecords) {
- buffer.append(r.toString());
+ buffer.append(r);
}
buffer.append("[/" + getRecordName() + ']' + nl);
diff --git a/src/java/org/apache/poi/hssf/record/ArrayRecord.java b/src/java/org/apache/poi/hssf/record/ArrayRecord.java
index 0ff4eb04c4..f1f78a2eff 100644
--- a/src/java/org/apache/poi/hssf/record/ArrayRecord.java
+++ b/src/java/org/apache/poi/hssf/record/ArrayRecord.java
@@ -81,14 +81,14 @@ public final class ArrayRecord extends SharedValueRecordBase implements Cloneabl
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(getClass().getName()).append(" [ARRAY]\n");
- sb.append(" range=").append(getRange().toString()).append("\n");
+ sb.append(" range=").append(getRange()).append("\n");
sb.append(" options=").append(HexDump.shortToHex(_options)).append("\n");
sb.append(" notUsed=").append(HexDump.intToHex(_field3notUsed)).append("\n");
sb.append(" formula:").append("\n");
Ptg[] ptgs = _formula.getTokens();
for (int i = 0; i < ptgs.length; i++) {
Ptg ptg = ptgs[i];
- sb.append(ptg.toString()).append(ptg.getRVAType()).append("\n");
+ sb.append(ptg).append(ptg.getRVAType()).append("\n");
}
sb.append("]");
return sb.toString();
diff --git a/src/java/org/apache/poi/hssf/record/CFHeaderBase.java b/src/java/org/apache/poi/hssf/record/CFHeaderBase.java
index 3784638657..8ef254c710 100644
--- a/src/java/org/apache/poi/hssf/record/CFHeaderBase.java
+++ b/src/java/org/apache/poi/hssf/record/CFHeaderBase.java
@@ -130,7 +130,7 @@ public abstract class CFHeaderBase extends StandardRecord implements Cloneable {
buffer.append("\t.enclosingCellRange= ").append(getEnclosingCellRange()).append("\n");
buffer.append("\t.cfranges=[");
for( int i=0; i {
if (field_4_format_runs != null) {
for (int i = 0; i < field_4_format_runs.size();i++) {
FormatRun r = field_4_format_runs.get(i);
- buffer.append(" .format_run"+i+" = ").append(r.toString()).append("\n");
+ buffer.append(" .format_run"+i+" = ").append(r).append("\n");
}
}
if (field_5_ext_rst != null) {
buffer.append(" .field_5_ext_rst = ").append("\n");
- buffer.append( field_5_ext_rst.toString() ).append("\n");
+ buffer.append(field_5_ext_rst).append("\n");
}
buffer.append("[/UNICODESTRING]\n");
return buffer.toString();
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
index 4e5f280951..29816093a3 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
@@ -1980,7 +1980,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet {
List escherRecords = r.getEscherRecords();
for (EscherRecord escherRecord : escherRecords) {
if (fat) {
- pw.println(escherRecord.toString());
+ pw.println(escherRecord);
} else {
escherRecord.display(pw, 0);
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
index 9acd3e4682..4cfe3b9fe8 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
@@ -1892,7 +1892,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out, Charset.defaultCharset()));
for (EscherRecord escherRecord : escherRecords) {
if (fat) {
- System.out.println(escherRecord.toString());
+ System.out.println(escherRecord);
} else {
escherRecord.display(w, 0);
}
diff --git a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java
index fe852cbb8a..ba60cb2fe4 100644
--- a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java
+++ b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java
@@ -181,7 +181,7 @@ public abstract class ChunkedCipherInputStream extends LittleEndianInputStream {
long skipN = (index - lastIndex) << chunkBits;
if (super.skip(skipN) < skipN) {
throw new EOFException("buffer underrun");
- };
+ }
}
lastIndex = index + 1;
diff --git a/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java b/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java
index 771a6895be..b46055b967 100644
--- a/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java
+++ b/src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionInfoBuilder.java
@@ -82,7 +82,7 @@ public class StandardEncryptionInfoBuilder implements EncryptionInfoBuilder {
found |= (ks == keyBits);
}
if (!found) {
- throw new EncryptedDocumentException("KeySize "+keyBits+" not allowed for Cipher "+cipherAlgorithm.toString());
+ throw new EncryptedDocumentException("KeySize "+keyBits+" not allowed for Cipher "+ cipherAlgorithm);
}
info.setHeader(new StandardEncryptionHeader(cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode));
info.setVerifier(new StandardEncryptionVerifier(cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode));
diff --git a/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java b/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java
index b890e02176..52df33b72c 100644
--- a/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java
+++ b/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java
@@ -82,7 +82,7 @@ public class CellGeneralFormatter extends CellFormatter {
} else if (value instanceof Boolean) {
toAppendTo.append(value.toString().toUpperCase(Locale.ROOT));
} else {
- toAppendTo.append(value.toString());
+ toAppendTo.append(value);
}
}
diff --git a/src/java/org/apache/poi/ss/formula/FormulaRenderer.java b/src/java/org/apache/poi/ss/formula/FormulaRenderer.java
index 78eb16ddbb..1d1c7313ca 100644
--- a/src/java/org/apache/poi/ss/formula/FormulaRenderer.java
+++ b/src/java/org/apache/poi/ss/formula/FormulaRenderer.java
@@ -83,7 +83,7 @@ public class FormulaRenderer {
stack.push(attrPtg.toFormulaString(operands));
continue;
}
- throw new RuntimeException("Unexpected tAttr: " + attrPtg.toString());
+ throw new RuntimeException("Unexpected tAttr: " + attrPtg);
}
if (ptg instanceof WorkbookDependentFormula) {
diff --git a/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java b/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
index 367dee5396..cda98828e0 100644
--- a/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
+++ b/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
@@ -336,7 +336,7 @@ public final class WorkbookEvaluator {
if (isDebugLogEnabled()) {
String sheetName = getSheetName(sheetIndex);
CellReference cr = new CellReference(rowIndex, columnIndex);
- logDebug("Evaluated " + sheetName + "!" + cr.formatAsString() + " to " + result.toString());
+ logDebug("Evaluated " + sheetName + "!" + cr.formatAsString() + " to " + result);
}
// Usually (result === cce.getValue())
// But sometimes: (result==ErrorEval.CIRCULAR_REF_ERROR, cce.getValue()==null)
diff --git a/src/java/org/apache/poi/ss/usermodel/SheetVisibility.java b/src/java/org/apache/poi/ss/usermodel/SheetVisibility.java
index 68123dd9f7..8f8ab9138a 100644
--- a/src/java/org/apache/poi/ss/usermodel/SheetVisibility.java
+++ b/src/java/org/apache/poi/ss/usermodel/SheetVisibility.java
@@ -42,5 +42,5 @@ public enum SheetVisibility {
* ThisWorkbook.Sheets("MySheetName").Visible = xlSheetVeryHidden
*
*/
- VERY_HIDDEN;
+ VERY_HIDDEN
}
diff --git a/src/ooxml/java/org/apache/poi/dev/OOXMLLister.java b/src/ooxml/java/org/apache/poi/dev/OOXMLLister.java
index b82d92136e..cbbca45cf9 100644
--- a/src/ooxml/java/org/apache/poi/dev/OOXMLLister.java
+++ b/src/ooxml/java/org/apache/poi/dev/OOXMLLister.java
@@ -132,7 +132,7 @@ public class OOXMLLister implements Closeable {
File f = new File(args[0]);
if(! f.exists()) {
System.err.println("Error, file not found!");
- System.err.println("\t" + f.toString());
+ System.err.println("\t" + f);
System.exit(2);
}
@@ -141,7 +141,7 @@ public class OOXMLLister implements Closeable {
);
try {
- lister.disp.println(f.toString() + "\n");
+ lister.disp.println(f + "\n");
lister.displayParts();
lister.disp.println();
lister.displayRelations();
diff --git a/src/ooxml/java/org/apache/poi/dev/OOXMLPrettyPrint.java b/src/ooxml/java/org/apache/poi/dev/OOXMLPrettyPrint.java
index 7d80b7ac28..36a7667785 100644
--- a/src/ooxml/java/org/apache/poi/dev/OOXMLPrettyPrint.java
+++ b/src/ooxml/java/org/apache/poi/dev/OOXMLPrettyPrint.java
@@ -74,7 +74,7 @@ public class OOXMLPrettyPrint {
File f = new File(args[i]);
if(! f.exists()) {
System.err.println("Error, file not found!");
- System.err.println("\t" + f.toString());
+ System.err.println("\t" + f);
System.exit(2);
}
diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationship.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationship.java
index 90ee15e298..174f2f901b 100644
--- a/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationship.java
+++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationship.java
@@ -213,7 +213,7 @@ public final class PackageRelationship {
StringBuilder sb = new StringBuilder();
sb.append(id == null ? "id=null" : "id=" + id);
sb.append(container == null ? " - container=null" : " - container="
- + container.toString());
+ + container);
sb.append(relationshipType == null ? " - relationshipType=null"
: " - relationshipType=" + relationshipType);
sb.append(source == null ? " - source=null" : " - source="
@@ -221,7 +221,7 @@ public final class PackageRelationship {
sb.append(targetUri == null ? " - target=null" : " - target="
+ getTargetURI().toASCIIString());
sb.append(targetMode == null ? ",targetMode=null" : ",targetMode="
- + targetMode.toString());
+ + targetMode);
return sb.toString();
}
}
diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java
index 6fb7f65be8..c315be51bf 100644
--- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java
+++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java
@@ -617,7 +617,7 @@ public final class PackagePropertiesPart extends PackagePart implements
sb.append(", ").append(fStr);
}
throw new InvalidFormatException("Date " + dateStr + " not well formatted, "
- + "expected format in: "+sb.toString());
+ + "expected format in: "+ sb);
}
/**
diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
index 9e8d7c05c3..9b8c56ad83 100644
--- a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
+++ b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
@@ -65,7 +65,7 @@ public class AgileEncryptionHeader extends EncryptionHeader implements Cloneable
setChainingMode(ChainingMode.cfb);
break;
default:
- throw new EncryptedDocumentException("Unsupported chaining mode - "+keyData.getCipherChaining().toString());
+ throw new EncryptedDocumentException("Unsupported chaining mode - "+ keyData.getCipherChaining());
}
int hashSize = keyData.getHashSize();
diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java
index 15ec609b4a..042aad366a 100644
--- a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java
+++ b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionInfoBuilder.java
@@ -79,7 +79,7 @@ public class AgileEncryptionInfoBuilder implements EncryptionInfoBuilder {
found |= (ks == keyBits);
}
if (!found) {
- throw new EncryptedDocumentException("KeySize "+keyBits+" not allowed for Cipher "+cipherAlgorithm.toString());
+ throw new EncryptedDocumentException("KeySize "+keyBits+" not allowed for Cipher "+ cipherAlgorithm);
}
info.setHeader(new AgileEncryptionHeader(cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode));
info.setVerifier(new AgileEncryptionVerifier(cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode));
diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java
index 186b27da50..c10dd510e2 100644
--- a/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java
+++ b/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java
@@ -105,7 +105,7 @@ public class AgileEncryptionVerifier extends EncryptionVerifier implements Clone
setChainingMode(ChainingMode.cfb);
break;
default:
- throw new EncryptedDocumentException("Unsupported chaining mode - "+keyData.getCipherChaining().toString());
+ throw new EncryptedDocumentException("Unsupported chaining mode - "+ keyData.getCipherChaining());
}
if (!encList.hasNext()) {
diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java
index e7d17b0b1a..11a11eeae2 100644
--- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java
+++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java
@@ -349,14 +349,14 @@ public class XAdESXLSignatureFacet extends SignatureFacet {
// create a XAdES time-stamp container
XAdESTimeStampType xadesTimeStamp = XAdESTimeStampType.Factory.newInstance();
- xadesTimeStamp.setId("time-stamp-" + UUID.randomUUID().toString());
+ xadesTimeStamp.setId("time-stamp-" + UUID.randomUUID());
CanonicalizationMethodType c14nMethod = xadesTimeStamp.addNewCanonicalizationMethod();
c14nMethod.setAlgorithm(signatureConfig.getXadesCanonicalizationMethod());
// embed the time-stamp
EncapsulatedPKIDataType encapsulatedTimeStamp = xadesTimeStamp.addNewEncapsulatedTimeStamp();
encapsulatedTimeStamp.setByteArrayValue(timeStampToken);
- encapsulatedTimeStamp.setId("time-stamp-token-" + UUID.randomUUID().toString());
+ encapsulatedTimeStamp.setId("time-stamp-token-" + UUID.randomUUID());
return xadesTimeStamp;
}
diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java b/src/ooxml/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java
index e9c47b418f..3c748a8f63 100644
--- a/src/ooxml/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java
+++ b/src/ooxml/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java
@@ -89,7 +89,7 @@ public class AesZipFileZipEntrySource implements ZipEntrySource {
zipFile.close();
if (!tmpFile.delete()) {
LOG.log(POILogger.WARN, tmpFile.getAbsolutePath()+" can't be removed (or was already removed.");
- };
+ }
}
closed = true;
}
diff --git a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
index d537a9d3a6..398966a969 100644
--- a/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
+++ b/src/ooxml/java/org/apache/poi/util/OOXMLLite.java
@@ -291,7 +291,6 @@ public final class OOXMLLite {
if (!(destDirectory.exists() || destDirectory.mkdirs())) {
throw new RuntimeException("Can't create destination directory: "+destDirectory);
}
- ;
OutputStream destStream = new FileOutputStream(destFile);
try {
IOUtils.copy(srcStream, destStream);
diff --git a/src/ooxml/java/org/apache/poi/xdgf/exceptions/XDGFException.java b/src/ooxml/java/org/apache/poi/xdgf/exceptions/XDGFException.java
index 379877e0d4..696af1dbed 100644
--- a/src/ooxml/java/org/apache/poi/xdgf/exceptions/XDGFException.java
+++ b/src/ooxml/java/org/apache/poi/xdgf/exceptions/XDGFException.java
@@ -26,11 +26,11 @@ public class XDGFException {
* Creates an error message to be thrown
*/
public static POIXMLException error(String message, Object o) {
- return new POIXMLException(o.toString() + ": " + message);
+ return new POIXMLException(o + ": " + message);
}
public static POIXMLException error(String message, Object o, Throwable t) {
- return new POIXMLException(o.toString() + ": " + message, t);
+ return new POIXMLException(o + ": " + message, t);
}
//
@@ -41,7 +41,6 @@ public class XDGFException {
public static POIXMLException wrap(POIXMLDocumentPart part,
POIXMLException e) {
return new POIXMLException(part.getPackagePart().getPartName()
- .toString()
+ ": " + e.getMessage(), e.getCause() == null ? e
: e.getCause());
}
diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java
index 2d65621f19..3192230754 100644
--- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java
+++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFBaseContents.java
@@ -84,10 +84,10 @@ public class XDGFBaseContents extends XDGFXMLDocumentPart {
XDGFShape to = _shapes.get(connect.getToSheet());
if (from == null)
- throw new POIXMLException(this.toString() + "; Connect; Invalid from id: " + connect.getFromSheet());
+ throw new POIXMLException(this + "; Connect; Invalid from id: " + connect.getFromSheet());
if (to == null)
- throw new POIXMLException(this.toString() + "; Connect; Invalid to id: " + connect.getToSheet());
+ throw new POIXMLException(this + "; Connect; Invalid to id: " + connect.getToSheet());
_connections.add(new XDGFConnection(connect, from, to));
}
diff --git a/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java b/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java
index eb9aa9796d..92fbcb0d2c 100644
--- a/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java
+++ b/src/ooxml/java/org/apache/poi/xdgf/util/HierarchyPrinter.java
@@ -62,7 +62,7 @@ public class HierarchyPrinter {
os.append(" ");
}
// TODO: write text?
- os.println(shape.toString() + " [" + shape.getShapeType()
+ os.println(shape + " [" + shape.getShapeType()
+ ", " + shape.getSymbolName() + "] "
+ shape.getMasterShape() + " "
+ shape.getTextAsString().trim());
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 a15d90cc4d..09d0f20dd1 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().toString()+" is an unknown properties type");
+ LOG.log(POILogger.ERROR, props.getClass() +" is an unknown properties type");
return null;
}
@@ -1856,7 +1856,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundProperti
return (T)obj;
}
- LOG.log(POILogger.WARN, obj.getClass().toString()+" doesn't implement "+clazz.toString());
+ LOG.log(POILogger.WARN, obj.getClass() +" doesn't implement "+ clazz);
return null;
}
}
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java
index 19eba48edd..751bd9b92f 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java
@@ -142,7 +142,7 @@ public abstract class XSLFSimpleShape extends XSLFShape
return ((CTShapeProperties)xo).addNewXfrm();
} else {
// ... group shapes have their own getXfrm()
- LOG.log(POILogger.WARN, getClass().toString()+" doesn't have xfrm element.");
+ LOG.log(POILogger.WARN, getClass() +" doesn't have xfrm element.");
return null;
}
}
@@ -1132,7 +1132,7 @@ public abstract class XSLFSimpleShape extends XSLFShape
private static CTLineProperties getLn(XSLFShape shape, boolean create) {
XmlObject pr = shape.getShapeProperties();
if (!(pr instanceof CTShapeProperties)) {
- LOG.log(POILogger.WARN, shape.getClass().toString()+" doesn't have line properties");
+ LOG.log(POILogger.WARN, shape.getClass() +" doesn't have line properties");
return null;
}
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java
index dcd9642617..625b26aa80 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java
@@ -139,7 +139,7 @@ implements Slide {
}
}
if(_layout == null) {
- throw new IllegalArgumentException("SlideLayout was not found for " + this.toString());
+ throw new IllegalArgumentException("SlideLayout was not found for " + this);
}
return _layout;
}
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java
index b4e53f4feb..b06dcf42bf 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java
@@ -86,7 +86,7 @@ implements MasterSheet {
}
}
if (_master == null) {
- throw new IllegalStateException("SlideMaster was not found for " + this.toString());
+ throw new IllegalStateException("SlideMaster was not found for " + this);
}
return _master;
}
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyle.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyle.java
index b821910eaf..6d4372c21a 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyle.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyle.java
@@ -29,7 +29,7 @@ public class XSLFTableStyle {
private CTTableStyle _tblStyle;
public enum TablePartStyle {
- wholeTbl, band1H, band2H, band1V, band2V, firstCol, lastCol, firstRow, lastRow, seCell, swCell, neCell, nwCell;
+ wholeTbl, band1H, band2H, band1V, band2V, firstCol, lastCol, firstRow, lastRow, seCell, swCell, neCell, nwCell
}
/*package*/ XSLFTableStyle(CTTableStyle style){
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 49278d639c..b37c71ab7d 100644
--- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java
+++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java
@@ -316,7 +316,7 @@ public class XSSFSheetXMLHandler extends DefaultHandler {
break;
case ERROR:
- thisStr = "ERROR:" + value.toString();
+ thisStr = "ERROR:" + value;
break;
case FORMULA:
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 3e734d481b..cec86e9669 100644
--- a/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
+++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
@@ -274,7 +274,7 @@ public class SheetDataWriter {
XSSFRichTextString rt = new XSSFRichTextString(cell.getStringCellValue());
int sRef = _sharedStringSource.addEntry(rt.getCTRst());
- _out.write(" t=\"" + STCellType.S.toString() + "\">");
+ _out.write(" t=\"" + STCellType.S + "\">");
_out.write("");
_out.write(String.valueOf(sRef));
_out.write("");
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java
index df47fc227b..0f2c1a186d 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java
@@ -184,7 +184,7 @@ public final class XSSFClientAnchor extends XSSFAnchor implements ClientAnchor {
@Override
public String toString(){
- return "from : " + cell1.toString() + "; to: " + cell2.toString();
+ return "from : " + cell1 + "; to: " + cell2;
}
/**
diff --git a/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java b/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java
index 712e04b736..070f0c18a0 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java
@@ -130,7 +130,7 @@ public class XWPFWordExtractor extends POIXMLTextExtractor {
for (IRunElement run : paragraph.getRuns()) {
- text.append(run.toString());
+ text.append(run);
if (run instanceof XWPFHyperlinkRun && fetchHyperlinks) {
XWPFHyperlink link = ((XWPFHyperlinkRun) run).getHyperlink(document);
if (link != null)
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
index 0fbc65ec00..532a149671 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
@@ -190,12 +190,12 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
XWPFRun xRun = (XWPFRun) run;
// don't include the text if reviewing is enabled and this is a deleted run
if (!xRun.getCTR().isSetRsidDel()) {
- out.append(xRun.toString());
+ out.append(xRun);
}
} else if (run instanceof XWPFSDT) {
out.append(((XWPFSDT) run).getContent().getText());
} else {
- out.append(run.toString());
+ out.append(run);
}
}
out.append(footnoteText);
@@ -400,7 +400,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
public String getParagraphText() {
StringBuffer out = new StringBuffer();
for (XWPFRun run : runs) {
- out.append(run.toString());
+ out.append(run);
}
return out.toString();
}
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java
index 545ef434ff..4aab794995 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSDTContent.java
@@ -95,7 +95,7 @@ public class XWPFSDTContent implements ISDTContent {
text.append(((XWPFSDT) o).getContent().getText());
addNewLine = true;
} else if (o instanceof XWPFRun) {
- text.append(((XWPFRun) o).toString());
+ text.append(((XWPFRun) o));
addNewLine = false;
}
if (addNewLine == true && i < bodyElements.size() - 1) {
@@ -126,7 +126,7 @@ public class XWPFSDTContent implements ISDTContent {
private void appendParagraph(XWPFParagraph paragraph, StringBuilder text) {
for (IRunElement run : paragraph.getRuns()) {
- text.append(run.toString());
+ text.append(run);
}
}
diff --git a/src/ooxml/testcases/org/apache/poi/ss/formula/functions/TestProper.java b/src/ooxml/testcases/org/apache/poi/ss/formula/functions/TestProper.java
index 921dc445eb..65f7585c40 100644
--- a/src/ooxml/testcases/org/apache/poi/ss/formula/functions/TestProper.java
+++ b/src/ooxml/testcases/org/apache/poi/ss/formula/functions/TestProper.java
@@ -88,7 +88,7 @@ public final class TestProper {
builder.append((char)(65 + (i % 26)));
expected.append((char)(97 + (i % 26)));
}
- confirm("PROPER(\"" + builder.toString() + "\")", expected.toString());
+ confirm("PROPER(\"" + builder + "\")", expected.toString());
}
private void confirm(String formulaText, String expectedResult) {
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
index 0892d10176..03e6d30d2d 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
@@ -387,7 +387,7 @@ public final class TestUnfixedBugs {
Iterator it = shapes.iterator();
while(it.hasNext()) {
XSSFShape shape = it.next();
- str.append(", " + shape.toString());
+ str.append(", " + shape);
str.append(", Col1:"+((XSSFClientAnchor)shape.getAnchor()).getCol1());
str.append(", Col2:"+((XSSFClientAnchor)shape.getAnchor()).getCol2());
str.append(", Row1:"+((XSSFClientAnchor)shape.getAnchor()).getRow1());
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java
index 1d3f97ff8f..9811c403bd 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColGrouping.java
@@ -66,7 +66,7 @@ public class TestXSSFColGrouping {
CTCols cols = sheet.getCTWorksheet().getColsArray(0);
logger.log(POILogger.DEBUG, "test52186/cols:" + cols);
for (CTCol col : cols.getColArray()) {
- assertTrue("Col width attribute is unset: " + col.toString(), col.isSetWidth());
+ assertTrue("Col width attribute is unset: " + col, col.isSetWidth());
}
wb2.close();
@@ -100,7 +100,7 @@ public class TestXSSFColGrouping {
}
cols = sheet.getCTWorksheet().getColsArray(0);
for (CTCol col : cols.getColArray()) {
- assertTrue("Col width attribute is unset: " + col.toString(), col.isSetWidth());
+ assertTrue("Col width attribute is unset: " + col, col.isSetWidth());
}
wb2.close();
wb1.close();
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java
index 88677c3476..b9aa8c28c1 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java
@@ -491,7 +491,7 @@ public final class TestXSSFFormulaParser {
evaluator.evaluateFormulaCellEnum(cell);
} catch (Exception e) {
CellReference cellRef = new CellReference(cell.getRowIndex(), cell.getColumnIndex());
- throw new RuntimeException("error at: " + cellRef.toString(), e);
+ throw new RuntimeException("error at: " + cellRef, e);
}
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java
index 84161f8482..90e4ffed5a 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIAttribute.java
@@ -75,7 +75,7 @@ public class MAPIAttribute {
hex = hex.substring(0, hex.length()-1) + ", ....]";
}
- return property.toString() + " " + hex;
+ return property + " " + hex;
}
/**
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIDateAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIDateAttribute.java
index 0669723de5..3f1827b116 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIDateAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIDateAttribute.java
@@ -66,7 +66,7 @@ public final class MAPIDateAttribute extends MAPIAttribute {
DateFormatSymbols dfs = DateFormatSymbols.getInstance(Locale.ROOT);
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", dfs);
df.setTimeZone(LocaleUtil.TIMEZONE_UTC);
- return getProperty().toString() + " " + df.format(data);
+ return getProperty() + " " + df.format(data);
}
/**
@@ -80,7 +80,7 @@ public final class MAPIDateAttribute extends MAPIAttribute {
return ((MAPIDateAttribute)attr).getDate();
}
- logger.log(POILogger.WARN, "Warning, non date property found: " + attr.toString());
+ logger.log(POILogger.WARN, "Warning, non date property found: " + attr);
return null;
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIRtfAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIRtfAttribute.java
index cd773838ca..dfe4c2adc3 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIRtfAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIRtfAttribute.java
@@ -73,6 +73,6 @@ public final class MAPIRtfAttribute extends MAPIAttribute {
}
public String toString() {
- return getProperty().toString() + " " + data;
+ return getProperty() + " " + data;
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIStringAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIStringAttribute.java
index ef4e16b6e7..229eb8868a 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIStringAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIStringAttribute.java
@@ -60,7 +60,7 @@ public final class MAPIStringAttribute extends MAPIAttribute {
}
public String toString() {
- return getProperty().toString() + " " + data;
+ return getProperty() + " " + data;
}
/**
@@ -77,7 +77,7 @@ public final class MAPIStringAttribute extends MAPIAttribute {
return ((MAPIRtfAttribute)attr).getDataString();
}
- logger.log(POILogger.WARN, "Warning, non string property found: " + attr.toString());
+ logger.log(POILogger.WARN, "Warning, non string property found: " + attr);
return null;
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFAttribute.java
index af0ac3dcba..8e386ca994 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFAttribute.java
@@ -89,7 +89,7 @@ public class TNEFAttribute {
}
public String toString() {
- return "Attribute " + property.toString() + ", type=" + type +
+ return "Attribute " + property + ", type=" + type +
", data length=" + data.length;
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFDateAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFDateAttribute.java
index faedc4c7cc..40c16cd46e 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFDateAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFDateAttribute.java
@@ -80,7 +80,7 @@ public final class TNEFDateAttribute extends TNEFAttribute {
DateFormatSymbols dfs = DateFormatSymbols.getInstance(Locale.ROOT);
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", dfs);
df.setTimeZone(LocaleUtil.TIMEZONE_UTC);
- return "Attribute " + getProperty().toString() + ", type=" + getType() +
+ return "Attribute " + getProperty() + ", type=" + getType() +
", date=" + df.format(data);
}
@@ -95,7 +95,7 @@ public final class TNEFDateAttribute extends TNEFAttribute {
return ((TNEFDateAttribute)attr).getDate();
}
- logger.log(POILogger.WARN, "Warning, non date property found: " + attr.toString());
+ logger.log(POILogger.WARN, "Warning, non date property found: " + attr);
return null;
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFMAPIAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFMAPIAttribute.java
index 3144981fee..9bf6d4073f 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFMAPIAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFMAPIAttribute.java
@@ -46,7 +46,7 @@ public final class TNEFMAPIAttribute extends TNEFAttribute {
}
public String toString() {
- return "Attribute " + getProperty().toString() + ", type=" + getType() +
+ return "Attribute " + getProperty() + ", type=" + getType() +
", " + attributes.size() + " MAPI Attributes";
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFStringAttribute.java b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFStringAttribute.java
index a63b0d12b6..23b2a0a6e1 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFStringAttribute.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFStringAttribute.java
@@ -63,7 +63,7 @@ public final class TNEFStringAttribute extends TNEFAttribute {
}
public String toString() {
- return "Attribute " + getProperty().toString() + ", type=" + getType() +
+ return "Attribute " + getProperty() + ", type=" + getType() +
", data=" + getString();
}
@@ -78,7 +78,7 @@ public final class TNEFStringAttribute extends TNEFAttribute {
return ((TNEFStringAttribute)attr).getString();
}
- logger.log(POILogger.WARN, "Warning, non string property found: " + attr.toString());
+ logger.log(POILogger.WARN, "Warning, non string property found: " + attr);
return null;
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hmef/dev/HMEFDumper.java b/src/scratchpad/src/org/apache/poi/hmef/dev/HMEFDumper.java
index 2e64a9ab25..fd79b290cd 100644
--- a/src/scratchpad/src/org/apache/poi/hmef/dev/HMEFDumper.java
+++ b/src/scratchpad/src/org/apache/poi/hmef/dev/HMEFDumper.java
@@ -108,7 +108,7 @@ public final class HMEFDumper {
// Print the attribute into
System.out.println(
"Level " + level + " : Type " + attr.getType() +
- " : ID " + attr.getProperty().toString()
+ " : ID " + attr.getProperty()
);
// Print the contents
diff --git a/src/scratchpad/src/org/apache/poi/hpbf/dev/HPBFDumper.java b/src/scratchpad/src/org/apache/poi/hpbf/dev/HPBFDumper.java
index 48ad50973f..bb792394df 100644
--- a/src/scratchpad/src/org/apache/poi/hpbf/dev/HPBFDumper.java
+++ b/src/scratchpad/src/org/apache/poi/hpbf/dev/HPBFDumper.java
@@ -119,7 +119,7 @@ public final class HPBFDumper {
er.fillFields(data, 0, erf);
left -= er.getRecordSize();
- System.out.println(er.toString());
+ System.out.println(er);
}
}
protected void dumpEscherStm(DirectoryNode escherDir) throws IOException {
diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/PPTXMLDump.java b/src/scratchpad/src/org/apache/poi/hslf/dev/PPTXMLDump.java
index a9fec1bdb1..866d7c95ca 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/dev/PPTXMLDump.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/dev/PPTXMLDump.java
@@ -214,7 +214,7 @@ public final class PPTXMLDump {
} else {
StringWriter out = new StringWriter();
dump.dump(out);
- System.out.println(out.toString());
+ System.out.println(out);
}
}
diff --git a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java
index cb3fe817fa..cf7343a42f 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java
@@ -173,7 +173,7 @@ public final class SlideShowRecordDumper {
printEscherTextBox( (EscherTextboxRecord)er, indent );
} else {
ps.print( tabs.substring(0, indent) );
- ps.println( er.toString() );
+ ps.println(er);
}
}
@@ -199,7 +199,7 @@ public final class SlideShowRecordDumper {
StyleTextPropAtom tsp = (StyleTextPropAtom)child;
tsp.setParentTextSize(text.length());
}
- ps.println(ind+child.toString());
+ ps.println(ind+ child);
prevChild = child;
}
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java
index 9d39d3e9db..9fa73ac5dc 100644
--- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java
+++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java
@@ -946,7 +946,7 @@ public final class HSLFTextParagraph implements TextParagraph iterator = escherRecords.iterator();
while (iterator.hasNext()) {
EscherRecord r = iterator.next();
- buffer.append(r.toString());
+ buffer.append(r);
}
return buffer.toString();
}
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java
index c192b3ef5c..37c12c465e 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FSPATable.java
@@ -97,12 +97,12 @@ public final class FSPATable
.entrySet() )
{
Integer i = entry.getKey();
- buf.append( " " ).append( i.toString() ).append( " => \t" );
+ buf.append( " " ).append(i).append( " => \t" );
try
{
FSPA fspa = getFspaFromCp( i.intValue() );
- buf.append( fspa.toString() );
+ buf.append(fspa);
}
catch ( Exception exc )
{
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java
index 732879add0..9e464f7bb1 100644
--- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java
+++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java
@@ -289,7 +289,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings
@Override
public String toString()
{
- return "OfficeDrawingImpl: " + fspa.toString();
+ return "OfficeDrawingImpl: " + fspa;
}
};
}
diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java b/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java
index ddf7780166..7f8b4d3ed7 100644
--- a/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java
+++ b/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java
@@ -83,7 +83,7 @@ public class TestFieldsTables extends HWPFTestCase {
private String dumpPlexes(ArrayList fieldsPlexes) {
StringBuilder dump = new StringBuilder();
for (PlexOfField flds : fieldsPlexes) {
- dump.append(flds.toString() + "\n");
+ dump.append(flds + "\n");
}
return dump.toString();
}
diff --git a/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java b/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java
index a0db23085a..51556b6bc5 100644
--- a/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java
+++ b/src/testcases/org/apache/poi/hpsf/basic/AllDataFilesTester.java
@@ -64,7 +64,7 @@ public class AllDataFilesTester {
}});
for (final File doc : docs) {
final Logger logger = Logger.getLogger(getClass().getName());
- logger.info("Processing file \" " + doc.toString() + "\".");
+ logger.info("Processing file \" " + doc + "\".");
/* Execute the test task. */
task.runTest(doc);
diff --git a/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java b/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java
index 467186c294..a0b0b8a9ae 100644
--- a/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java
+++ b/src/testcases/org/apache/poi/hssf/model/TestOperandClassTransformer.java
@@ -126,7 +126,7 @@ public final class TestOperandClassTransformer extends TestCase {
}
if (operandClass != ptg.getPtgClass()) {
throw new AssertionFailedError("Wrong operand class for ptg ("
- + ptg.toString() + "). Expected " + getOperandClassName(operandClass)
+ + ptg + "). Expected " + getOperandClassName(operandClass)
+ " but got " + getOperandClassName(ptg.getPtgClass()));
}
}
diff --git a/src/testcases/org/apache/poi/hssf/model/TestRVA.java b/src/testcases/org/apache/poi/hssf/model/TestRVA.java
index 4869d87d61..ec090bd537 100644
--- a/src/testcases/org/apache/poi/hssf/model/TestRVA.java
+++ b/src/testcases/org/apache/poi/hssf/model/TestRVA.java
@@ -125,7 +125,7 @@ public final class TestRVA {
if (poiPtg.isBaseToken()) {
continue;
}
- sb.append(" token[" + i + "] " + excelPtg.toString() + " "
+ sb.append(" token[" + i + "] " + excelPtg + " "
+ excelPtg.getRVAType());
if (excelPtg.getPtgClass() != poiPtg.getPtgClass()) {
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
index f02b950f84..62d20273df 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
@@ -439,7 +439,7 @@ public final class TestCellStyle extends TestCase {
if (cell.getCellTypeEnum() == CellType.NUMERIC) {
boolean isDate = HSSFDateUtil.isCellDateFormatted(cell);
if (idxCell > 0 && isDate) {
- fail("cell " + idxCell + " is not a date: " + idxCell.toString());
+ fail("cell " + idxCell + " is not a date: " + idxCell);
}
}
}
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java
index 9e8c4a3ef0..ebdbe9ca41 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java
@@ -91,7 +91,7 @@ public final class TestFormulaEvaluatorBugs {
FileOutputStream out = new FileOutputStream(existing);
wb.write(out);
out.close();
- System.err.println("Existing file for bug #44636 written to " + existing.toString());
+ System.err.println("Existing file for bug #44636 written to " + existing);
}
wb.close();
@@ -115,7 +115,7 @@ public final class TestFormulaEvaluatorBugs {
FileOutputStream out = new FileOutputStream(scratch);
wb.write(out);
out.close();
- System.err.println("New file for bug #44636 written to " + scratch.toString());
+ System.err.println("New file for bug #44636 written to " + scratch);
}
wb.close();
}
diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java b/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java
index 9db99b1e56..f3128579c3 100644
--- a/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java
+++ b/src/testcases/org/apache/poi/ss/formula/eval/TestMultiSheetEval.java
@@ -282,9 +282,9 @@ public final class TestMultiSheetEval extends TestCase {
e.printStackTrace(ps);
}
endIx -= 4; // skip 4 frames of reflection invocation
- ps.println(e.toString());
+ ps.println(e);
for(int i=startIx; i 0) {
- throw new AssertionFailedError(failureCount + " IRR assertions failed:\n" + failures.toString());
+ throw new AssertionFailedError(failureCount + " IRR assertions failed:\n" + failures);
}
}
@@ -128,7 +128,7 @@ public final class TestIrr extends TestCase {
private static void assertFormulaResult(CellValue cv, HSSFCell cell){
double actualValue = cv.getNumberValue();
double expectedValue = cell.getNumericCellValue(); // cached formula result calculated by Excel
- assertEquals("Invalid formula result: " + cv.toString(), CellType.NUMERIC, cv.getCellTypeEnum());
+ assertEquals("Invalid formula result: " + cv, CellType.NUMERIC, cv.getCellTypeEnum());
assertEquals(expectedValue, actualValue, 1E-4); // should agree within 0.01%
}
}
diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java b/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java
index f38bff7fc1..32f078fe32 100644
--- a/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java
+++ b/src/testcases/org/apache/poi/ss/formula/functions/TestMirr.java
@@ -154,7 +154,7 @@ public final class TestMirr extends TestCase {
assertEquals(ErrorEval.DIV_ZERO.getErrorCode(), cv.getErrorValue());
if (failures.length() > 0) {
- throw new AssertionFailedError(failureCount + " IRR assertions failed:\n" + failures.toString());
+ throw new AssertionFailedError(failureCount + " IRR assertions failed:\n" + failures);
}
}
@@ -162,7 +162,7 @@ public final class TestMirr extends TestCase {
private static void assertFormulaResult(CellValue cv, HSSFCell cell) {
double actualValue = cv.getNumberValue();
double expectedValue = cell.getNumericCellValue(); // cached formula result calculated by Excel
- assertEquals("Invalid formula result: " + cv.toString(), CellType.NUMERIC, cv.getCellTypeEnum());
+ assertEquals("Invalid formula result: " + cv, CellType.NUMERIC, cv.getCellTypeEnum());
assertEquals(expectedValue, actualValue, 1E-8);
}
}
diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java b/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java
index f26b70f162..34aa877723 100644
--- a/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java
+++ b/src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java
@@ -90,7 +90,7 @@ public final class TestNpv extends TestCase {
}
if(failures.length() > 0) {
- throw new AssertionFailedError(failureCount + " IRR evaluations failed:\n" + failures.toString());
+ throw new AssertionFailedError(failureCount + " IRR evaluations failed:\n" + failures);
}
}
diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java b/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java
index 24d347270a..81968663a9 100644
--- a/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java
+++ b/src/testcases/org/apache/poi/ss/formula/functions/TestOffset.java
@@ -35,7 +35,7 @@ public final class TestOffset extends TestCase {
try {
assertEquals(expected, Offset.evaluateIntArg(new NumberEval(doubleVal), -1, -1));
} catch (EvaluationException e) {
- throw new AssertionFailedError("Unexpected error '" + e.getErrorEval().toString() + "'.");
+ throw new AssertionFailedError("Unexpected error '" + e.getErrorEval() + "'.");
}
}
/**
diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java b/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java
index f408a42ed8..0e4bd8224b 100644
--- a/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java
+++ b/src/testcases/org/apache/poi/ss/formula/functions/TestPmt.java
@@ -41,7 +41,7 @@ public final class TestPmt {
private static NumberEval invokeNormal(ValueEval[] args) {
ValueEval ev = invoke(args);
if(ev instanceof ErrorEval) {
- fail("Normal evaluation failed with error code: " + ev.toString());
+ fail("Normal evaluation failed with error code: " + ev);
}
return (NumberEval) ev;
}
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
index 9222f60430..aaf9272467 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
@@ -778,10 +778,10 @@ public abstract class BaseTestWorkbook {
for(int i = 0;i < wb.getNumberOfSheets();i++) {
sheetNames.append(wb.getSheetAt(i).getSheetName()).append(",");
}
- assertEquals("Had: " + sheetNames.toString(),
+ assertEquals("Had: " + sheetNames,
sheets.length, wb.getNumberOfSheets());
for(int i = 0;i < wb.getNumberOfSheets();i++) {
- assertEquals("Had: " + sheetNames.toString(),
+ assertEquals("Had: " + sheetNames,
sheets[i], wb.getSheetAt(i).getSheetName());
}
}
diff --git a/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java b/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java
index d4d63192d0..c310f4a78d 100644
--- a/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java
+++ b/src/testcases/org/apache/poi/ss/util/TestExpandedDouble.java
@@ -134,7 +134,7 @@ public final class TestExpandedDouble {
// but bigger errors are a concern
System.out.println("example[" + i + "] ("
- + formatDoubleAsHex(a) + ") frac mismatch: " + diff.toString());
+ + formatDoubleAsHex(a) + ") frac mismatch: " + diff);
for (int j=-2; j<3; j++) {
System.out.println((j<0?"":"+") + j + ": " + getNearby(ed1, j));
diff --git a/src/testcases/org/apache/poi/util/TestStringUtil.java b/src/testcases/org/apache/poi/util/TestStringUtil.java
index ec9792a259..76f934f148 100644
--- a/src/testcases/org/apache/poi/util/TestStringUtil.java
+++ b/src/testcases/org/apache/poi/util/TestStringUtil.java
@@ -173,7 +173,7 @@ public class TestStringUtil {
assertTrue("longer string", StringUtil.startsWithIgnoreCase("Apache POI project", "Apache POI"));
assertTrue("different case", StringUtil.startsWithIgnoreCase("APACHE POI", "Apache POI"));
assertFalse("leading whitespace should not be ignored", StringUtil.startsWithIgnoreCase(" Apache POI project", "Apache POI"));
- assertFalse("shorter string", StringUtil.startsWithIgnoreCase("Apache", "Apache POI"));;
+ assertFalse("shorter string", StringUtil.startsWithIgnoreCase("Apache", "Apache POI"));
}
@Test