]> source.dussan.org Git - poi.git/commitdiff
replace some more StringBuffers
authorPJ Fanning <fanningpj@apache.org>
Thu, 21 Nov 2019 16:04:37 +0000 (16:04 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 21 Nov 2019 16:04:37 +0000 (16:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1870096 13f79535-47bb-0310-9956-ffa450edef68

src/excelant/testcases/org/apache/poi/ss/excelant/BuildFileTest.java
src/testcases/org/apache/poi/ss/formula/functions/TestNpv.java

index 2a4d7149803d93c31b64b242c56819cbfa2b1ea0..a582a45ab339b5c905a95ad7a643524989f25158 100644 (file)
@@ -48,10 +48,10 @@ public abstract class BuildFileTest extends TestCase {
 
     protected Project project;
 
-    private StringBuffer logBuffer;
-    private StringBuffer fullLogBuffer;
-    private StringBuffer outBuffer;
-    private StringBuffer errBuffer;
+    private StringBuilder logBuffer;
+    private StringBuilder fullLogBuffer;
+    private StringBuilder outBuffer;
+    private StringBuilder errBuffer;
     private BuildException buildException;
 
     /**
@@ -265,8 +265,8 @@ public abstract class BuildFileTest extends TestCase {
         return buildException;
     }
 
-    private String cleanBuffer(StringBuffer buffer) {
-        StringBuffer cleanedBuffer = new StringBuffer();
+    private String cleanBuffer(StringBuilder buffer) {
+        StringBuilder cleanedBuffer = new StringBuilder();
         for (int i = 0; i < buffer.length(); i++) {
             char ch = buffer.charAt(i);
             if (ch != '\r') {
@@ -292,8 +292,8 @@ public abstract class BuildFileTest extends TestCase {
      */
     public void configureProject(String filename, int logLevel)
             throws BuildException {
-        logBuffer = new StringBuffer();
-        fullLogBuffer = new StringBuffer();
+        logBuffer = new StringBuilder();
+        fullLogBuffer = new StringBuilder();
         project = new Project();
         project.init();
         project.setNewProperty("data.dir.name", getDataDir());
@@ -315,14 +315,14 @@ public abstract class BuildFileTest extends TestCase {
         try {
             sysOut.flush();
             sysErr.flush();
-            outBuffer = new StringBuffer();
+            outBuffer = new StringBuilder();
             PrintStream out = new PrintStream(new AntOutputStream(outBuffer));
             System.setOut(out);
-            errBuffer = new StringBuffer();
+            errBuffer = new StringBuilder();
             PrintStream err = new PrintStream(new AntOutputStream(errBuffer));
             System.setErr(err);
-            logBuffer = new StringBuffer();
-            fullLogBuffer = new StringBuffer();
+            logBuffer = new StringBuilder();
+            fullLogBuffer = new StringBuilder();
             buildException = null;
             project.executeTarget(targetName);
         } finally {
@@ -483,9 +483,9 @@ public abstract class BuildFileTest extends TestCase {
      * an output stream which saves stuff to our buffer.
      */
     protected static class AntOutputStream extends java.io.OutputStream {
-        private StringBuffer buffer;
+        private StringBuilder buffer;
 
-        public AntOutputStream(StringBuffer buffer) {
+        public AntOutputStream(StringBuilder buffer) {
             this.buffer = buffer;
         }
 
index c3963cced7093b7020d5ad8a163ede19bdc9cce9..fa9cc424421e6c2916a8172b8c74387a025d9b77 100644 (file)
@@ -71,7 +71,7 @@ public final class TestNpv extends TestCase {
         HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("IrrNpvTestCaseData.xls");
         HSSFSheet sheet = wb.getSheet("IRR-NPV");
         HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
-        StringBuffer failures = new StringBuffer();
+        StringBuilder failures = new StringBuilder();
         int failureCount = 0;
         // TODO YK: Formulas in rows 16 and 17 operate with ArrayPtg which isn't yet supported
         // FormulaEvaluator as of r1041407 throws "Unexpected ptg class (org.apache.poi.ss.formula.ptg.ArrayPtg)"