Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2017-07-13 13:52:43 -0400
committerLars Vogel2017-07-13 13:52:43 -0400
commit11c5314f205e5856611f64fdee44f2772cfa01d7 (patch)
treeddf550bafc81bc810e46bc61e1b41daf7553257f /bundles
parent217747f332fa1a41925e267372d7d2ff74925d45 (diff)
downloadeclipse.platform.team-11c5314f205e5856611f64fdee44f2772cfa01d7.tar.gz
eclipse.platform.team-11c5314f205e5856611f64fdee44f2772cfa01d7.tar.xz
eclipse.platform.team-11c5314f205e5856611f64fdee44f2772cfa01d7.zip
Bug 519655 - Use StringBuilder instead of StringBuffer in
org.eclipse.compare.core Change-Id: Ibc88c456dd80dacdafa76212a3ef9603adbeb966 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java10
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java4
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java2
3 files changed, 8 insertions, 8 deletions
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java
index 033cf8e26..2ee614207 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/Hunk.java
@@ -88,7 +88,7 @@ public class Hunk implements IHunk {
* </ul>
*/
public String getContent() {
- StringBuffer sb= new StringBuffer();
+ StringBuilder sb= new StringBuilder();
for (int i= 0; i < this.fLines.length; i++) {
String line= this.fLines[i];
sb.append(line.substring(0, LineReader.length(line)));
@@ -102,7 +102,7 @@ public class Hunk implements IHunk {
* It is in the form old_start,old_length -> new_start,new_length.
*/
String getDescription() {
- StringBuffer sb= new StringBuffer();
+ StringBuilder sb= new StringBuilder();
sb.append(Integer.toString(this.fOldStart));
sb.append(',');
sb.append(Integer.toString(this.fOldLength));
@@ -114,7 +114,7 @@ public class Hunk implements IHunk {
}
public String getRejectedDescription() {
- StringBuffer sb= new StringBuffer();
+ StringBuilder sb= new StringBuilder();
sb.append("@@ -"); //$NON-NLS-1$
sb.append(Integer.toString(this.fOldStart));
sb.append(',');
@@ -448,7 +448,7 @@ public class Hunk implements IHunk {
* Whitespace is defined by <code>Character.isWhitespace(...)</code>.
*/
private String stripWhiteSpace(String s) {
- StringBuffer sb= new StringBuffer();
+ StringBuilder sb= new StringBuilder();
int l= s.length();
for (int i= 0; i < l; i++) {
char c= s.charAt(i);
@@ -459,7 +459,7 @@ public class Hunk implements IHunk {
}
public String getContents(boolean isAfterState, boolean reverse) {
- StringBuffer result= new StringBuffer();
+ StringBuilder result= new StringBuilder();
for (int i= 0; i<this.fLines.length; i++) {
String line= this.fLines[i];
String rest= line.substring(1);
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
index 43a843769..35f32c666 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/patch/LineReader.java
@@ -66,7 +66,7 @@ public class LineReader {
* Concatenates all strings found in the given List.
*/
public static String createString(boolean preserveLineDelimeters, List<String> lines) {
- StringBuffer sb= new StringBuffer();
+ StringBuilder sb= new StringBuilder();
Iterator<String> iter= lines.iterator();
if (preserveLineDelimeters) {
while (iter.hasNext())
@@ -111,7 +111,7 @@ public class LineReader {
private boolean fSawEOF= false;
private BufferedReader fReader;
private boolean fIgnoreSingleCR= false;
- private StringBuffer fBuffer= new StringBuffer();
+ private StringBuilder fBuffer= new StringBuilder();
public LineReader(BufferedReader reader) {
this.fReader= reader;
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java
index cc3ae72d8..455a845b0 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java
@@ -288,7 +288,7 @@ public class RangeDifference {
@Override
public String toString() {
- StringBuffer buf = new StringBuffer("RangeDifference {"); //$NON-NLS-1$
+ StringBuilder buf = new StringBuilder("RangeDifference {"); //$NON-NLS-1$
switch (this.kind) {
case NOCHANGE:
buf.append("NOCHANGE"); //$NON-NLS-1$

Back to the top