From d66dc2321e7787c5b8e664541c0553ac5b9bd68b Mon Sep 17 00:00:00 2001 From: Bruno Roy Date: Tue, 3 May 2016 14:00:12 -0400 Subject: [PATCH] tmf.ui: Change the == operator with the equals() method Change-Id: I4633d1aa33c49fc7e1da3bb449cb5a25e85870a4 Signed-off-by: Bruno Roy Reviewed-on: https://git.eclipse.org/r/71935 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann --- .../tmf/ui/views/uml2sd/core/BaseMessage.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/BaseMessage.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/BaseMessage.java index bafe908943..6d20ef1a43 100755 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/BaseMessage.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/BaseMessage.java @@ -168,7 +168,7 @@ public abstract class BaseMessage extends GraphNode { int width = 0; int activationWidth = Metrics.EXECUTION_OCCURRENCE_WIDTH / 2; if ((fStartLifeline != null) && (fEndLifeline != null)) { - if (fStartLifeline == fEndLifeline) { + if (fStartLifeline.equals(fEndLifeline)) { width = Metrics.INTERNAL_MESSAGE_WIDTH + Metrics.EXECUTION_OCCURRENCE_WIDTH; } else { width = fEndLifeline.getX() + Metrics.getLifelineWidth() / 2 - getX(true); @@ -364,7 +364,7 @@ public abstract class BaseMessage extends GraphNode { int tempHeight = Metrics.MESSAGES_NAME_SPACING + Metrics.getMessageFontHeigth(); // Is it a self message? - if (fStartLifeline == fEndLifeline) { + if (fStartLifeline.equals(fEndLifeline)) { /* * Rectangle.contains(x,y, width, height) does not works with negative height or width We check here if the * rectangle width is negative. @@ -426,7 +426,7 @@ public abstract class BaseMessage extends GraphNode { // UML2 found message (always drawn from left to right) // or UML2 lost message (always drawn from left to right) - if ((fStartLifeline == null || fEndLifeline == null) && fStartLifeline != fEndLifeline) { + if ((fStartLifeline == null || fEndLifeline == null) && !fStartLifeline.equals(fEndLifeline)) { // Draw the message label above the message and centered // The label is truncated if it cannot fit between the two message end // 2*Metrics.MESSAGES_NAME_SPACING = space above the label + space below the label @@ -482,7 +482,7 @@ public abstract class BaseMessage extends GraphNode { fH = height + 2 * yt.intValue(); } // it is self message (always drawn at the left side of the owning lifeLifeline) - else if (fStartLifeline != null && fEndLifeline != null && fStartLifeline == fEndLifeline) { + else if (fStartLifeline != null && fEndLifeline != null && fStartLifeline.equals(fEndLifeline)) { /* * Self syncMessages are drawn in 5 parts 1 -----------+ + 2 + | | | 3 | + 5 + 4 -----------+ */ @@ -707,7 +707,7 @@ public abstract class BaseMessage extends GraphNode { ISDPreferences pref = SDViewPref.getInstance(); - if ((fStartLifeline != fEndLifeline) && (getStartOccurrence() == getEndOccurrence())) { + if ((!fStartLifeline.equals(fEndLifeline)) && (getStartOccurrence() == getEndOccurrence())) { context.setLineStyle(context.getLineDotStyle()); context.setLineWidth(Metrics.NORMAL_LINE_WIDTH); context.setBackground(pref.getBackGroundColorSelection()); @@ -715,7 +715,7 @@ public abstract class BaseMessage extends GraphNode { context.drawFocus(getX(), getY() - 3, getWidth(), getHeight() + 6); } else if ((fStartLifeline == fEndLifeline) && (getStartOccurrence() == getEndOccurrence())) { context.drawFocus(getX(), getY() - 3, getWidth(), Metrics.SYNC_INTERNAL_MESSAGE_HEIGHT + 6); - } else if ((fStartLifeline != fEndLifeline) && (getStartOccurrence() != getEndOccurrence())) { + } else if ((!fStartLifeline.equals(fEndLifeline)) && (getStartOccurrence() != getEndOccurrence())) { context.setLineStyle(context.getLineDotStyle()); context.setLineWidth(Metrics.NORMAL_LINE_WIDTH); context.setBackground(pref.getBackGroundColor(ISDPreferences.PREF_LIFELINE_HEADER)); -- 2.34.1