You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tez.apache.org by "TezQA (JIRA)" <ji...@apache.org> on 2017/04/20 10:11:04 UTC

[jira] [Commented] (TEZ-3687) Code smell in equals implementation

    [ https://issues.apache.org/jira/browse/TEZ-3687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15976433#comment-15976433 ] 

TezQA commented on TEZ-3687:
----------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment
  http://issues.apache.org/jira/secure/attachment/12864216/TEZ-3687.01.patch
  against master revision fb0e45b.

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    {color:green}+1 javac{color}.  The applied patch does not increase the total number of javac compiler warnings.

    {color:green}+1 javadoc{color}.  There were no new javadoc warning messages.

    {color:green}+1 findbugs{color}.  The patch does not introduce any new Findbugs (version 3.0.1) warnings.

    {color:green}+1 release audit{color}.  The applied patch does not increase the total number of release audit warnings.

    {color:green}+1 core tests{color}.  The patch passed unit tests in .

Test results: https://builds.apache.org/job/PreCommit-TEZ-Build/2384//testReport/
Console output: https://builds.apache.org/job/PreCommit-TEZ-Build/2384//console

This message is automatically generated.

> Code smell in 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)