You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tez.apache.org by "Zhiyuan Yang (JIRA)" <ji...@apache.org> on 2017/04/20 19:59:04 UTC
[jira] [Commented] (TEZ-3687) Code smell in DAGStatus and
VertexStatus equals implementation
[ https://issues.apache.org/jira/browse/TEZ-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15977352#comment-15977352 ]
Zhiyuan Yang commented on TEZ-3687:
-----------------------------------
Patch committed.
{noformat}
commit c9c6fbf5f185abc3883ac29a724b032579e47cd1
Author: Zhiyuan Yang <zh...@apache.org>
Date: Thu Apr 20 12:57:12 2017 -0700
TEZ-3687. Code smell in DAGStatus and VertexStatus equals implementation (Akira Ajisaka via zhiyuany)
{noformat}
> Code smell in DAGStatus and VertexStatus equals implementation
> --------------------------------------------------------------
>
> Key: TEZ-3687
> URL: https://issues.apache.org/jira/browse/TEZ-3687
> Project: Apache Tez
> Issue Type: Bug
> Reporter: JC
> Assignee: Akira Ajisaka
> Priority: Trivial
> Attachments: TEZ-3687.01.patch
>
>
> Hi
> In a recent snapshot mirrored from GitHub (tez), I've found code smells that may case a bug.
> Path: tez-api/src/main/java/org/apache/tez/dag/api/client/DAGStatus.java
> {code}
> 161 public boolean equals(Object obj) {
> 162 // Source explicitly exclude from equals
> 163 if (obj instanceof DAGStatus){
> 164 DAGStatus other = (DAGStatus)obj;
> 165 return getState() == other.getState()
> 166 && getDiagnostics().equals(other.getDiagnostics())
> 167 && getDAGProgress().equals(getDAGProgress())
> 168 && getVertexProgress().equals(getVertexProgress())
> 169 &&
> 170 ((getDAGCounters() == null && other.getDAGCounters() == null)
> 171 || getDAGCounters().equals(other.getDAGCounters()));
> 172 }
> 173 return false;
> 174 }
> {code}
> In Line 167 and 168, the conditions should be
> getDAGProgress().equals(other.getDAGProgress())
> getVertexProgress().equals(other.getVertexProgress())
> respectively?
> Path: tez-api/src/main/java/org/apache/tez/dag/api/client/VertexStatus.java
> {code}
> 119 public boolean equals(Object obj) {
> 120 if (obj instanceof VertexStatus){
> 121 VertexStatus other = (VertexStatus)obj;
> 122 return getState().equals(other.getState())
> 123 && getDiagnostics().equals(getDiagnostics())
> 124 && getProgress().equals(getProgress())
> 125 &&
> 126 ((getVertexCounters() == null && other.getVertexCounters() == null)
> 127 || getVertexCounters().equals(other.getVertexCounters()));
> 128 }
> 129 return false;
> 130 }
> {code}
> in In Line 123 and 124, the conditions should be
> getDiagnostics().equals(other.getDiagnostics())
> getProgress().equals(other.getProgress())
> respectively?
> These might be trivial things but wanted to report just in case. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)