From d8af5faeb2bff1a0658af54957deb7012c7e4b0c Mon Sep 17 00:00:00 2001 From: Mathieu Cartaud Date: Mon, 17 Oct 2016 16:08:07 +0200 Subject: Refactor OverlayImageProvider to use StringBuilders Change-Id: I3f2bbc0c86579b8f614349c9f566afa2e466e384 Signed-off-by: Mathieu Cartaud --- .../provider/spec/OverlayImageProvider.java | 22 +++++++++++----------- 1 file 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(); } /** -- cgit v1.2.3