diff options
author | Matthew Khouzam | 2015-02-26 20:10:43 +0000 |
---|---|---|
committer | Matthew Khouzam | 2015-02-27 22:39:41 +0000 |
commit | 833c5fe71827fa620027342210d5f7c4f4a3a32a (patch) | |
tree | 011fb65eae519170e97da9bcc1d711b2a0e79b85 /org.eclipse.tracecompass.tmf.ui | |
parent | 69f69836e39005529a43281a24d0b7bbe5dab739 (diff) | |
download | org.eclipse.tracecompass-833c5fe71827fa620027342210d5f7c4f4a3a32a.tar.gz org.eclipse.tracecompass-833c5fe71827fa620027342210d5f7c4f4a3a32a.tar.xz org.eclipse.tracecompass-833c5fe71827fa620027342210d5f7c4f4a3a32a.zip |
tmf.ui: reduce complexity in FileAndName equals
Change-Id: Ib7567ab3a1cad3d7bc0f907c08a4db8923f98538
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/42842
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Diffstat (limited to 'org.eclipse.tracecompass.tmf.ui')
-rw-r--r-- | org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/FileAndName.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/FileAndName.java b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/FileAndName.java index 9dd48b2446..f970dae7d0 100644 --- a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/FileAndName.java +++ b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/wizards/importtrace/FileAndName.java @@ -14,6 +14,8 @@ package org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace; import java.io.File; +import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable; + /** * File and name internal helper class <br> * it has the file, a name to display, whether the name is conflicting and a @@ -169,18 +171,10 @@ class FileAndName implements Comparable<FileAndName> { return false; } FileAndName other = (FileAndName) obj; - if (fTraceTypeId == null) { - if (other.fTraceTypeId != null) { - return false; - } - } else if (!fTraceTypeId.equals(other.fTraceTypeId)) { + if (!equalsNullable(fTraceTypeId, other.fTraceTypeId)) { return false; } - if (fFile == null) { - if (other.fFile != null) { - return false; - } - } else if (!fFile.equals(other.fFile)) { + if (!equalsNullable(fFile, other.fFile)) { return false; } return true; |