tmf.ui: Change the == operator with the equals() method
authorBruno Roy <bruno.roy@ericsson.com>
Tue, 3 May 2016 18:00:12 +0000 (14:00 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 15 Jun 2016 17:51:58 +0000 (13:51 -0400)
Change-Id: I4633d1aa33c49fc7e1da3bb449cb5a25e85870a4
Signed-off-by: Bruno Roy <bruno.roy@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/71935
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/BaseMessage.java

index bafe90894362b566a8ef80ff3b8683fa4defdc93..6d20ef1a43502e4485aad2cb0fd1f659c5958f60 100755 (executable)
@@ -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));
This page took 0.026228 seconds and 5 git commands to generate.