Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Cartaud2016-10-17 10:08:07 -0400
committerMathieu Cartaud2016-10-17 10:41:41 -0400
commitd8af5faeb2bff1a0658af54957deb7012c7e4b0c (patch)
tree3451d828f1b322cf3294e01a94d8f3e0e8d14b53
parent437f8b87681504931f33a4952283625215266ccb (diff)
downloadorg.eclipse.emf.compare-d8af5faeb2bff1a0658af54957deb7012c7e4b0c.tar.gz
org.eclipse.emf.compare-d8af5faeb2bff1a0658af54957deb7012c7e4b0c.tar.xz
org.eclipse.emf.compare-d8af5faeb2bff1a0658af54957deb7012c7e4b0c.zip
Refactor OverlayImageProvider to use StringBuilders
Change-Id: I3f2bbc0c86579b8f614349c9f566afa2e466e384 Signed-off-by: Mathieu Cartaud <mathieu.cartaud@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
index 05eca924a..11eb887a1 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
@@ -172,28 +172,28 @@ public class OverlayImageProvider {
final DifferenceKind diffKind = diff.getKind();
final DifferenceSource source = diff.getSource();
- String path = "";
+ StringBuilder path = new StringBuilder();
if (hasDirectOrIndirectConflict(REAL).apply(diff)) {
// The diff or one of its refining diffs are in a pseudo conflict
- path += "conf";
+ path.append("conf");
if (source == DifferenceSource.RIGHT) {
- path += "r_";
+ path.append("r_");
}
} else if (canBeConsideredAsPseudoConflicting().apply(diff)) {
// If the diff is not a refined diff and are in a pseudo conflict
// Or if the diff is a refined diff that are not in a direct pseudo conflict, but all its refining
// diffs are in pseudo conflicts
- path += "pconf";
+ path.append("pconf");
if (source == DifferenceSource.RIGHT) {
- path += "r_";
+ path.append("r_");
}
} else {
switch (source) {
case LEFT:
- path += "r_out";
+ path.append("r_out");
break;
case RIGHT:
- path += "r_in";
+ path.append("r_in");
break;
default:
// Cannot happen ... for now
@@ -203,21 +203,21 @@ public class OverlayImageProvider {
switch (diffKind) {
case ADD:
- path += ADD_OV;
+ path.append(ADD_OV);
break;
case DELETE:
- path += DEL_OV;
+ path.append(DEL_OV);
break;
case CHANGE:
// fallthrough
case MOVE:
- path += CHG_OV;
+ path.append(CHG_OV);
break;
default:
// Cannot happen ... for now
break;
}
- return path;
+ return path.toString();
}
/**

Back to the top