@@ -1397,7 +1397,7 @@ public final String getSelectedText()
13971397 start = tmp ;
13981398 }
13991399
1400- StringBuffer buf = new StringBuffer ();
1400+ StringBuilder sb = new StringBuilder ();
14011401 Segment seg = new Segment ();
14021402
14031403 for (int i = selectionStartLine ; i <= selectionEndLine ; i ++)
@@ -1411,13 +1411,13 @@ public final String getSelectedText()
14111411 lineLen = Math .min (end - start ,lineEnd - lineStart );
14121412
14131413 getText (lineStart ,lineLen ,seg );
1414- buf .append (seg .array ,seg .offset ,seg .count );
1414+ sb .append (seg .array ,seg .offset ,seg .count );
14151415
14161416 if (i != selectionEndLine )
1417- buf .append ('\n' );
1417+ sb .append ('\n' );
14181418 }
14191419
1420- return buf .toString ();
1420+ return sb .toString ();
14211421 }
14221422 else
14231423 {
@@ -1691,11 +1691,11 @@ public void copy() {
16911691 String selection = getSelectedText ();
16921692
16931693 int repeatCount = inputHandler .getRepeatCount ();
1694- StringBuffer buf = new StringBuffer ();
1694+ StringBuilder sb = new StringBuilder ();
16951695 for (int i = 0 ; i < repeatCount ; i ++)
1696- buf .append (selection );
1696+ sb .append (selection );
16971697
1698- clipboard .setContents (new StringSelection (buf .toString ()),null );
1698+ clipboard .setContents (new StringSelection (sb .toString ()), null );
16991699 }
17001700 }
17011701
@@ -1721,7 +1721,7 @@ public void copy() {
17211721 * specific to any language or version of the PDE.
17221722 */
17231723 public void copyAsHTML () {
1724- StringBuffer cf = new StringBuffer ("<html><body><pre>\n " );
1724+ StringBuilder cf = new StringBuilder ("<html><body><pre>\n " );
17251725
17261726 int selStart = getSelectionStart ();
17271727 int selStop = getSelectionStop ();
@@ -1758,7 +1758,7 @@ public void lostOwnership(Clipboard clipboard, Transferable contents) {
17581758 }
17591759
17601760
1761- private void emitAsHTML (StringBuffer cf , int line ) {
1761+ private void emitAsHTML (StringBuilder cf , int line ) {
17621762 Segment segment = new Segment ();
17631763 getLineText (line , segment );
17641764
@@ -1839,7 +1839,7 @@ private void emitAsHTML(StringBuffer cf, int line) {
18391839 /**
18401840 * Handle encoding HTML entities for lt, gt, and anything non-ASCII.
18411841 */
1842- private void appendAsHTML (StringBuffer buffer , char c ) {
1842+ private void appendAsHTML (StringBuilder buffer , char c ) {
18431843 if (c == '<' ) {
18441844 buffer .append ("<" );
18451845 } else if (c == '>' ) {
@@ -1903,11 +1903,11 @@ public void paste() {
19031903 }
19041904
19051905 int repeatCount = inputHandler .getRepeatCount ();
1906- StringBuffer buf = new StringBuffer ();
1906+ StringBuilder sb = new StringBuilder ();
19071907 for (int i = 0 ; i < repeatCount ; i ++) {
1908- buf .append (selection );
1908+ sb .append (selection );
19091909 }
1910- selection = buf .toString ();
1910+ selection = sb .toString ();
19111911 setSelectedText (selection );
19121912
19131913 } catch (Exception e ) {
0 commit comments