Modified: 
poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java?rev=1813869&r1=1813868&r2=1813869&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java 
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java 
Tue Oct 31 10:24:47 2017
@@ -45,7 +45,7 @@ public class XWPFParagraph implements IB
     protected List<XWPFRun> runs;
     protected List<IRunElement> iruns;
 
-    private StringBuffer footnoteText = new StringBuffer();
+    private StringBuilder footnoteText = new StringBuilder(64);
 
     public XWPFParagraph(CTP prgrph, IBody part) {
         this.paragraph = prgrph;
@@ -184,7 +184,7 @@ public class XWPFParagraph implements IB
      * and sdt elements in it.
      */
     public String getText() {
-        StringBuffer out = new StringBuffer();
+        StringBuilder out = new StringBuilder(64);
         for (IRunElement run : iruns) {
             if (run instanceof XWPFRun) {
                 XWPFRun xRun = (XWPFRun) run;
@@ -398,7 +398,7 @@ public class XWPFParagraph implements IB
      * paragraph
      */
     public String getParagraphText() {
-        StringBuffer out = new StringBuffer();
+        StringBuilder out = new StringBuilder(64);
         for (XWPFRun run : runs) {
             out.append(run);
         }
@@ -409,7 +409,7 @@ public class XWPFParagraph implements IB
      * Returns any text from any suitable pictures in the paragraph
      */
     public String getPictureText() {
-        StringBuffer out = new StringBuffer();
+        StringBuilder out = new StringBuilder(64);
         for (XWPFRun run : runs) {
             out.append(run.getPictureText());
         }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java?rev=1813869&r1=1813868&r2=1813869&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java 
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java Tue Oct 
31 10:24:47 2017
@@ -1060,7 +1060,7 @@ public class XWPFRun implements ISDTCont
      * carriage returns in place of their xml equivalents.
      */
     public String text() {
-        StringBuffer text = new StringBuffer();
+        StringBuilder text = new StringBuilder(64);
 
         // Grab the text and tabs of the text run
         // Do so in a way that preserves the ordering
@@ -1084,7 +1084,7 @@ public class XWPFRun implements ISDTCont
      * @return the phonetic (ruby) string associated with this run or an empty 
String if none exists
      */
     public String getPhonetic() {
-        StringBuffer text = new StringBuffer();
+        StringBuilder text = new StringBuilder(64);
 
         // Grab the text and tabs of the text run
         // Do so in a way that preserves the ordering
@@ -1110,7 +1110,7 @@ public class XWPFRun implements ISDTCont
      * @param text buffer to which to append the content
      * @param extractPhonetic extract the phonetic (rt) component or the base 
component
      */
-    private void handleRuby(XmlObject rubyObj, StringBuffer text, boolean 
extractPhonetic) {
+    private void handleRuby(XmlObject rubyObj, StringBuilder text, boolean 
extractPhonetic) {
         XmlCursor c = rubyObj.newCursor();
 
         //according to the spec, a ruby object
@@ -1141,7 +1141,7 @@ public class XWPFRun implements ISDTCont
         c.dispose();
     }
 
-    private void _getText(XmlObject o, StringBuffer text) {
+    private void _getText(XmlObject o, StringBuilder text) {
 
         if (o instanceof CTText) {
             String tagName = o.getDomNode().getNodeName();
@@ -1170,10 +1170,10 @@ public class XWPFRun implements ISDTCont
         }
 
         if (o instanceof CTPTab) {
-            text.append("\t");
+            text.append('\t');
         }
         if (o instanceof CTBr) {
-            text.append("\n");
+            text.append('\n');
         }
         if (o instanceof CTEmpty) {
             // Some inline text elements get returned not as
@@ -1183,13 +1183,13 @@ public class XWPFRun implements ISDTCont
             //  rules for that case
             String tagName = o.getDomNode().getNodeName();
             if ("w:tab".equals(tagName) || "tab".equals(tagName)) {
-                text.append("\t");
+                text.append('\t');
             }
             if ("w:br".equals(tagName) || "br".equals(tagName)) {
-                text.append("\n");
+                text.append('\n');
             }
             if ("w:cr".equals(tagName) || "cr".equals(tagName)) {
-                text.append("\n");
+                text.append('\n');
             }
         }
         if (o instanceof CTFtnEdnRef) {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java?rev=1813869&r1=1813868&r2=1813869&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java 
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java Tue 
Oct 31 10:24:47 2017
@@ -71,7 +71,7 @@ public class XWPFTable implements IBodyE
         stBorderTypeMap.put(STBorder.INT_DOT_DASH, XWPFBorderType.DOT_DASH);
     }
 
-    protected StringBuffer text = new StringBuffer();
+    protected StringBuilder text = new StringBuilder(64);
     protected List<XWPFTableRow> tableRows;
 
     // Unused: UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD

Modified: 
poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java?rev=1813869&r1=1813868&r2=1813869&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java 
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableCell.java 
Tue Oct 31 10:24:47 2017
@@ -435,7 +435,7 @@ public class XWPFTableCell implements IB
      */
     public String getTextRecursively() {
 
-        StringBuffer text = new StringBuffer();
+        StringBuilder text = new StringBuilder(64);
         for (int i = 0; i < bodyElements.size(); i++) {
             boolean isLast = (i == bodyElements.size() - 1);
             appendBodyElementText(text, bodyElements.get(i), isLast);
@@ -444,7 +444,7 @@ public class XWPFTableCell implements IB
         return text.toString();
     }
 
-    private void appendBodyElementText(StringBuffer text, IBodyElement e, 
boolean isLast) {
+    private void appendBodyElementText(StringBuilder text, IBodyElement e, 
boolean isLast) {
         if (e instanceof XWPFParagraph) {
             text.append(((XWPFParagraph) e).getText());
             if (!isLast) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to